Home / Function/ microbenchmark() — pytorch Function Reference

microbenchmark() — pytorch Function Reference

Architecture documentation for the microbenchmark() function in microbench.py from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  f3575d6f_d852_9193_8d21_437bde29bfae["microbenchmark()"]
  ca319443_070a_d0f3_5e9b_0e9cc42f8f30["main()"]
  ca319443_070a_d0f3_5e9b_0e9cc42f8f30 -->|calls| f3575d6f_d852_9193_8d21_437bde29bfae
  0c913e59_9191_0190_ce44_ba814a18cb93["compute_speedups()"]
  f3575d6f_d852_9193_8d21_437bde29bfae -->|calls| 0c913e59_9191_0190_ce44_ba814a18cb93
  style f3575d6f_d852_9193_8d21_437bde29bfae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmarks/dynamo/microbenchmarks/microbench.py lines 42–52

def microbenchmark(args, model, example_inputs):
    compiled_fn = compile_fx(torch.fx.symbolic_trace(model), example_inputs)
    cudagraphs_eager = cudagraphs_inner(model, example_inputs, copy_outputs=False)
    cudagraphs_jit = cudagraphs_inner(
        torch.jit.trace(model, example_inputs), example_inputs, copy_outputs=False
    )
    return compute_speedups(
        args,
        [cudagraphs_eager, cudagraphs_jit, compiled_fn],
        example_inputs,
    )

Subdomains

Called By

Frequently Asked Questions

What does microbenchmark() do?
microbenchmark() is a function in the pytorch codebase.
What does microbenchmark() call?
microbenchmark() calls 1 function(s): compute_speedups.
What calls microbenchmark()?
microbenchmark() is called by 1 function(s): main.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free