compute_speedups() — pytorch Function Reference
Architecture documentation for the compute_speedups() function in microbench.py from the pytorch codebase.
Entity Profile
Dependency Diagram
graph TD 0c913e59_9191_0190_ce44_ba814a18cb93["compute_speedups()"] f3575d6f_d852_9193_8d21_437bde29bfae["microbenchmark()"] f3575d6f_d852_9193_8d21_437bde29bfae -->|calls| 0c913e59_9191_0190_ce44_ba814a18cb93 style 0c913e59_9191_0190_ce44_ba814a18cb93 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
benchmarks/dynamo/microbenchmarks/microbench.py lines 26–39
def compute_speedups(args, models, example_inputs):
expected = models[0](*example_inputs)
for model in models[1:]:
actual = model(*example_inputs)
if not same(actual, expected):
raise AssertionError(f"Output mismatch: diff={expected[0] - actual[0]}")
timings = np.zeros((args.repeat, len(models)), np.float64)
for rep in range(args.repeat):
# interleave the runs to handle frequency scaling and load changes
for m, model in enumerate(models):
timings[rep, m] = timed(model, example_inputs)
median = np.median(timings, axis=0)
return (median[0] / median[1:]).tolist()
Domain
Subdomains
Called By
Source
Frequently Asked Questions
What does compute_speedups() do?
compute_speedups() is a function in the pytorch codebase.
What calls compute_speedups()?
compute_speedups() is called by 1 function(s): microbenchmark.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free