Home / Function/ profile() — pytorch Function Reference

profile() — pytorch Function Reference

Architecture documentation for the profile() function in dynamo_microbenchmarks.py from the pytorch codebase.

Entity Profile

Dependency Diagram

graph TD
  06b41ef8_507b_a19a_2e0e_65bfc560e05c["profile()"]
  a7d76bdc_05e5_b9c5_14f1_a81dd76cdc0c["main()"]
  a7d76bdc_05e5_b9c5_14f1_a81dd76cdc0c -->|calls| 06b41ef8_507b_a19a_2e0e_65bfc560e05c
  4dca3303_ae75_734d_70fa_a8f2ea37d9cf["symbolic_convert_overhead_stress_test()"]
  06b41ef8_507b_a19a_2e0e_65bfc560e05c -->|calls| 4dca3303_ae75_734d_70fa_a8f2ea37d9cf
  style 06b41ef8_507b_a19a_2e0e_65bfc560e05c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmarks/dynamo/microbenchmarks/dynamo_microbenchmarks.py lines 27–38

def profile():
    x = torch.randn(16)
    y = torch.randn(16)
    torch._dynamo.reset()
    pr = cProfile.Profile()
    pr.enable()
    # 100k > 33k roughly cancels out the overhead of cProfile
    symbolic_convert_overhead_stress_test(x, y, 33000)
    pr.disable()
    ps = pstats.Stats(pr)
    ps.dump_stats("dynamo_microbenchmarks.prof")
    print("snakeviz dynamo_microbenchmarks.prof")

Subdomains

Called By

Frequently Asked Questions

What does profile() do?
profile() is a function in the pytorch codebase.
What does profile() call?
profile() calls 1 function(s): symbolic_convert_overhead_stress_test.
What calls profile()?
profile() 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