Miss merging under the round-trip port floor: registered candidate fixes
Registered on main ac7c3b4 (core identical to 70de487), before any candidate is implemented or evaluated, for review by 6 and release by the lead. Nothing below changes after a candidate is run. This document changes no core, profile or rule.
ROADMAP item: "Re-run miss merging under the round-trip port floor". The re-check on the GB10 0.23.0 profile (v0.3-gb10-0230-mechanism-recheck.md, section 2) confirmed the coupling. The criteria below read microbenchmarks only, not the development set.
Facts the candidates rest on
The core today (port_floor in crates/vgpu-core/src/sim.rs), with own the bytes of one round trip over the port (load_bytes / round_trips / l2_bw(1.0)) and shared = own * resident:
- L2 latency:
max(lat.l2, l2_idle + own, shared) - DRAM latency:
max(lat.dram, dram_idle + own, shared)
latency_parts charges the DRAM latency to every byte not resident in L2, merged or fetched. Only fetched bytes enter DRAM in flight (dram_fraction), so a kernel whose misses mostly merge has a low DRAM in flight and a low lat.dram, and the floor binds.
Per-point signed error of l2_merge_by_sharing (stagger 0, profile gb10-0.23.0), core 9c12720 (before the floor) and main 70de487. Here r is the number of CTAs that read the same lines:
| CTAs | r | 4 KiB | 8 KiB | 16 KiB |
|---|---|---|---|---|
| 16 | 1 | +3.8 / +3.8 | +0.9 / +0.9 | +3.7 / +3.7 |
| 16 | 4 | +4.5 / +8.1 | +1.1 / +15.2 | -4.6 / +25.1 |
| 16 | 16 | +5.9 / +9.6 | +2.7 / +18.6 | -3.3 / +35.0 |
| 23 | 23 | +6.2 / +9.9 | +3.1 / +19.1 | -3.3 / +34.9 |
| 48 | 8 | +5.7 / +8.3 | +1.1 / +12.2 | -4.6 / +10.4 |
| 48 | 16 | +5.9 / +9.6 | +1.9 / +16.5 | -6.6 / +25.2 |
| 96 | 16 | +4.4 / +7.0 | -3.1 / +7.5 | -2.6 / -2.6 |
Values are percent, before / after the floor. All 12 points with r = 1 are unchanged by the floor, and so are the 48 and 96 CTA points with r <= 4 and 96 CTAs with r = 8.
- What the floor adds grows with sharing and with bytes per CTA. The gap is largest at one CTA per SM (16 to 48 CTAs on GB10's 48 SMs). The summary "fewer CTAs than SMs" in the ROADMAP is a consequence: the 48 CTA, r = 16 points move nearly as much as the 16 CTA ones (up to 31.8 points against 38.3).
- Reading. A merged round trip is charged the full DRAM idle latency and then the streaming of all its bytes through the port, in series. That the data fit better without the series sum is a measured fact. That the two overlap is the hypothesis the candidates test.
Candidates
Each is a change to the DRAM line of port_floor only. None has a parameter, and none reads a new profile field. The L2 line and shared are unchanged in every candidate.
| Name | DRAM latency | What it says |
|---|---|---|
| F0 (control) | max(lat.dram, dram_idle + own, shared) | main today |
| F1 | max(lat.dram, shared) | the per-round-trip streaming floor holds for L2 only; a DRAM round trip is bounded by the MLP curve and the SM's port share |
| F2 | max(lat.dram, dram_idle, l2_idle + own, shared) | streaming from L2 to the SM overlaps the DRAM latency of the first line; a DRAM round trip lasts at least the longer of the two |
| F3 | max(lat.dram, dram_idle + own * g, shared), g = dram_fraction / (1 - resident_fraction) | only fetched bytes stream behind the DRAM latency; merged bytes ride on fills already under way (g = 1 when nothing merges, or when no byte waits DRAM latency) |
F3 is identical to F0 when no miss merges, so it leaves every r = 1 point exactly as it is.
Evaluation
- Core: main
70de487plus each candidate, one at a time, built clean. Profileprofiles/gb10-0.23.0.jsonunchanged. - Tool:
scripts/recheck_mechanisms.pyunchanged, all its mechanisms, draw 0, with the tool's existing noise column (median span of the five round medians). - Baseline: F0 as in the re-check (main
ac7c3b4).
Criteria, fixed here
A candidate passes when all of these hold against F0:
- Merging improves.
miss_mergingMdAPE falls by more than its noise (0.63 points, from 4.9%), and its MAPE falls (from 8.8%). - Unshared points do not move. On the 12
r = 1points, no signed error changes by more than 0.5 points. - The floor's basis holds.
port_floor_serial_fillandport_floor_sync_loopeach: MdAPE worsens by at most 0.5 points and MAPE by at most 1.0 point. - Nothing else worsens.
closed_loop_dram,closed_loop_l2,closed_loop_mma,lsu_pipeanddependent_chaineach: MdAPE worsens by at most 0.5 points. Carried-over rows (spill_l1_boundary) are not judged.
Choice. Among passing candidates, the lowest miss_merging MdAPE wins. Candidates within 0.63 points of the lowest count as tied, and a tie goes to the first in the order F3, F2, F1 (smallest change to what the core charges first).
No candidate passes. The core keeps F0, and the coupling is written into design.md 9.3 as a known limit with the table above. This is the draft recommendation of the preregistration.
Reported, not judged
- Per-point signed errors of
miss_mergingfor every candidate. - Every mechanism's MdAPE, MAPE and signed median for every candidate.
- After the choice, and only then: the development set under the chosen candidate, as a report. It cannot change the choice.
Second device
The RTX 4070 has no qualified profile, so the choice is made on GB10 alone. When a qualified RTX 4070 profile exists, the chosen form is re-run there with criteria 1 to 4 unchanged. A failure there reopens this item and does not revert the core by itself; that call is the lead's.
Limits
- Stagger 0 only: KernelIR has no per-CTA start offset, so the 16-stage stagger points are not checked.
- One profile on one device.
- The candidates change the DRAM latency of every kernel whose DRAM floor binds, not only merging ones. Criteria 3 and 4 cover the microbenchmarks that exercise it; kernels outside them are not covered.
Result: F3 is chosen
Evaluated after this registration was merged (#35). Each candidate was committed on a local evaluation branch from a077475, whose compiled sources equal 70de487: F1 4399b56, F2 16e4b93, F3 1fc8099. Each was built clean (result_class formal). scripts/recheck_mechanisms.py, unchanged, ran on profiles/gb10-0.23.0.json at draw 0. F0 is the re-check on main ac7c3b4. The criteria were applied by a script that encodes the four rules and the choice above (criteria.json).
| F0 | F1 | F2 | F3 | |
|---|---|---|---|---|
miss_merging MdAPE / MAPE | 4.85% / 8.77% | 3.85% / 3.64% | 3.85% / 3.64% | 3.85% / 3.64% |
| 1. Merging improves by more than 0.63 points, MAPE falls | pass | pass | pass | |
2. Largest change of an r = 1 point | 0.0 | 0.0 | 0.0 | |
3. serial_fill, sync_loop MdAPE / MAPE change | 0.00 / 0.00 | 0.00 / 0.00 | 0.00 / 0.00 | |
| 4. Largest MdAPE change of the others | +0.11 (closed_loop_dram) | +0.11 (closed_loop_dram) | 0.00 | |
| Passes | yes | yes | yes |
- All three pass, and they tie on merging. All three give identical
miss_mergingerrors on every point, so the tie rule applies and F3 is chosen. - F3 is the only candidate that changes no other mechanism. F1 and F2 change 67
closed_loop_dramand 17closed_loop_mmapredictions, and moveclosed_loop_dramfrom 0.71% to 0.82% MdAPE (MAPE 1.74% to 1.95%), within criterion 4. F3 changes 23 of the 51miss_mergingpredictions and leaves every other prediction of the re-check bit for bit at its F0 value. - The merging points under F3 equal the pre-floor core
9c12720. The signed median by CTA count is +2.4, +3.0, +4.0 and +4.0% at 16, 23, 48 and 96 CTAs. The worst point before, +35.0% at 16 CTAs, r = 16, 16 KiB, is now -3.3%. The new worst point is -6.6% at 48 CTAs, r = 16, 16 KiB. - The RTX 4070 column is still pending a qualified profile. On the short-launch profiles of the re-check baseline (comparison only, not a criterion), F3 gives
miss_merging7.8% to 4.6% on GB100.22.0-posthocand 11.3% to 4.8% on RTX 40700.21.0-posthoc. Both equal the pre-floor values of the baseline.
The core change is e16e98c on this branch. The development set is reported only after the choice, as registered, in the prediction diff of the pull request.
Prediction diff (CONTRIBUTING, mechanism changes)
- Cores. Base:
70de487, whose compiled sources equal main2985f87. Candidate:e16e98c. Both are clean formal builds. - Settings.
virtualgpu.cli predict, 32 draws, seed 17, both cache states, one thread per process. - Kernel IR. The archived v0.2 formal IR (GEMM and attention, both GPUs) and the phase 2 GB10 AOT IR (both cohorts, the
failures.jsonentries left out). - Profiles.
gb10.json0.22.0-posthoc(SHA-25610625fa4...),gb10-0.23.0.json(f5fa8ecc...) andrtx4070.json0.21.0-posthoc(3bb13b73...). - Data. prediction-diff.json.
"Changed" means the nominal time or any draw differs.
| IR set, profile | Configs per cache | Changed cold / warm | Nominal change cold, range | Nominal change warm, range | Largest |
|---|---|---|---|---|---|
GB10 attention, 0.22.0 | 228 | 188 / 188 | -18.0% to +1.5% | -18.0% to 0.0% | b1-q28-kv28-s4608-d128-causal m64n64-w4-s2 |
GB10 attention, 0.23.0 | 228 | 188 / 188 | -18.8% to +4.2% | -18.8% to +4.2% | same |
GB10 GEMM, 0.22.0 | 324 | 176 / 175 | -0.7% to +0.1% | -0.7% to 0.0% | v02-gb10-mask-mnk-641 |
GB10 GEMM, 0.23.0 | 324 | 165 / 165 | -2.9% to 0.0% | -3.0% to 0.0% | v02-gb10-mask-mnk-641 |
GB10 phase 2 primary, 0.23.0 | 255 | 74 / 171 | -2.2% to 0.0% | -3.8% to 0.0% | mask-m, sm-round-above |
GB10 phase 2 secondary, 0.23.0 | 324 | 224 / 238 | -3.7% to 0.0% | -6.4% to 0.0% | prefill-256, l2-working-set-below |
| RTX 4070 attention | 228 | 188 / 188 | -9.9% to +2.4% | -9.9% to +0.4% | b3-q16-kv16-s2560-d128-full m64n64-w4-s2 |
| RTX 4070 GEMM | 324 | 206 / 225 | -9.9% to 0.0% | -9.8% to 0.0% | v02-rtx4070-prefill-1536 m128n128k64-w8-s2-g1 |
Of 4470 predictions, 1523 are bit-identical. No status changes.
- Direction. Almost every change is faster, as expected: merged bytes no longer stream behind the DRAM latency.
- Attention moves most. Its K and V tiles are read by every query block of a head, so most of their misses merge.
- The few slower predictions are not traced. They are at most +4.2%, in attention. They come through the scheduler's interaction with the shorter round trips.
Development set, reported after the choice (not judged)
RTX 4070, profile 0.21.0-posthoc, same cores and settings as above, scored with validation.score --diagnostic --unchecked against all published development sessions (development-scores.json).
- GEMM. The KernelIR is the M2 development AOT, nine cases. The warm labels are from the M2 sessions and the cold labels from the clean-cold sessions.
- Attention. The KernelIR of the eight development cases was regenerated with the frontend on this branch. The IR is the same for both cores. The labels are from the
fde371ddevelopment sessions.
| Set | Scores | Median tau-b, base to candidate | Mean top-5 regret | Largest regret | MAPE over all points |
|---|---|---|---|---|---|
| GEMM | 18 | 0.792 to 0.782 | 0% to 0% | 0% to 0% | 7.3% to 7.5% |
| Attention | 16 | 0.635 to 0.618 | 0% to 0.45% | 0% to 7.2% | 14.5% to 13.5% |
-
Attention gets more accurate. It was predicted slow (median errors +1% to +22%), and F3 moves it toward the measurement. The largest gains are on the
fullcases with 128-wide heads, for exampleb2-q16-kv16-s2048-d128-full, MAPE 20.2% to 17.5%. -
Ranking loses on some cold cases.
b1-q32-kv8-s2048-d64-causal: tau-b 0.495 to 0.415, and top-5 regret 0% to 7.2%, so its fastest config leaves the shortlist.b1-q32-kv8-s1021-d64-full: 0.431 to 0.358.- The GEMM
sm-roundcases: -0.01 to -0.04.
The warm scores of these cases are unchanged.
-
These numbers do not change the choice. As registered, the choice above stands.