benchmark() — pytorch Function Reference
Architecture documentation for the benchmark() function in kernels.py from the pytorch codebase.
Entity Profile
Dependency Diagram
graph TD e5564ea1_2d08_4990_c09b_7d9b97e2b066["benchmark()"] 41eae90d_e6f1_e9de_d6c3_8a479d504904["get_shapes()"] e5564ea1_2d08_4990_c09b_7d9b97e2b066 -->|calls| 41eae90d_e6f1_e9de_d6c3_8a479d504904 38cd02c9_bda5_f921_f4c9_f7772e1a880b["benchmark_single_shape()"] e5564ea1_2d08_4990_c09b_7d9b97e2b066 -->|calls| 38cd02c9_bda5_f921_f4c9_f7772e1a880b style e5564ea1_2d08_4990_c09b_7d9b97e2b066 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
benchmarks/dynamo/genai_layers/kernels.py lines 638–644
def benchmark(self):
for M, N in self.get_shapes():
print(f"Tensor dimensions: [{M}, {N}]")
torch_dtype = cutlass_torch.dtype(cutlass.BFloat16)
x = torch.randn(M, N, device="cuda", dtype=torch_dtype)
w = torch.randn(N, device="cuda", dtype=torch.float32)
self.benchmark_single_shape((x, w), setting=f"shape: [{M}, {N}]")
Domain
Subdomains
Source
Frequently Asked Questions
What does benchmark() do?
benchmark() is a function in the pytorch codebase.
What does benchmark() call?
benchmark() calls 2 function(s): benchmark_single_shape, get_shapes.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free