PyTorch nested_graph_breaks gives 4.53× steady-state speedup on B200

cfregly · x · 2026-10-22

On an NVIDIA B200 with PyTorch 2.14.1 (CUDA 13.0), setting nestedgraphbreaks=True cut steady median latency for the same 64 ops (1,048,576 FP32 elements) from 407.57µs to 89.94µs — a 4.53× speedup (4.50×–4.58× across paired seeds).

The mechanism: Inductor regions merge from 16×4 ops into 2×32 ops, cutting CUDA Graph replay launches from 16 to 2 per call, with less fragmentation and larger fused regions. The tradeoff is cold start: the first ten calls took 33.2% longer overall (2.411s→3.212s), almost all in call 1. Author's advice: try nestedgraphbreaks=True now, inspect emitted compiler code and replay activity, and measure cold first use separately from steady state.

Related event: Nested CUDA Graphs in PyTorch 2.14 deliver 4.5x steady-state speedup on B200 at 33% cold-start cost(6 posts)→

Original post →

More from Infra

Infra channel →