Skip to main content

Mechanism re-check on a profile's own microbenchmarks: baseline on the current profiles

scripts/recheck_mechanisms.py re-runs every mechanism of design.md 6.4 that has a microbenchmark basis in the GPU profile, so that a new profile (the 0.23.0 long-launch GB10 profile first) can be compared with the old one mechanism by mechanism. It only reads the core: no mechanism, parameter or profile changes. This baseline was regenerated from the per-SM spill core at 01190e9 on profiles/gb10.json (0.22.0-posthoc) and profiles/rtx4070.json (0.21.0-posthoc). It was regenerated again at fd1a342, where the profile schema gained the optional spill point fields allocation_span and l1_boundary_two_state; that changes the compiled-source SHA, and no number in the baseline changed. It was refreshed again at dec52c3, where the core added the cube_vector_split single-MTE2 path for Ascend 910B3 and lifted its unvalidated gate; that changes the compiled-source SHA, and no number in the baseline changed. It was refreshed again at 625c685, where the profile schema gained the optional provisional mark on measured values and capture_protocol.carried_over; that changes the compiled-source SHA, and no number in the baseline changed. Every microbenchmark in these two profiles is a short launch (most points under 1 ms, see long-launch-capture.md), so their columns serve only for comparison with a long-launch profile, not as evidence for any mechanism. It was refreshed again at e16e98c, where the round-trip port floor streams only the fetched bytes behind the DRAM latency (registration, form F3); only miss_merging changed, on both profiles. It was refreshed again at 27a4b3e, where the core gained the per-barrier sync charge (read only from the optional pipeline.barrier_step_ns) and the off-by-default R1 switch; that changes the compiled-source SHA, and no number in the baseline changed.

python scripts/recheck_mechanisms.py --profile gb10=profiles/gb10.json \
--profile rtx4070=profiles/rtx4070.json \
--out docs/results/analysis/v0.3-mechanism-recheck-baseline.json

Method​

  • Each point of a mechanism's basis in the profile is written as the synthetic KernelIR of the kernel that ran (microbench/src/m2_kernels.cuh): grid, warps, the stage's global load (bytes, width, cp.async or synchronous, prefetch distance from the tokens), shared memory reads (ldmatrix) and writes (register staging), MMAs per CTA, ALU, SFU and shuffle counts, and for spills the frame and reload bytes.
  • DRAM points stream: every CTA reads new bytes each step (a grid-wide stride), predicted with a cold L2; L2 points re-read the same stage, predicted warm. A check confirms that the first sends all load bytes to DRAM and the second hits L2 with all of them (python/tests/test_recheck_mechanisms.py).
  • The model's per-step time is the difference of two launches, 256 and 512 steps, over 256, so launch and CTA dispatch costs drop out, as they do from the measured per-step values.
  • Per mechanism and profile: points, median absolute error, MAPE, signed median error (predicted over measured minus one) and the worst point. All rows are in the JSON.

--check requires a clean extension built at the checkout's HEAD. It also checks the baseline SHA-256 over the committed build paths (crates, schemas, Cargo.toml, Cargo.lock). Documentation commits leave that source SHA valid. The JSON also records the exact build commit used to generate the numbers.

Baseline​

Mechanismgb10rtx4070Expected shift of the measured side
closed_loop_dram252 pts: median 2.8%, MAPE 4.9%, signed -1.2%, worst -33.2% (cp_async t1 n16 4096B c0)252 pts: median 2.2%, MAPE 3.1%, signed +0.8%, worst -30.9% (cp_async t4 n32 16384B c250)turnaround +0.2% (DRAM -1.0% to +2.8%)
closed_loop_l2252 pts: median 5.2%, MAPE 8.4%, signed +1.1%, worst +53.7% (cp_async t1 n16 16384B c0)252 pts: median 4.9%, MAPE 8.5%, signed -1.1%, worst +53.6% (cp_async t2 n16 8192B c0)turnaround +0.2% (L2 -2.7% to +1.2%)
closed_loop_mma150 pts: median 2.6%, MAPE 4.1%, signed -2.4%, worst -22.1% (cps1 t1 w8 ld16384 m5)150 pts: median 1.3%, MAPE 2.9%, signed -0.3%, worst -16.4% (cps1 t3 w4 ld0 m19)turnaround +0.1% (-0.9% to +1.3%)
miss_merging51 pts: median 4.6%, MAPE 9.7%, signed +3.3%, worst -41.7% (n48 r8 4096B)42 pts: median 4.8%, MAPE 5.6%, signed +3.4%, worst +14.7% (n46 r2 4096B)turnaround -2.9% with stagger 0 (-5.2% to -1.4%); bandwidth +2.8%
port_floor_serial_fill64 pts: median 8.7%, MAPE 9.3%, signed +0.3%, worst +20.6% (ld_st fill_only w8 8192B n1)64 pts: median 11.4%, MAPE 11.8%, signed +4.1%, worst -27.1% (cp_async fill_only w8 2048B n1)stage time -0.1% (-0.3% to +0.3%)
port_floor_sync_loop564 pts: median 5.9%, MAPE 7.1%, signed -5.5%, worst +39.7% (l2 ld_st_sync cps6 w4 2048B mma8)564 pts: median 1.9%, MAPE 4.4%, signed +0.0%, worst -28.5% (dram ld_st_sync cps1 w4 8192B mma64)sync-loop: L2 under 100 us -5.4%, 100 to 300 us -2.4%, 300 us and more -0.8%; DRAM 100 to 300 us -1.7%, 300 us and more +0.2% to +0.5%; multicta -0.2% (under 100 us -5.2%, 100 to 300 us -1.5%); reconcile -0.1% (up to -5.0% and +2.4%)
dependent_chainnot in profile72 pts: median 12.9%, MAPE 13.8%, signed -12.9%, worst -37.6% (cps1 w4 m4 k16)iteration time -0.6% (-2.1% to +3.3%) at a 0.56% lower SM clock
lsu_pipe35 pts: median 7.6%, MAPE 11.4%, signed -3.0%, worst +42.8% (2B b32 w4)35 pts: median 13.4%, MAPE 14.6%, signed -13.2%, worst +37.5% (2B b32 w4)issue rate +0.7% (-0.5% to +2.3%), up to +2.6% for legacy launches of 160 to 210 us
spill_l1_boundary4 pts: median 67.6%, MAPE 54.9%, signed +67.6%, worst +79.6% (1024B x128)4 pts: median 38.0%, MAPE 35.0%, signed +38.0%, worst +41.2% (1024B x128)spill-latency: per-step times fall with the frame's fixed cost; the 1 KiB l1_boundary points are unstable at any length

Against the numbers in design.md 6.4​

These were computed when each mechanism was added, on the profiles of the time, with scripts that were not kept; this tool reproduces them where it builds the same kernel.

  • sync_stage_loop (port floor): MAPE 7.1% GB10 and 4.4% RTX 4070, the values in design.md.
  • serial_stage_fill: 9.3% and 11.8% against 8.6% and 9.2%.
  • Closed loop: median 2.8% / 2.2% (DRAM) and 5.2% / 4.9% (L2) on 252 of the 360 points per level, against 2.6% and 6.8% on all 720; the spin compute points at more than one CTA per SM cannot be written (below). dram_closed_loop_mma: median 2.6% / 1.3% against 1.0% to 1.9%.
  • lsu: held-out MAPE 11.4% GB10 and 14.6% RTX 4070 (35 points each, the calibration point left out) against 13.1% and 18.0%.
  • Miss merging, stagger 0: median 4.6% GB10 (51 points) and 4.8% RTX 4070 (42 points) since e16e98c (signed +3.3%, +3.4%). Before it: 7.8% and 11.3%, over-predicted (+7.6%, +11.3%), against 5.0% (RTX 4070, 42 points). The 5.0% is from c976960, which added the merged split, and the same IR reproduces it on that core (median 4.8%, signed +3.4%, on the current RTX 4070 profile; the profile at e46b16e gives the same). Core by core between c976960 and e46b16e, where design.md first quoted it, the error stays at 4.8% through 9c12720 and becomes 12.2% at e51f8ef, the round-trip port floor (GB10: 4.6% to 8.8%). The floor adds the stage's bytes over the one-SM L2 ceiling to the round trip, and these points are latency-bound reads at fewer CTAs than SMs: on the RTX 4070 the signed median is +18.0% at 16 CTAs, +13.8% at 23, +9.8% at 46 and +3.4% at 92. design.md 6.4 still quotes the pre-floor number; the port floor was judged on serial_stage_fill and sync_stage_loop, not on this basis. e16e98c charges a merged byte no streaming behind the DRAM latency, which returns both profiles to their pre-floor errors.
  • Dependent chain (RTX 4070 only; GB10 has no mma_softmax_chain): signed median -14.9%, -17.7% and -4.3% at 1, 2 and 3 CTAs per SM against -0.7%, -7.9% and +3.8%. design.md used the measured solo times; KernelIR carries instruction counts, here from the CUDA source, so this row also tests those counts.
  • Spills, the four l1_boundary batch points: cd5f35f charges the first-wave peak instead of the hardware occupancy limit. The one-CTA-per-SM benchmark thus pays for one frame group. The signed median error falls from +209.6% to +67.6% on GB10 and from +70.7% to +38.0% on RTX 4070. The other 2,799 predicted points are bit-identical because their IR has no spill charge. Scaling the local bandwidth estimates leaves these predictions unchanged. The modeled 8 KiB carveout selects the 16 KiB miss curve, which assigns nearly all reloads to L2 at a 128 KiB footprint. The per-SM phase-entry charge reproduces all 2,807 rows bit for bit because the spill fixture has one resident CTA per SM. See the first-wave recheck and per-SM follow-up.

Not expressed​

The same for every profile, so a change between columns comes from the profile:

  • closed_loop: compute_ns is a clock64 spin, written as issue work at the CTA's alone rate; with more than one CTA per SM the model would share that issue work and the spin does not, so those points (compute_ns over 0 and more CTAs than SMs) are left out.
  • Miss merging: stagger_stages 16 delays the followers once at the start; KernelIR has no per-CTA start offset, so only stagger 0 is checked, the basis in design.md.
  • Dependent chain: per warp per step 2 x mma_per_half MMAs, softmax_ops / 2 ex2, 4 shuffles and softmax_ops + 15 other instructions, from the CUDA source, not SASS.
  • sfu and shfl: their rates are the profile's own curves, checked by leave-one-out interpolation, not by a core run; not re-run.
  • Cross-wave reuse: its microbenchmarks are not in the profile.
  • Loop and address instructions are not counted in any kernel.

Reading a new profile's column​

A long-launch profile moves the measured side of each mechanism by the shifts in long-launch-capture.md, section 3 (the last column above). With the model inputs unchanged, a measured shift of s moves the signed error by about -s; the new profile also changes the curves the model reads (bandwidth, latency, MMA rates), so a column-to-column change beyond the listed shift is a change in what the model is given, to be traced to the fields that moved, before it is read as evidence about a mechanism.