Final stage group A/B stub PB vs PG (n=5), variant PG (PN + D1 + D2); D3 retry key in the ledger

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-11 16:54:38 +01:00
co-authored by Claude Sonnet 5.5
parent d635a73c9a
commit 0cb24b840c
3 changed files with 9 additions and 2 deletions
+1 -1
View File
@@ -108,7 +108,7 @@ Structure first, then the layer steps in graph order: embed (R7), mixer half (V3
| S2 | `GU_SWIGLU` (routed expert gate/up + SwiGLU + q8_1) | on since lever 1 | on | as S1 | gap doc lever 1 | device | fixing (needs a CUPTI section delta) |
| S7 | sub16 routed-expert kernels beyond `GU_SWIGLU` | warp-per-row | sub16 | estimate 0.20-0.35; the CUPTI pair K11 does not show LEL slower, so this must be re-measured by kernel before any work | upstream plan | device | fixed (closed 2026-11-11 by section delta + identity; enabled in the three 5090 profiles; windows `docs/experiments/ffn-d1-d2-d3-windows.md` WD-CP: F-layer FFN phase -3.9 / -7.7 / -10.0 / -12.9 / -18.7 us at T 1..5 = -0.214 ms a graph at CP's T mix (se 0.008), VRAM-pass down 19.3 -> 14.1 us and PCIe-pass down 5.5 -> 0.64 us at T 3; probe 64 cases byte-identical; identity P2/P5 2057/2057 rows, draft trace identical) (was: built, off: `LELEKA_SM120_DOWN_SUB16`, branch `claude/ffn-down-sub16` merged, sealed `sm120_down_sub16`; jobs `verify-ffn-d1-d2-d3-bitwise-probes` (`sm120_probe down`), `-identity` P2/P5, window WD/WZ queued 2026-11-11; look at `window_moe_down_20/_42` -> `sm120_moe_down_20/_42`; estimate refined to 0.17-0.23 ms a graph; `docs/experiments/ffn-phase-loss-design.md`) |
| D2 | `add_hits` folded into the combine (`LELEKA_SM120_HITS_IN_COMBINE`, upstream `combine_k10_vec4_hits`) | `add_hits` 48 x 1.2-1.3 us a graph | folded | upper bound 0.06 ms a graph (T 2-4) | design `ffn-phase-loss-design.md` 4.1 | device | fixed (closed 2026-11-11 by section delta + identity; enabled in the three 5090 profiles; windows `docs/experiments/ffn-d1-d2-d3-windows.md` WH-CP: `add_hits` gone, tail after the CPU rows -0.86..-0.93 us a layer = -0.043 ms a graph (about -0.025 with COMBINE_VEC4 on); probe failures=0, identity P3/P5 2057/2057 rows) (was: built, off: `LELEKA_SM120_HITS_IN_COMBINE`, branch `claude/ffn-hits-combine` merged, sealed `sm120_combine_hits`; jobs `verify-ffn-d1-d2-d3-bitwise-probes`, `-identity` P3/P5, `-cupti-windows` WH/WZ queued 2026-11-11; look at `add_hits` (-48 launches a graph) and the combine entry) |
| D3 | wait on flag M folded into the copy of the CPU rows (`LELEKA_SM120_WAIT_M_ROWS`) | 2 launches a layer | folded | 0.04-0.06 ms a graph; risk: upstream measured -1.5 % decode on Turing for the same fold | design `ffn-phase-loss-design.md` 4.1 | device | open (measured LOSS, `docs/experiments/ffn-d1-d2-d3-windows.md` WW-CP: the fused kernel costs 5.8 / 10.2 / 14.4 / 18.8 / 23.2 us at T 1..5 against 2.7 us for wait M + copy (1.44 us + 0.433 us per block: every block polls the flag over PCIe), F-layer FFN phase +3.3 / +7.7 / +12.6 / +17.3 / +21.8 us per layer; OFF, probe and identity PASS; retry only with a single-poller structure) (was: built, off: `LELEKA_SM120_WAIT_M_ROWS`, branch `claude/ffn-wait-m-rows` merged, sealed `sm120_wait_copy_rows`; thread 0 of each block polls, fence, barrier, then the copy; jobs as D2, window WW/WZ; look at the second `verify_wait_flag_ge` + `chain_copy_rows_from_mapped` -> `leleka_verify_wait_copy_rows`, and watch for a longer copy kernel) |
| D3 | wait on flag M folded into the copy of the CPU rows (`LELEKA_SM120_WAIT_M_ROWS`) | 2 launches a layer | folded | 0.04-0.06 ms a graph; risk: upstream measured -1.5 % decode on Turing for the same fold | design `ffn-phase-loss-design.md` 4.1 | device | open (measured LOSS, `docs/experiments/ffn-d1-d2-d3-windows.md` WW-CP: the fused kernel costs 5.8 / 10.2 / 14.4 / 18.8 / 23.2 us at T 1..5 against 2.7 us for wait M + copy (1.44 us + 0.433 us per block: every block polls the flag over PCIe), F-layer FFN phase +3.3 / +7.7 / +12.6 / +17.3 / +21.8 us per layer; OFF, probe and identity PASS; retry key: ONE polling block for the whole grid (the other blocks wait on a device-side release word the poller writes, or the copy is split into a one-block wait kernel + the existing copy graph node), so the PCIe flag is read by one warp, not by T x 10 blocks; the floor to beat is 2.7 us for wait M + copy) (was: built, off: `LELEKA_SM120_WAIT_M_ROWS`, branch `claude/ffn-wait-m-rows` merged, sealed `sm120_wait_copy_rows`; thread 0 of each block polls, fence, barrier, then the copy; jobs as D2, window WW/WZ; look at the second `verify_wait_flag_ge` + `chain_copy_rows_from_mapped` -> `leleka_verify_wait_copy_rows`, and watch for a longer copy kernel) |
| S11 | float4 combine | not ported | `combine_k10_vec4` 50.6 x 1.2 us | estimate 0.05-0.10 (the code has no launch saving, one launch a layer both ways: expect 0.01-0.02) | upstream plan | device | fixed (switch `LELEKA_SM120_COMBINE_VEC4` (off), sealed `sm120_combine_vec4`, branch `claude/s11-s9-combine-headmix` merged; jobs `verify-s11-s9-u5a-bitwise-probes`, `-identity` P2/P5, `-cupti-windows` CS/CZ queued; look at `mtp_full_combine` against `leleka_verify_combine_k10_vec4` per launch). Identity 2026-11-10 (`verify-s11-s9-u5a-identity` P2): top-16 rows 2057/2057 bit-identical, draft trace 1036/1036, A/A identical: PASS. Window (cumulative variants, CS-CP, `docs/experiments/verify-s11-s9-u5a-windows.md`): combine 1.50 -> 1.15 us per launch, -0.0164 ms a graph weighted over T (noise <= 0.0004), resolved at every T. Enabled by default in the three 5090 profiles 2026-11-11 (closed by section delta + identity)) |
| K8 | hyper-connection down (`chain_gr_down_t2w8_nb4` 11.1 us against `gr_down_staged` 11.5 us) | 1.063 | 1.112 | -0.049 | CUPTI | device | proved-equal (LEL ahead) |
| K9 | hyper-connection up (`chain_gr_up8` 8.5 us against `gr_up75` + `gr_up_multi` variants) | 0.817 | 0.877 | -0.060 | CUPTI | device | proved-equal (LEL ahead) |
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
# Group A/B at the end of the stage (owner rule 2026-11-10, n = 5 pairs): PB = the 5090 profile set before the QSA prelude, the fused commit and the combine vec4;
# PG = the final profile set of the stage as the profiles carry it (+ prelude, fused commit, combine vec4, down sub16, hits in combine). Same binary bin-ffn-switches (the switches come from the variant, not from a profile file). Re-measures the decode step of R1 after the whole stage: how many ms/round of the +1.98 are closed.
# First 30 requests of VANL nestng-crm-r2, floor profile, order ABBA-like to cancel drift. Report: ab_report.py RUN_DIR PB PG.
unset SPD_VARIANTS SPD_CELLS SPD_OUT SPD_MAX SPD_TUNES SPD_BIN
export SPD_BIN=/data/leleka-e2e/spd-gap/bin-ffn-switches SPD_VARIANTS="PB.1 PG.1 PG.2 PB.2 PB.3 PG.3 PG.4 PB.4 PB.5 PG.5" SPD_MAX=30 SPD_CELLS=/data/leleka-e2e/codex-compare/runs/main/VANL/nestng-crm-r2 SPD_OUT=/data/leleka-e2e/spd-gap/runs/decode-stage-group-ab-profile-set-pb-vs-pg
exec bash /data/leleka-e2e/spd-gap/tools/spd_ab_job_x.sh
+1 -1
View File
@@ -100,7 +100,7 @@ for v in $VARS; do
PB) export LELEKA_SM120_ATTN_DAILY=1 LELEKA_SM120_GU_SWIGLU=1 LELEKA_SM120_SIDE_MIXER=1 LELEKA_SM120_SIDE_QSA=1 LELEKA_SM120_SIDE_SHARED=1;; # the 5090 profile set before the prelude, exactly as the profiles carry it (no fused commit): base of the QSA prelude A/B
ZQ) export LELEKA_SM120_ATTN_DAILY=1 LELEKA_SM120_GU_SWIGLU=1 LELEKA_SM120_SIDE_MIXER=1 LELEKA_SM120_SIDE_QSA=1 LELEKA_SM120_SIDE_SHARED=1 LELEKA_SM120_FUSED_QSA_PRELUDE=1;; # PB + the QSA prelude: the set the 5090 profiles now carry (group A/B PB against ZQ)
PN) export LELEKA_SM120_ATTN_DAILY=1 LELEKA_SM120_GU_SWIGLU=1 LELEKA_SM120_SIDE_MIXER=1 LELEKA_SM120_SIDE_QSA=1 LELEKA_SM120_SIDE_SHARED=1 LELEKA_SM120_FUSED_QSA_PRELUDE=1 LELEKA_DRAFT_FUSED_COMMIT=1 LELEKA_SM120_COMBINE_VEC4=1;; # the 5090 profiles as of 2026-11-11 (prelude, fused commit, combine vec4 on top of PB): the new side of the stage group A/B against PB
PF) export LELEKA_SM120_ATTN_DAILY=1 LELEKA_SM120_GU_SWIGLU=1 LELEKA_SM120_SIDE_MIXER=1 LELEKA_SM120_SIDE_QSA=1 LELEKA_SM120_SIDE_SHARED=1 LELEKA_SM120_FUSED_QSA_PRELUDE=1 LELEKA_DRAFT_FUSED_COMMIT=1 LELEKA_SM120_COMBINE_VEC4=1 LELEKA_SM120_DOWN_SUB16=1 LELEKA_SM120_HITS_IN_COMBINE=1 LELEKA_SM120_WAIT_M_ROWS=1;; # PN + the FFN-phase switches D1-D3
PG) export LELEKA_SM120_ATTN_DAILY=1 LELEKA_SM120_GU_SWIGLU=1 LELEKA_SM120_SIDE_MIXER=1 LELEKA_SM120_SIDE_QSA=1 LELEKA_SM120_SIDE_SHARED=1 LELEKA_SM120_FUSED_QSA_PRELUDE=1 LELEKA_DRAFT_FUSED_COMMIT=1 LELEKA_SM120_COMBINE_VEC4=1 LELEKA_SM120_DOWN_SUB16=1 LELEKA_SM120_HITS_IN_COMBINE=1;; # PN + D1 and D2: the 5090 profiles as of 2026-11-11 (final set of the stage), against PB
R) export LELEKA_REFILL_DEFER=on;; # lever 5: the lent-slot refill queued inside the decode phase's assembly (same copies, other time)
S) export LELEKA_ROUTE_TAIL_SKIP=7 LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED=100;;
T*) export LELEKA_ROUTE_TAIL_SKIP=7 LELEKA_ROUTE_TAIL_SKIP_MAX_CACHED=100; p=${vb#T}; p=${p%[a-z]}; [ "$p" != 45 ] && export LELEKA_ORIGINAL_SERVE_PCIE_FRAC=0.$p;;