Long-launch profile capture (design, v0.3)
Status: accepted (2026-11-27), being implemented. It changes how microbench/collect_profile.py captures every timed field of a GPU profile and which captures it accepts. The model does not change; the profiles it reads are captured again under it.
1. Why
Most timed fields of the v0.2 profiles were captured with single launches far under 1 ms, some under 50 us. microbench/launch_audit.py derives each launch's duration from the work one timed launch does (the run_* functions as they were at capture time) and the value the profile stores. Summary (points under 1 ms / points; the factor that brings the shortest launch to 1 ms):
| Field | GB10 (0.22.0-posthoc) | RTX 4070 (0.21.0-posthoc) |
|---|---|---|
dram_bw_by_bytes_in_flight | 38/48, x11.9 | 47/48, x21.7 |
l2_bw_by_bytes_in_flight | 44/48, x23 | 44/48, x20.8 |
dram_bw_by_bytes_in_flight_strided | 40/40, x13.2 | 40/40, x23.3 |
dram_closed_loop | 279/360, x3.5 | 345/360, x6.8 |
l2_closed_loop | 360/360, x16.1 | 360/360, x18.1 |
dram_closed_loop_mma | 118/150, x2.6 | 134/150, x4.9 |
l2_merge_by_sharing | 89/90, x9.1 | 72/72, x15 |
gmem_load_issue_controlled | 33/36, x6.2 | 34/36, x7.2 |
gmem_load_issue_per_sm | 17/24, x4.5 | 18/24, x5.5 |
mma_tflops_per_sm_by_warps | 6/6 per type, x4.9 | 4/6 per type, x2.8 |
mma_chain_latency | 128/128, x9.9 | 128/128, x8.9 |
sync_stage_loop, DRAM stages under 12 KiB | 150/162, x12.5 | 162/162, x19.9 |
sync_stage_loop_ablation | 64/64, x4.9 | 64/64, x9.4 |
spill_reload_latency_by_count | 51/60, x15.7 | 52/60, x15.8 |
serial_stage_fill | 33/64, x1.5 | 41/64, x1.9 |
| SFU and shuffle issue rates | 1 to 4 of 6, x1.1 to x1.4 | 1 to 4 of 6, x1.1 to x1.7 |
dram_bw_by_active_sms, l2_bw_by_active_sms | 0/6, 0/8 | 4/6, 0/8 |
Several modes aim at 0.35 to 0.5 ms by design (closed-loop, mma-chain, spill-latency); sync-loop-reconcile already adapts to about 1 ms. Short launches failed the capture dispersion rules on GB10 (rule 1, interquartile range over 10% of the median, in 7.7% to 15.1% of lists), and on GB10 CPU memory traffic slows DRAM-bound launches without spreading their samples (gb10-dram-cpu-contention-posthoc.md).
Consequence: the microbenchmark errors in design.md section 6.4 were measured against these short-launch fields. They are checked again on the new profiles.
2. Rules
- Every timed window (one launch, or the group or batch section 4 names) takes at least 1.25 ms in the pilot and at least 1.0 ms in the capture.
- A pilot chooses each point's length (steps, iterations, batches or bytes); the lengths are frozen, with their digest, before the capture, and the capture fails if a point's length differs.
- The definition of what a field measures does not change. Its value may change because a longer launch amortizes each launch's fixed cost and start-up transient; every mode reports its long over short shift and explains it by 1/steps scaling or equivalent evidence. A residual of at most 1% after that explanation is recorded as within the clock variation of a device without locked clocks (GB10's SM clock alone spans 2412 to 2566 MHz); a larger residual is investigated before the schedule is used. Where more work per launch would change the definition, the fix is a repeat of the whole measured unit (section 4).
- Each point records its length and its launch durations.
- A capture that fails a gate (section 6) writes no profile. The one exception is a capture whose only failure is rule 3 in a single mode, under the conditions of section 6; that mode still counts as failed.
- Old profiles stay valid; new fields are optional.
3. One schedule for every timed mode
microbench/src/long_read.cuh (LongReadSchedule, written for mlp, strided-mlp, dram-bw and l2) already implements rules 1, 2 and 4: in pilot mode it scales a point's length until the fastest of three samples reaches 1.25 ms (at most eight trials, within address bounds) and prints every trial; with a schedule file it runs each point at its frozen length; either way it prints steps, transfer_bytes, source_buffer_bytes and launch_ns_samples. microbench/long_mlp.py freezes the schedule and checks it at capture.
The design generalizes it rather than writing one protocol per mode:
- Rename
LongReadScheduletoLaunchSchedule(keep the old name as an alias) and drop the read-sweep restriction invgpu_bench.cu; the flag becomes--launch-schedule pilot|FILE(--long-read-schedulestays accepted). - Each
run_*routes its timed loop throughschedule->measure(initial, minimum, maximum, ...)with alaunch(length)callback.lengthis the mode's existing work knob (table below). Without a schedule a mode behaves exactly as now, so old commands reproduce old captures. - Modes whose length is bounded by a buffer (cold DRAM reads must not wrap) size their buffers from free device memory, 1 GiB at least and up to 4 GiB (1 GiB lasts only 0.5 to 0.7 ms at 1.5 to 2 TB/s);
LaunchSchedulerefuses a length that would wrap. Steady-state streams (closed-loop,sync-loop) may wrap as long as the buffer is a power of two of at least max(256 MiB, 8 x L2) and, for every geometry of the mode, the bytes touched between two reads of the same address (its actual reuse distance, which depends on the CTA count and stride, not only on the buffer) exceed the L2, so a re-read still comes from DRAM. Without a schedule these modes keep their v0.2 buffers (256 MiB forclosed-loop), so old commands reproduce old captures. - The two changes of #12 stay:
run_dram_bwsizes its buffer as max(buffer, 16 x L2), andrun_l2keepsread_curve_cp_async. long_mlp.pybecomesmicrobench/long_launch.pywith the same pilot, freeze, capture and audit steps for any mode;collect_profile.pycalls it.- A frozen point's identity is its place in the output plus the mode's explicit design fields (for
closed-loop:issue_mode,tokens,active_ctas,stage_bytes,compute_ns); a mode without registered design fields cannot be frozen. Run-time diagnostics such asobserved_smsare not part of the identity;long_launch.pychecks them separately (observed_smsmust equaltarget_sms). Reproducibility audits match points by identity, never by position, so outputs with different geometries are not compared. - A design field a mode derives at run time from a calibration (the MMA iterations per stage of
closed-loop-mma, from the measured time per MMA iteration) would change from round to round and void the capture. Such fields are frozen like lengths: the pilot uses its own value,long_launch.FROZEN_PARAMETERSwrites it on the schedule line before the point's length, and later rounds read it there (LaunchSchedule::parameter) instead of recalibrating. - Before a capture,
long_launch.py check-schedulecompares the schedule file's SHA-256 with the freeze record, so the binary only runs the frozen file; thestepscheck on the output is the second check. After it,verifyrejects a point whose CUDA event list is incomplete (not the requested sample count) or holds a NaN, an infinity or a value of zero or less. - The full-suite freeze grid includes the optional
cp.asyncactive-SM curve where the mode emits it.
Lengthening keeps each field's definition; values shift where short launches carried a fixed cost or a start-up transient (rule 3). Each mode's commit compares long and short launches before its schedule is used. These mechanism checks do not qualify profile data. The standard comparison runs the scheduled path in one session at the legacy lengths (x1) and at the frozen lengths (long), alternating, two processes each, so that only the length differs; comparing against an earlier legacy capture mixes in process-to-process and point-history differences of up to a few percent. The closed-loop and l2-merge rows predate this and compare one scheduled process with one legacy process. Shift is the median over points of the ratio of per-point medians, long over short, minus one; F is the fixed cost per launch implied by the 1/steps model.
| Mode | Points, shortest launch | Rule 1 / rule 2 lists flagged, short to long | Shift | Explanation |
|---|---|---|---|---|
closed-loop | 720, 1.23 ms | 2.4% to 0.0% / 1.5% to 0.0% | turnaround +0.2% (5th to 95th percentile: DRAM -1.0% to +2.8%, L2 -2.7% to +1.2%) | none needed |
l2-merge | 90, 1.24 ms | 3.3% to 0.0% / 8.9% to 0.0% | l2_to_sm_bw_gbps +2.8% (up to +6.4%); turnaround -2.9% with stagger_stages 0 (-5.2% to -1.4%), +0.1% with 16 | bandwidth: about 3 us of fixed cost per launch (launch and stagger wait), the shift falls to zero for 256-step launches of 0.5 ms or more; turnaround: scales with 1/steps like a start-up transient of about 8 steps, absent when followers start after the leader; a 1 GiB buffer at 256 steps moves neither value (within 0.1%), so the shifts come from the length |
mma | 13, 1.28 ms | 0% / 0% both | 1 to 16 warps +0.1% to +1.7%, largest where the legacy launch took about 0.2 ms; 32 warps, bf16 at 1 warp and fp32_fma -0.6% to -0.2% | 1 to 16 warps: F = 1.9 to 4.0 us, and the model predicts a run at twice the legacy length within 0.3 points; the rest is within 1% and in a run with the SM clock measured before and after every point (--clock-probe) tracks the clock (fp32_fma -0.2% at a 0.75% lower clock, +0.5% per cycle) |
gmem-issue | 24, 1.28 ms | 4.2% / 0% to 0% to 4.2% / 0% | median +0.3%, 95th percentile +4.3% | F about 2.4 us for the 48-SM points; the 1-SM, 8 B, 8-warp point is unstable at any length (interquartile range 9.7% with long launches, repeats 10% apart) and is left to the low in-flight / few-CTA study; points whose frozen length equals the legacy one moved +1.4% to +1.8% in the first control but within 0.4% in a three-repeat run with the clock probe |
gmem-issue-controlled | 36, 1.22 ms | 0% / 0 to 2.8% to 0% / 0% | median +0.7% (-0.5% to +2.3%), up to +2.6% for legacy launches of 160 to 210 us | F = 3.5 us |
sync-loop | 288, 1.23 ms | 5.9% / 5.2% and 5.6% / 4.2% to 3.1% / 0.3% and 1.4% / 0% | median -1.5% (-8.5% to +1.1%). By legacy launch: 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% | F = 3.7 us (2.1 to 12) for L2 points; DRAM points repeat within 8%, so their F is resolved only in the median (4.4 us). The legacy sync_stage_loop turnarounds of short launches carry this fixed cost. The remaining rule 1 lists are DRAM points of 4 to 8 KiB stages at 1 to 2 CTAs per SM, the low in-flight region of the GB10 study, not a sync-loop exception |
closed-loop-mma | 150, 1.24 ms | 4.0% / 2.7% and 2.7% / 3.3% to 2.0% / 0% and 2.7% / 0% | turnaround median +0.1% (-0.9% to +1.3%) | within 1%, the size of the repeat-to-repeat spread |
spill-latency | 60, 1.09 ms | 6.7% / 5.0% and 8.3% / 6.7% to 8.3% / 6.7% and 6.7% / 6.7% | reload_count 0: per-step time falls (4 KiB frames 46 to 16.6 ns, 2 KiB 24.7 to 15.5 ns, smaller frames 16 to 17 to 15 ns); by legacy launch, under 200 us -9.3%, 200 to 1000 us -1.0% to -0.5% | F grows with the frame (about 126 us at 4 KiB, 40 us at 2 KiB, 5 us for small frames): the local frame is initialized once per launch, and the legacy reload_count 0 values carry it. Not from the length: the l1_boundary serial points (1 KiB frames, at the L1 size) are unstable at any length (interquartile range up to 94% short and 122% long), and are most of the rule 1 and 2 lists; l2_spill 4 KiB points with reloads differed 13% to 20% between processes at identical lengths, with the same clock, which rule 3 judges in the capture |
mma-chain | 128, 1.26 ms | 0% / 0% both | stage time median -1.1% (-2.1% to -0.2%), largest for legacy launches under 200 us | F = 2.9 to 3.3 us; the SM clock was 0.3% to 0.4% lower during long launches (up to 1.1%), the droop the legacy 0.35 ms target avoided, which offsets part of the amortization |
sfu-shfl | 31, 1.28 ms | 0% / 0% in all four runs | median -0.1% (-1.0% to +0.0%); shuffle curves at 1 and 2 warps -0.7% and -1.0%; ALU curve -0.1% to +0.0% at 1 to 4 warps, -0.7% at 8 warps; points whose frozen length equals the legacy one (8 and more warps of some curves, and shfl_latency) -1.1% to +1.1% | F = 11 to 17 us for the shuffle curves at 1 and 2 warps, 5 to 6 us for the ALU curve at 1 and 2 warps; the SFU curves' F is within noise (legacy launches of 1.0 to 1.2 ms). Rechecked when the ALU curve (alu_issue_rate_per_sm_gips) was added; its points at 16 and 32 warps kept their legacy lengths and differ by up to 1.1% between processes at the same length (16 warps: 7.85 to 8.01 Gwarp-inst/s per SM), so which of the two is the peak can change from process to process. The SM clock read 2462 to 2562 MHz in all four runs (2483 to 2562 MHz around the curve points) |
cp-async | 2, 1.47 ms | 0% / 0% in all four runs | frozen lengths equal the legacy ones (16384 iterations, 1.47 and 1.64 ms); cp_async -0.3%, smem +0.1% between the alternating runs | lengths recorded only; the differences are run to run (SM clock 2554 to 2564 MHz) |
launch | 3 batches, 1.21 ms (graph batches of 3134 and 3144 launches, stream batch of 697, against 500) | 0% / 0% in all twelve runs | launch_overhead_us (1-CTA graph) -1.1%; per_cta_launch_latency_ns +0.03%; host_launch_overhead_us +1.1% over six alternating pairs | graph: about 2.6 us of fixed cost per graph launch, amortized over 500 launches (x1 0.4146 us in five of six runs, long 0.4102 us in all six); per-CTA: the 4096-CTA graph is timed at the same count as the 1-CTA graph, as before, so the fixed cost cancels; host: the stream submission rate varies from process to process (x1 range 6.0% over six runs, long 2.7%), and the shift is inside that spread |
latency | 5, 1.29 ms launch and in-kernel window | 0% / 0% in all four runs | only smem_latency changed length (50000 to 99924 chase steps, window 0.64 to 1.28 ms): +0.35%; the others kept their legacy chase lengths (windows 2.2 to 18 ms): L2 +0.2%, DRAM -0.1%, DRAM loaded +0.9%, L2 loaded +6.5% | the in-kernel window excludes launch cost, and smem's shift is within 1% at an unchanged clock; L2 loaded and DRAM loaded did not change length, so their differences are between processes, not from the length: l2_latency_loaded read 586 to 614 ns in the pilot, 652 to 668 in the legacy-length runs and 702 to 705 in the frozen-length runs, each run tight, so this point is unstable between processes at any length and rule 3 judges it in the capture |
latency-curve | 16, 1.29 ms launch and in-kernel window | 0% / 0% in all four runs | only the two least loaded L2 levels changed length (8192 to 9232 and 9238 chase steps): +0.0% and -0.2%; the 14 other levels kept their legacy lengths (DRAM windows 1.6 to 26 ms, L2 1.8 to 6 ms) and moved -1.8% to +3.2% (DRAM) and -3.8% to +0.2% (L2, the fully loaded level -3.8%) between the alternating runs, with the background bandwidth within 2% | the lengthened points are within 1%; the rest is between processes at identical lengths, which rule 3 judges in the capture. The unloaded level now prints no achieved_bw_gbps_samples (it was a list of zeros, which the capture rules reject as not a sample); its background bandwidth is 0 by construction |
l1-carveout | 234, 1.31 ms launch and in-kernel window (timed chase steps 1.1 to 37 times the legacy ones) | rule 1: 1 and 0 to 4 and 4 of 234 launch lists (allowed 11); rule 2: 5 and 0 to 0 and 0 | median -0.15% (-3.0% to +0.3%) | the in-kernel window excludes launch cost, and the median is within 1%; the rule 1 lists and the four points whose four medians spread 12% to 16% are at the L1 boundary of their carveout (0 KiB carveout at 128 KiB, 16 KiB at 116 KiB, 32 and 48 KiB at 88 KiB), the same kind of instability as spill-latency's l1_boundary points, unstable at any length. The pilot sizes these probes on the window, not only the launch (a359247), since a probe's untimed warmup steps make the window shorter than the launch |
l2-rescan | 14, 5.5 ms group (flush, pass 1 and pass 2 repeated 4 to 212 times; pass-2 time per group 1.25 ms or more) | 0 / 0 in both legacy-length and both frozen-length runs (launch lists) | outside 0.75 to 1.25 times L2: pass 2 -1.3% to +0.3% at 0.25, 0.5, 2, 3 and 4 times L2, and +8.6% at 1.5 times L2; pass 1 -1.0% to +1.6% everywhere | inside the GB10 bistable band pass 2 differs up to twice between processes at any length (0.75 times L2: 797 and 970 GB/s legacy, 1532 and 1536 frozen; 0.875: 614 to 1334), as the band exception expects; the pilot sizes in-band points to 2.5 ms of pass-2 time so the fast state still clears 1 ms (d4031c3). The 1.5 times L2 point read 243 and 251 GB/s at the legacy length and 263 and 273 at the frozen one, outside the band; rule 3 judges it in the capture |
dram-bw/write_full | 1, 1.977 ms | 0/1 lists flagged under either rule in all four processes | write bandwidth -0.02% | the 384 MiB one-pass write already exceeded the pilot minimum, so both schedules used 384 MiB; read-point lengths were held fixed |
l2/read_curve_cp_async | 8, 1.256 ms | rule 1: 0/8 and 1/8 to 0/8 both; rule 2: 0/8 all | bandwidth median -0.08% (-2.70% to +1.55%) | the 1-SM point had the largest shift; the full-GPU aggregate shifted -1.99% |
l2/write_full | 1, 1.293 ms | 0/1 lists flagged under either rule in all four processes | write bandwidth +1.08% | 64 to 216 passes over the same 6 MiB hot buffer; the old and new sample keys report the same timed launches |
l2/capacity_sweep | 12, 1.190 ms | rule 1: 2/12 and 1/12 to 0/12 both; rule 2: 0/12 all | bandwidth median +1.43% (-4.84% to +20.28%); derived capacity 24 MiB in all four runs | 36 MiB was outside the registered bistable band and its two long medians were 949 and 1319 GB/s; the cause and five-round reproducibility remain open |
sync-loop-multicta | 180, 1.23 ms | 3.3% / 2.2% and 2.8% / 1.1% to 0.0% / 0.0% and 0.6% / 0.0% | median -0.2% (5th to 95th percentile -5.5% to +1.3%; range -7.7% to +3.2%). By legacy launch: under 100 us -5.2%, 100 to 300 us -1.5%, 300 us and more +0.1% | F = 2.3 us in the median; 66 of the 85 points over 1% ran longer and moved down, as the 1/steps model expects (the largest, -6% to -8%, are 2 KiB L2 stages and 128-step DRAM points, where the implied F of 9 to 26 us is larger than a launch and looks like a start-up transient); 7 are within the spread of the two processes of one length; 10 points (8 DRAM points with 2 to 8 KiB stages at 2 to 8 CTAs per SM and 128 legacy steps, 2 L2 points of 4 KiB at 8 CTAs per SM) moved +1.0% to +2.6% with an unchanged clock. A same-session check with three processes of each length (Spark 1, 03:05 to 03:11 UTC) gives +0.3% to +1.7% (median +0.9%) against a spread of 0.5% to 1.3% among the three x1 processes, so about +1% remains; a diagnostic build with a 1 GiB buffer, so that no long launch wraps, gives the same (+0.4% to +2.0%, median +0.8%), which rules out the wrap of the 256 MiB buffer. Not explained; these points are judged by rule 3 in the five-round capture and are not used before |
sync-loop-ablation | 64, 1.26 ms | 0.0% / 3.1% both to 1.6% / 0.0% and 0.0% / 0.0% | median -1.0% (5th to 95th percentile -2.4% to 0.0%). By legacy launch: 100 to 300 us -1.7%, 300 us and more -0.5% | F = 4.0 us; all 33 points over 1% ran longer and moved down |
sync-loop-reconcile | 354, 1.22 ms | 0.6% / 0.3% and 0.0% / 0.0% to 0.0% / 0.0% both | median -0.1% (5th to 95th percentile -0.7% to +0.8%; range -5.0% to +2.4%) | the legacy probe already aimed at 1 ms; of 20 points over 1%, 11 are within the spread of the two processes of one length (the -5.0% and -3.0% points are one slow x1 process), 2 moved down with a longer launch, 1 follows the clock; 6 L2 points (4 KiB at 8 CTAs per SM, 16 to 32 KiB at 2 to 3) moved +1.1% to +2.4% with an unchanged clock and legacy launches of 0.5 to 1.6 ms. In the three-process check, the 4 KiB and 16 KiB points stay within 0.6% (spread between processes); the 24 and 32 KiB points at 2 to 3 CTAs per SM again move +0.9% to +2.3% at an unchanged clock. Not explained; judged by rule 3 in the five-round capture and not used before |
mma-softmax-chain | 86 (14 calibrations, 72 points), 1.24 ms | 0% / 0% both | iteration time median -0.6% (5th to 95th percentile -1.6% to +0.7%; range -2.1% to +3.3%) | F = 1.8 us; the SM clock was 0.56% lower during long launches (up to 1.6%), as for mma-chain; 17 of the 20 points over 1% ran longer and moved down; two 4-warp points with 64 softmax ops at 2 to 3 CTAs per SM moved +3.1% to +3.3% at a 0.8% to 1.0% lower clock, +2.1% to +2.5% per cycle; the three-process check repeats it (+2.3% and +4.1% at a 0.5% and 1.0% lower clock, +1.8% and +3.1% per cycle). Not explained; judged by rule 3 in the five-round capture and not used before. The solo calibrations, whose medians are every point's solo_mma_ns and solo_softmax_ns, moved by the same rule (largest -2.1%) |
serial-fill | 64, 1.25 ms | 3.1% / 0% and 0% / 0% to 0% / 0% both | stage time median -0.1% (5th to 95th percentile -0.3% to +0.3%; range -0.4% to +0.4%) | none needed: the legacy 4096 steps already took 0.5 to 2.1 ms (17 points keep their length); F = 3.9 us |
stage-overhead | 19, 1.25 ms (in-kernel windows at least 1.24 ms) | 0% / 0% both | per-step overhead median 0.0% (5th to 95th percentile -0.2% to +1.6%; up to +3.1%) | timed inside the kernel, so the steps were raised (4096 legacy, 6800 to 30000 frozen) and launch cost does not enter; the 6 points over 1% are all one long process (+2% to +5% over x1), the other long process is within 1% of x1, at the same clock and cycles_per_ns: the spread between processes, not the length |
DRAM and L2 mechanism check. Spark 1 alternated x1 and long twice per mode
with --clock-probe and 15 samples on 2026-11-27 from
02:39:47 to 02:39:58 UTC, including the pilots. The thermal gate passed
after 87.6 s and all ten traced processes passed the host check
(6.03% peak CPU busy share). The shortest sizing trials for the
frozen lengths were 1.267 ms for dram-bw and 1.262 ms for l2.
This was a two-process mechanism check per schedule and did not
qualify any profile data. Raw outputs, traces, legacy-shape checks,
scripts, schedules and build metadata are in
results/v03-long-memory/gb10-35ce9e1/review.tar.gz (SHA-256
c1038f0510a3b62109b3a93952a9110bb442838b062b37ff8103479c80960b5f).
The 35ce9e1 source snapshot was built with CUDA 13.0.88 for
sm_121a (binary SHA-256
bf539743adc74aece74a3c377622a8726663eeddb80146a8df40cd02b91dfeea).
spill-latency and its derived values. The local frame is initialized once per launch, a fixed cost F that grows with the frame and enters every point's per-step time as F / steps. extra_ns_vs_zero subtracts the reload_count 0 point, which runs many more steps (4096 in the legacy capture) than the points with reloads (128 to 2105), so the subtraction does not cancel F: the legacy extra_ns_vs_zero (and ns_per_reload) are overestimated by (F / steps at that count - F / steps at count 0) over the extra. The schedule does not remove it where 128 steps already reach 1.25 ms, so the long-launch values keep most of it at 4 KiB frames. From the spill-latency comparison (Spark 1, x1 and long, two processes each, legacy GB10 profile for the extras), before the launch cost correction below:
| Frame per thread | F (us) | reload_count 0 per step, legacy length / frozen length (ns) | Legacy extra_ns_vs_zero overestimate at 8 / 32 / 68 / 128 reloads, serial; batch | Left with frozen lengths, serial; batch |
|---|---|---|---|---|
| 128 B | 2.3 | 15.6 / 15.1 | +0.3 / +0.5 / +0.6 / +0.6%; +0.0 / +0.1 / +0.2 / +0.3% | +0.2%; +0.2% |
| 256 B | 3.8 to 4.3 | 16.1 / 15.2 | +0.5 / +0.9 / +1.0 / +1.0%; +0.0 / +0.1 / +0.3 / +0.5% | +0.3%; +0.3% |
| 512 B | 4.9 to 5.4 | 16.3 / 15.2 | +0.6 / +1.1 / +1.2 / +1.3%; +0.0 / +0.2 / +0.4 / +0.6% | +0.4%; +0.4% |
| 1 KiB | 8.1 to 8.9 | 17.1 / 15.1 | +2.0 / +2.0 / +1.4 / +0.8%; +0.9 / +2.2 / +2.3 / +2.6% | +0.3 to +0.6%; +0.5 to +0.7% |
| 2 KiB | 39 to 40 | 24.6 / 15.5 | +8.0 / +6.7 / +3.3 / +1.8%; +3.8 / +5.6 / +6.0 / +6.4% | +1.8 to +3.1%; +2.9 to +3.0% |
| 4 KiB | 125 to 127 | 45.7 / 16.6 | +11.4 / +9.5 / +5.5 / +3.1%; +6.8 / +9.8 / +10.3 / +11.2% | +3.2 to +10.9%; +11.0 to +11.4% |
The model checks where the length changed: at 2 KiB batch frames, 128 reloads, it predicts a 3.8% lower extra with the frozen lengths and the capture shows 4.1%. Values derived from these extras (the reload latency lookup in the core, issue #15) inherit the overestimate. Since 0.3.0, spill-latency also times launches with no steps (launch_cost_by_frame, per frame and mode, each sample the mean of a batch of back to back launches: 256 without a schedule, sized by the pilot to 1.25 ms with one), and collect_profile.py takes their median over each point's steps out of its per-step time before it subtracts the reload_count 0 point. Back to back launches measure launch throughput, so part of a single launch's cost can hide behind the next one. On an RTX 3070 (two processes, frozen and legacy lengths, clocks not locked) the scheduled launch_cost matched F fitted from the reload_count 0 point at two lengths within 0.99 to 1.07 times at 1 to 4 KiB frames (one point 1.17). At 512 B and below the fit cannot test it: a 1% clock change between the two lengths moves the fitted F by about 9 us there, and the two processes gave F from -27 to +16 us against a launch_cost of 2.6 to 6.4 us. The capture failed rules 1 to 3 on that card, mostly from processes about 10% apart at small frames, which matches its 1770 and 1950 MHz clock states. iter_time_ns stays the raw per-step time. On an RTX 3070 the reload_count 0 per-step time at 2 and 4 KiB frames differed 37% to 71% between legacy and pilot lengths before the correction and 2% or less after it. Profiles collected before this keep the overestimate until they are recollected.
Points known to make a spill-latency capture fail, not from the length: the l1_boundary serial points with 8 or more reloads (1 KiB frames, 128 KiB per SM at the L1 size), unstable at any length, possibly the same kind of effect as GB10's L2 bistability near its capacity (not verified); and the l2_spill 4 KiB points with reloads, which differed 13% to 20% between processes at identical lengths and clocks. Section 4 now covers both: every reload point is read in 15 local memory allocations, which averages the 4 KiB points' allocation levels, and on GB10 the serial 1 KiB reload points leave rules 1 and 3; on other devices they are still judged by every rule. If spill-latency fails a capture, its fields keep their previous values, marked provisional.
| Mode | Length knob (now) | Now | Plan |
|---|---|---|---|
mlp, strided-mlp | read steps | 0.04 to 2.6 ms | schedule across the original grids |
dram-bw | cold one-pass span (MiB) | 0.6 to 4.0 ms on the legacy grids | schedule read and write spans; writes retain at least the legacy buffer span |
l2 | read iterations and write or capacity passes | 0.2 to 3.6 ms on the legacy grids | schedule both active-SM read paths, the write point and each capacity point |
closed-loop | steps, clamp(5e5 / estimate, 256, 1024) | about 0.5 ms target | schedule over steps |
closed-loop-mma | 256 steps | 0.2 to 1.6 ms | schedule over steps |
l2-merge | 256 steps | 0.07 to 1.6 ms | schedule over steps; turnaround stays per step (clock64) |
gmem-issue, gmem-issue-controlled | iterations, batches | 0.14 to 3.7 ms | schedule over iterations |
mma (and fp32_fma) | iterations, max(4000, 32000 / warps) | 0.2 to 1.4 ms | schedule over iterations |
sfu-shfl | iterations by warp count | 0.6 to 1.8 ms | schedule over iterations |
mma-chain, mma-softmax-chain | steps, about 0.35 ms target | 0.1 to 0.8 ms | schedule over steps |
sync-loop, sync-loop-multicta | 128 or 512 steps | 0.05 to 1.7 ms | schedule over steps |
sync-loop-reconcile | adaptive to about 1 ms, unfrozen | about 1.0 ms | same knob, frozen through the schedule |
sync-loop-ablation | 128 steps | 0.1 to 0.5 ms | schedule over steps (diagnostic, later) |
serial-fill | 4096 steps | 0.5 to 2.1 ms | schedule over steps |
spill-latency | steps, about 0.4 ms target | 0.06 to 4 ms | schedule over steps |
cp-async | fixed | 1.5 to 1.9 ms | already over 1 ms; record lengths only |
4. Fields where a longer kernel is not the fix
- Launch overheads (
launch_overhead_us,per_cta_launch_latency_ns,host_launch_overhead_us). They measure microsecond costs. The timed unit is a batch of 500 launches (a graph or a stream); the schedule raises the batch count instead (about 2500 brings it over 1 ms) and the per-launch value stays the batch time over the count. The per-CTA value stays a difference of two graphs of the same count. - In-kernel timed probes (
latencyfor the smem, L2 and DRAM latencies,l1-carveout,stage-overheadforstage_sync_overhead_ns,fixed_sync_ns,min_async_roundtrip_ns). They time inside the kernel with%globaltimerorclock64, so launch cost never enters the result. Their knob is the chase or loop length; the schedule raises it so the timed window is at least 1 ms, for timer resolution and to average over refresh and clock changes, and the per-step value stays the window over the steps. Each such point also printswindow_ns_samples, its in-kernel window per sample; the pilot sizes the point by the shorter of its launch and its window (an untimed warm-up inside the kernel makes the window shorter), prints each trial's windows, andfreezeholds the window to 1.25 ms andlong_launch.verifyto the 1 ms floor and which is not a profile value (NOT_A_VALUE); the profile'slaunch.min_nsstays the launch time, a few microseconds longer than the window. latency-curve(dram_latency_by_bw,l2_latency_by_bw). Same as above, and longer windows also stabilize the background bandwidth, which is measured over the chase (the RTX 4070 points under about 140 GB/s are under 1 ms now).l2-mergesamples are groups. A sample of everyl2-mergepoint is the median of 9 consecutive flush-and-launch pairs, 15 per list. Every launch is kept inlaunch_ns_each, and each point recordsslow_launch_share. The timed window stays one launch: the pilot sizes single launches to 1.25 ms, andverifyholds all 135 launches to 1.0 ms. GB10's DRAM slow episodes otherwise void rounds on rule 1 at random points (v0.3-l2-merge-groups-registration.md, adopted after a five-round GB10 check). No other mode uses groups this way.l2-rescan.pass2means re-reading a working set right after one cold pass; more passes per launch would measure resident bandwidth instead. One sample becomes a group of K repeats of flush, pass 1, pass 2, each pass still one launch, with the per-pass values the medians over the group; K is chosen by the pilot so that the summed pass-2 time of a group is at least 1 ms.- GB10's L2 bistable band. On GB10, working sets of 0.75 to 1.25 times the L2 size switch between two states from one process to the next, independent of the CPU (v0.3-gb10-l2-bistability-observation.md), and
l2-rescancrosses that band (the capacity sweep has its own exception, next item). Fixed before any capture, for this mode and this band only: its points with working sets of 0.75 to 1.25 timesl2_size_bytesdo not count towards rule 3's decision for the capture (the points outside the band do, at 5% as usual); each in-band point stores the minimum and maximum of its per-process medians, takes the measured spread across processes as itsrel_uncertainty(with the usual floor), and carries"bistable_band": true. No other field may use this exception. It applies only to devices with a documented bistability observation, currently GB10. On any other device (the RTX 4070 included) the capture reports rule 3 separately for the points inside and outside the band, and the band does not get the exception; a capture that fails rule 3 only because of in-band points is judged failed (suspected bistable), and the exception applies on that device only after a documented observation of at least 3 rounds on a quiet host and desktop, followed by a new capture. - GB10's L2 capacity sweep near capacity. On GB10, the capacity sweep's steady repeated scans of 0.75 to 2.0 times the L2 size differ between processes (52% at 1.5 times L2 in the first 0.23.0 capture) and between separate buffers in one process (33% to 58%), while the host is quiet (v0.3-gb10-l2-near-capacity-exception-registration.md). Fixed before any capture, for this field on GB10 only (
l2_near_capacity_unstableinmicrobench/capture_exceptions.py): its points with working sets of 0.75 to 2.0 timesl2_size_bytesdo not count towards rule 3; rules 1 and 2 still judge them. Each covered point stores the minimum and maximum of its round medians. The points are not profile values. The value they feed,l2_effective_capacity_bytes, takes arel_uncertaintythat covers the knee of every round with an 85% crossing, up to the existing 0.5 cap (near_capacity_kneeincollect_profile.py; rounds without a crossing are fallbacks, not observed knees, and are counted incapture_protocol.l2_knee_fallback_rounds), and carries"l2_near_capacity_unstable": truewhen a point of the bracket of the merged sweep's uncapped crossing is covered. The mechanism is unknown. - GB10's low in-flight DRAM points. On GB10, cold DRAM points with little in flight split into two clusters about 1.3 to 1.5 times apart (latency states of about 410 and 590 ns), in slow segments of fixed shape that do not follow the host CPU. In the five host-gated rounds of the full sweep they recurred at or near the same points (14 contiguous geometries had a slow segment at the exact point in at least 3 of 5 rounds); in the forward, forward, reverse replay with wall clock no geometry or wall-clock position was shared, so whether they follow the sweep order or the elapsed time is unresolved (gb10-dram-lowbif-bimodality-posthoc.md, v0.3-gb10-mlp-wall-order-posthoc.md). Fixed before any capture, for GB10 only:
dram_bw_by_bytes_in_flightpoints with at most 256 KiB in flight,dram_bw_by_bytes_in_flight_stridedpoints with at most 384 KiB (a future 512 KiB point is not covered), anddram_bw_by_active_smspoints at 1 and 2 target SMs leave rules 1 and 3: they are removed from those rules' lists or points, and from their counts, before the check. Rule 2 still judges every list. Each such point stores the minimum and maximum of its per-round medians, takes arel_uncertaintythat covers both clusters, and carries"low_in_flight_unstable": true. No other field or device may use this exception. Both GB10 exceptions are registered per device and per field, with their evidence, inmicrobench/capture_exceptions.py, and apply only inmicrobench/long_capture.py, which writes their metadata; the earlier reductions (microbench/repeat_mlp.py) keep the rules without exceptions. These are the points decode-like kernels (few CTAs, little in flight, latency bound) land on; the core lists the two latency states as a known limitation. spill-latencyreads its reload points in 15 allocations and sizes them to 2.0 ms, and GB10's serial 1 KiB reload points are excepted. On GB10 the level of the 4 KiB reload points is fixed for the life of one local memory allocation and changes with a new one, so a process, which keeps one allocation, had one level per round. Under a frozen schedulespill-latencyreads every point with reloads in 15 local memory allocations, each in a new context at the default stack limit; a point's sample j is the mean over allocations of their j-th smallest sample, every allocation's samples are kept inallocation_launch_ns, the 1.0 ms floor applies to each of those launches, and the profile point storesallocation_spanand an uncertainty that covers the allocation levels; the pilot sizes every point with reloads until its fastest launch reaches 2.0 ms, twice the floor, and the freeze rejects one under it; points without reloads and the launch-cost points keep the 1.25 ms target and are read once (registration, diagnostic). Registered with it, for GB10 only: the fourserial_chainpoints at 1 KiB frames with reloads take one of two states per launch within one allocation and leave rules 1 and 3 (rule 2 judges them), keep their values and carry"l1_boundary_two_state": true(exception). The first adoption check had no valid round, because the pilot sized the serial 1 KiB point at 128 reloads in its slow state only, and both were withdrawn (result). The one registered redo, unchanged except for the 2.0 ms pilot target (redo), passed all three rules in five valid rounds and is adopted (result).l2_effective_capacity_bytes(capacity sweep). The sweep's bandwidths are not stored in the profile, so its launch length cannot be audited; the capture records them and the schedule applies to the passes per launch.cta-dispatchis a dispatch trace, not a timed measurement; unchanged.
5. Profile format
MeasuredValuegains an optionallaunchobject:{"length": integer, "min_ns": number, "median_ns": number}, the frozen length and the shortest and median timed window of the point. A sample's timed window is one launch for most modes, a whole group of K flush, pass 1, pass 2 repeats forl2-rescan, and a whole batch for the launch overheads, somin_nsis the shortest such window. The JSON schema allows it, and an optionalbistable_bandflag onl2-rescanand capacity-sweep points; the Rust reader already ignores unknown fields.- Every timed point is captured with
--clock-probe:launchalso carries optionalsm_mhz_beforeandsm_mhz_after, the SM clock measured withcalibrate_clock_kerneljust before the point's first launch and just after its last (about 8 ms per point). Compute fields (mma_tflops_per_sm_by_warps,fp32_fma_tflops, the SFU and shuffle issue rates, thegmem-issuerates) also store an optional per-cycle value, the rate over the mean of the two clocks; memory fields are not converted, since DRAM and L2 do not follow the SM clock. On devices without locked clocks this separates clock differences between sessions (GB10: 2412 to 2566 MHz) from the hardware. The core does not read these values in this version; they are recorded only, and how to use them is designed once the new profiles exist. scripts/check_profiles.pychecks, in a profile that claims the long-launch protocol, that every timed value haslaunch.min_nsof at least 1e6; it skips values whosesourceisestimatedand derived values that are not timed themselves (l2_effective_capacity_bytes, thel2_rescanhit rates,serial_stage_overhead_ns,sfu_tflops, and thel1-carveoutmiss rates and thresholds, includingl1_to_l2_spill_threshold_bytes_per_sm).provenancegains an optionalcapture_protocolobject: the minimum launch, the schedule digest per mode, the number of independent processes per mode, and each gate's result.PROFILE_REVISIONmoves to0.23.0for profiles captured this way. Profiles withoutcapture_protocolkeep reading as before.- Implementation:
collect_profile.py --long-launch RUN_DIRbuilds the profile from a passedlong_capture.pyrun with the usualbuild_profile(whose sample lists are then the round medians, so a value is the median of round medians and its interval comes from them), and refuses unless every timed mode was captured that way.microbench/profile_launch.pythen attaches to each value built from a sample list itslaunch, the range of its round medians (round_median_range) and, for compute rates,per_cycle; flags and widens the entries a device exception covers; and fails on a point without its profile entry or a value that is not the median of its list.non_mma_issue_rate_per_sm_gipsis the larger of the pure FFMA rate (mma'sfp32_fmapoint) and the peak ofsfu-shfl's ALU curve, compared per MHz since the two run in different processes at different clocks; it gets thelaunch, round range andper_cycleof the source that won (attach_non_mma), and stores that source's own samples at its own clock. SM clocks come from the probes.scripts/check_profiles.pyapplies the launch check to profiles withcapture_protocol, skipping the derived values inUNTIMED_LEAVES. With--carry-from PROFILE,collect_profile.py --long-launchalso builds the profile of a capture that failed only rule 3 in one listed mode (section 6), andcheck_profiles.pyskips provisional values in the launch check but requires each of them to matchcapture_protocol.carried_overand the failed rule 3 result. - A mode added to the schedule registers, besides its
DESIGN_FIELDSinlong_launch.py: its name inlong_capture.MODES, its raw-to-profile path inprofile_launch.PROFILE_PATH(and any renamed sample lists inMETRIC, compute rates inCOMPUTE, a point that is one scalar inSCALARS, a timed point with no profile value inNOT_IN_PROFILE, a sample list that is not a profile value inNOT_A_VALUE, and its place inOVERRIDE_ORDERifbuild_profilemerges it with other modes into one field, later overriding earlier), and any derived values incheck_profiles.UNTIMED_LEAVES.
Optional GB10 DRAM references
Enable P3a block references when sizing a new GB10 capture:
flock /tmp/virtualgpu-gpu.lock python microbench/long_capture.py pilot BINARY RUN_DIR --dram-references
flock /tmp/virtualgpu-gpu.lock python microbench/long_capture.py capture BINARY RUN_DIR
flock /tmp/virtualgpu-gpu.lock python microbench/long_capture.py reduce RUN_DIR
flock /tmp/virtualgpu-gpu.lock python microbench/collect_profile.py --binary BINARY --long-launch RUN_DIR --output gb10.json
The opt-in, device UUID and source commit are bound to the frozen
manifest. The capture wraps each scheduled MLP process with the
registered P3a probe under one lock and one host trace. A block
reference is the mean of its before and after probe medians.
The profile keeps the complete probe receipts and attaches
reference_observations only to the 14 registered DRAM MLP plateau
geometries from valid blocks within the drift bound. Incomplete probe
pairs stay in the raw audit. The capture manifest digest identifies
the session, and sweep rounds identify its blocks.
Absolute profile values still come from the five accepted rounds. The probe is a reference for comparisons within the same block, and ratios greater than one are valid. Compute each ratio before reducing blocks by session and treat shared reference IDs as a shared denominator. The Rust predictor does not consume these fields. Older captures follow their original path. Registered scope and evidence
6. Capture gates in collect_profile.py
collect_profile.py runs the suite as 5 independent rounds. Each round passes the thermal gate and, where they apply, the host and desktop gates once, then runs every mode in turn, each as its own process. A field's value is the median over the 5 rounds of each round's median.
Per mode and round, at the end of its process: every launch at least 1.0 ms (checked at once by long_launch.py, not only by check_profiles.py), rules 1 and 2, and the host check.
-
An interruption of the protocol before the mode's first timed launch (a gate that does not pass, a process that cannot start) does not count: the round restarts, and the restart does not count towards the limit below.
-
A failure after timing has begun (a statistical or host check of that mode's process) makes that mode's round void. The void round is kept, its medians go into the audit with the void mark, and the capture adds a round; at most 2 extra rounds per capture across all modes, after which the capture fails.
-
A launch found under 1.0 ms after the capture is a statistical failure after timing, not an interruption before it.
-
Rounds are numbered consecutively, void ones included, and
capture_protocolrecords every round, its result and the extra rounds used, with each mode's void rounds and their reasons. Every accepted round counts; no round is chosen or dropped by its values. After all rounds, rule 3 per mode across its 5 accepted rounds (with the L2 band exception of section 4). The gates: -
the three dispersion rules (
microbench/capture_posthoc.py): at most 5% of sample lists with an interquartile range above 10% of the median, at most 15% with largest over smallest above 1.5, at most 5% of points whose per-process medians spread more than 10%. Each rule tolerates max(floor(limit x N), 1) failing lists or points, N being the mode's lists (rules 1 and 2) or points (rule 3) after exempted points are removed, so a single failing list or point never voids a small mode; for N of at least 20 (rules 1 and 3) or 7 (rule 2) this equals the share limit; -
on GPUs that share memory with the CPU (
integratedin the device query, GB10):microbench/host_quiet.py, 10 quiet seconds before each round and no second during a mode's process with more than 10% of all CPUs busy or any foreign process above 5% of one CPU for two seconds. On other GPUs each process's host telemetry (its busiest second and any such foreign processes) is still recorded with the round, as a description, and does not judge it; -
under WSL: the quiet Windows desktop gate (GPU utilization under 5% for 60 s, no game or streaming process) before each round.
A capture whose only failure is rule 3 in one mode. Rule 3 is the one gate judged across rounds, after every mode has its 5 accepted rounds, so a mode that fails it has passed every per-round gate in each of those rounds. The capture still counts as failed for that mode: its rule 3 result stays failed with its count of failing points, and nothing it measured enters the profile. A 0.23.0 profile may be built from the other modes on these conditions only:
- The capture finished its rounds (every mode has 5 accepted rounds) and rule 3 failed in exactly one mode. A capture where rule 3 fails in two or more modes, or that ended without 5 accepted rounds for every mode (rules 1 and 2, the launch minimum, the host check or the extra-round limit), writes no profile.
- Every profile field built from the failed mode's raw is that mode's alone.
collect_profile.CARRY_FIELDSlists the modes for whichbuild_profilehas been checked for this, with their fields; a failed mode not listed writes no profile. - Those fields are copied unchanged from a named earlier profile of the same device. Every value in them is marked
provisional, with the reasonrule_three_failed, the failed mode, and that profile'sprofile_revisionand SHA-256.capture_protocol.carried_overlists the mode, its fields and the source profile, andcapture_protocol.rule_threekeeps the failed result as judged.
No rule or threshold changes, and no earlier registration is reread under this paragraph. A consumer that needs a field measured under this protocol treats provisional values as not measured: scripts/spill_decision.py returns not run for them, and scripts/recheck_mechanisms.py marks a mechanism whose points are provisional as carried over and not rechecked.
microbench/long_capture.py implements this: pilot freezes every scheduled mode and writes a manifest binding the schedules, the freeze records, the binary and the protocol; capture runs the rounds (rerunning it resumes an interrupted round, gates first) and judges rule 3; reduce writes, per mode, a raw of the usual shape whose sample lists are the 5 round medians, with each timed point's launch (frozen length, shortest launch over the valid rounds, median of round medians, each round's SM clock). Until every timed mode runs under a schedule it produces these merged raws for diagnosis only. Still missing before the first 0.23.0 profile, besides the modes of section 7.2: dram-bw under a schedule emits only read_curve (no write_full), and l2 stops after read_curve (no read_curve_cp_async, write bandwidth or capacity sweep). A profile at revision 0.23.0 comes only from frozen schedules; without one, collect_profile.py produces the old revision as now. A failed gate prints the report and exits with an error; the raw captures are kept. On machines with several GPUs, the compute-process and telemetry checks look at the target device only (by UUID). Where nvidia-smi or the /proc reads are not permitted, the capture stops with the permission it needs instead of skipping a gate. On a plain Linux machine with a discrete GPU only the dispersion rules and the thermal gate apply. Community profiles pass the same gates, so docs/guides/contributing-a-profile.md gains a section on them.
7. Order and cost
- Fields the model reads directly: MLP and active-SM (done),
closed-loop,l2-merge,mma,gmem-issueandgmem-issue-controlled,sync-loop,closed-loop-mma,spill-latency,mma-chain. - Then diagnostics:
sync-loop-ablation, the spill diagnostics,l1-carveout,stage-overhead, the launch overheads,l2-rescan, the capacity sweep. - GB10 first, under the host gate; the RTX 4070 in a quiet desktop window.
About 2100 timed points per GPU at 15 samples, 3 warmups and about 1.5 ms per launch is about 1 minute of kernel time per round, plus about 15 s of DRAM flushes and the group and batch overheads; with 5 rounds, each with one thermal and quiet gate, and the pilot, about 30 to 45 minutes per GPU. Gating every mode's process separately would add about two hours of waiting, which the round structure avoids.
Implementation goes in small commits, one per mode, each with a test, in the order of section 7.1.
8. Not in this design
- Re-checking the section 6.4 errors on the new profiles (core owner, after the profiles exist).
- Changing any measured definition; a field that cannot be captured at 1 ms or more without changing it is listed in section 4 instead.