docs: upstream port plan, diff list for rows 2.1 and 2.2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
a14b57f5ec
commit
6a6c394b9a
@@ -56,6 +56,40 @@ the run-to-run control); **L** live Codex session.
|
||||
Qwen3.6-35B-A3B path, Metal/SYCL/HIP-only changes, K8V4 streaming and elastic KV (`--kv-grow`; our serve path excludes K8V4), the installers and host app.
|
||||
DeepSeek-V4.1 engine: separate plan after this one (digest part 2; needs the disk work already done on the server, `/data`).
|
||||
|
||||
## Rows 2.1 / 2.2: what upstream has that our window does not (diff list, 2026-10-26; no implementation)
|
||||
|
||||
Method: read the resulting upstream code (`engine/strata`, commit `41cf05a0`) against our chain kernels (`crates/cuda-driver/src/chain_window.cu`, `docs/chain-kernels.md`) and the sealed Original window kernels,
|
||||
which are the OLD upstream pin (so the old pin has none of `sub16`, `up75`, `down_tg`, `SIDE_MIXER`, `COMMIT_BATCH`, `HEAD_MIX_MULTI`, `SH_FORK`, `native_qsa_rms_norm_rope`). Every gain below is an
|
||||
**estimate** from our own per-family microseconds (ledger section 5, `docs/chain-kernels.md` 2.4; chain 12.6 ms and round about 25 ms per 4-row window on the 5090), not a measurement; upstream's own
|
||||
numbers are claims on other hardware (RTX PRO 5000, sm_86 cards). Nothing here was run. Re-sealing PTX (sm_120 and `ptx-sm86`) is a fixed extra cost for every item marked "seal".
|
||||
|
||||
| Item (upstream switch) | Our status | Estimated gain per window | Effort | Numerics |
|
||||
|---|---|---|---|---|
|
||||
| `GR_DOWN_TG=1` | HAVE, better: `chain_gr_down_t2w8_nb4` (9.7 us against the Original's 18.4 us at T=4) | none | - | - |
|
||||
| multi-token router, multi-token GR read/write | HAVE: the old pin already batches them; our chain GR is the better one | none | - | - |
|
||||
| `HEAD_MIX_MULTI` (one multi-token head-mix launch instead of 5 kernels per token, `verify.cpp` 301-316, 2327-2345; ours: `plan_head_mix`, `original_verify_window_gr.rs:622`) | MISSING | 60-100 us (0.5-0.8 % of the chain); the chain GR kernels already take T tokens, maybe no new PTX | S | bitwise (verify byte for byte) |
|
||||
| `COMMIT_BATCH` + state-only GDN commit (`verify.cpp` 2646-2700, `verify_kernels.cu` 180-215, 1067-1087, 1160-1170; ours: `verify_gdn_conv_commit_kernel` + the full `verify_gdn_step_norm_multi_kernel` per layer, `original_verify.rs:331-336`, commit graph 158 kernels, 0.463 ms) | MISSING | 250-350 us per ROUND (1.0-1.4 % of the round), on the critical path between rounds | M, seal | bitwise (`gdn_parity`) |
|
||||
| `ATTN_DAILY` (`qsa_decode_attn.cu` `attn_chunk_kernel_pre75`, `reduce12`, `attn_merge_v2`: 16 shuffles instead of 60, 2 cells per step) | MISSING: ours is the literal old kernel (`leleka_qsa_decode_chunk`, `qsa_native_decode.cu:81`); `chain_qsa_decode_chunk` only hoists loads and measured slower | 140-235 us (1.1-1.9 %): 30-50 % of the 470 us chunk | M, seal | bitwise |
|
||||
| cluster argmax / top-k (`sampler.cu`, sm_90+) | MISSING (our greedy argmax: one block per token, 79 us per window; draft sampler 38 us, `row_top_prob` 36 us) | 120-160 us per round (0.5-0.8 %); N/A on sm_86 | S-M (`cuLaunchKernelEx` inside capture), seal | bitwise |
|
||||
| `SIDE_MIXER=2` + `SH_FORK_LATE` (GDN a/b gates and the indexer chain on side stream 1, the gate projection and QSA query chain on stream 2, events inside the captured graph) | MISSING: our window is one stream, no cross-stream edge | 300-700 us (2.4-5.5 % of the chain); the 5090 has 170 SMs and our kernels are small-grid; upstream claims -1.2 % (A4000) / -2.3 % (3060) | L (side streams + event capture in `OriginalCapture`, keep the QSA journal in order); no seal | bitwise (scheduling only) |
|
||||
| `GR_UP75` (interleaved reductions, tail dot over 4 rows) | PARTIAL: `chain_gr_up8/16` already hoist the loads | 50-100 us (0.4-0.8 %) | S, seal | bitwise |
|
||||
| batched K/V and indexer append (`kv_q8.cu:193`, `native_qsa_indexer.cu:269,300`) | MISSING (one row per launch, `original_verify_window_qsa.rs:530`) | 50-90 us (0.5 %) | M, seal; keep the streamed host-mirror semantics | bitwise |
|
||||
| float4 combine (`native_moe.cu` 66-93; the fused `combine_k10_vec4_hits` is HIP-only) | MISSING | 30-50 us (0.3 %) | S, seal | bitwise |
|
||||
| 16-lane sub-warp expert kernels + `GU_SWIGLU` (`iq_kernels.cu` `native_gu_multi_kernel<..SUB16>` 1864, `row_dot_80_sub16` 1561, `launch_gu_swiglu`; ours `window_moe_gu_*`/`window_moe_down_*` are the old warp-per-row kernels, `chain_swiglu_quant_kernel` fuses SwiGLU with the quantizer only) | MISSING / PARTIAL | 200-350 us (1.6-2.8 %): the old kernel idles half the lanes on the third pass; no upstream number | L (a 5.7k-line file, per-format parity), seal | bitwise (claimed) |
|
||||
| `MMVQ_IL` interleaved MMVQ, 2-4 and 5-8 columns (`native_mmvq.cu` 2979-3175, `q8_1_il.cuh`; tables only for IQ4_XS, Q4_K, Q5_K, Q6_K, Q3_K; the 5-8 column table is sm_120-only) | MISSING (we run the old exact `head_n*_t*` kernels) | 100-400 us (0.8-3 %); bounded by dense 2,250 us against a floor of ~2,000; larger at T >= 5 where the old kernel falls back; which of our dense weight types the tables cover is unknown | L, seal | bitwise (claimed, `mmvq_il_parity`) |
|
||||
| fused per-head RMSNorm+RoPE (`native_rope.cu` 69-125, 175-245) | MISSING (split_q, rms, rope: 7 launches against 3) | ~40 us (0.3 %) | S-M, seal; must match the sealed `--use_fast_math` pair bitwise | bitwise (verify) |
|
||||
| exact-T GDN a/b | PARTIAL (`chain_gdn_ab_multi_kernel` hoists weights across 96 warps) | 50 us or less | S, seal | bitwise |
|
||||
| MTP catch-up skipping rejected rows (`mtp.cpp` 73-79, 1580) | MISSING | 20-80 us per round (0.1-0.3 %) | M | gate it (not claimed bitwise) |
|
||||
| `ONE_TOKEN_COMMIT` | MISSING | about 0 at 3.06 tokens per round (only T=1 windows) | M, seal | bitwise |
|
||||
|
||||
Ranking by estimated gain per effort: (1) `HEAD_MIX_MULTI`, (2) `COMMIT_BATCH` + state-only GDN commit, (3) `ATTN_DAILY`, (4) cluster argmax, (5) `SIDE_MIXER=2` + `SH_FORK_LATE` (the largest single item, L),
|
||||
(6) `GR_UP75` delta, (7) batched appends, (8) float4 combine, (9) sub16 experts + `GU_SWIGLU` (L), (10) `MMVQ_IL` (L), then the rest.
|
||||
Measure first, all model-free (nothing needs a model load): the T distribution and T=1 share of the live windows (`docs/e2e-data/945*`: decides `MMVQ_IL` 5-8 columns and `ONE_TOKEN_COMMIT`); a per-kernel sum of the
|
||||
72 GDN commit kernels from the job 9062 trace (bounds `COMMIT_BATCH`); a `chain_probe gr`-style shape for the head mix at T = 1..8 (byte-compare the per-token chain against the staged multi read);
|
||||
`tools/chain-probe/qsa_prof.cu` extended with upstream's `attn_chunk_kernel_pre75` + `attn_merge_v2` against `leleka_qsa_decode_chunk` (cold weights, our 64-cell grid); an `mb_pdl.cu`-style two-branch graph for
|
||||
the overlap bound of `SIDE_MIXER` / `SH_FORK` (a/b-sized kernels beside a qkv-sized MMVQ on 170 SMs); upstream's `decode_cluster_parity --bench` on 248,320 logits; `window_moe_gu_16` / `window_moe_down_20`
|
||||
against the sub16/sub8 kernels with random blobs, 30 groups, cold weights (gates the biggest item); `mmvq_il_parity --bench` on the 5090 with our shapes and T from 4 to 8.
|
||||
|
||||
## Order of work and where it runs
|
||||
|
||||
Phase 0 and 1.2 run on the laptop in WSL (tests) and are committed one by one on `claude/upstream-port`; GPU gates (R, I, Q) go through the server queue
|
||||
|
||||
Reference in New Issue
Block a user