diff --git a/crates/cuda-driver/src/original_verify_window_sm120.rs b/crates/cuda-driver/src/original_verify_window_sm120.rs index 297fbf20..e83cafab 100644 --- a/crates/cuda-driver/src/original_verify_window_sm120.rs +++ b/crates/cuda-driver/src/original_verify_window_sm120.rs @@ -55,9 +55,11 @@ pub(crate) fn gu_swiglu_entry(ty: u32) -> Option<&'static str> { GU_SWIGLU_TYPES.iter().position(|t| *t == ty).map(|i| E_GU_SWIGLU[i]) } -/// The switches that are on by default on a 12.0 card. -pub(crate) const DEFAULT_ON_ATTN_DAILY: bool = true; -pub(crate) const DEFAULT_ON_GU_SWIGLU: bool = true; +/// The switches that are on by default on a 12.0 card. ATTN_DAILY and GU_SWIGLU are opt-in (`LELEKA_SM120_ATTN_DAILY=1`, `LELEKA_SM120_GU_SWIGLU=1`): +/// bitwise identical in the replay test, but the paired e2e A/B at 247k showed no measurable gain (switches on 127-131 tok/s, off 125-144), so they are +/// not shipped on until a paired run shows one. +pub(crate) const DEFAULT_ON_ATTN_DAILY: bool = false; +pub(crate) const DEFAULT_ON_GU_SWIGLU: bool = false; pub(crate) const DEFAULT_ON_SIDE_MIXER: bool = false; #[derive(Clone, Copy, Debug, Default, PartialEq, Eq)] diff --git a/docs/upstream-port-plan.md b/docs/upstream-port-plan.md index 3d7efc12..b0424d4f 100644 --- a/docs/upstream-port-plan.md +++ b/docs/upstream-port-plan.md @@ -330,6 +330,8 @@ Scripts: `scripts/upstream-rest/jobs/rest-qpf-id2.sh`, `rest-qpf-256k.sh`, `rest ## sm_120 decode switches (2026-10-29, branch `claude/decode-sm120-switches` on `claude/train-a-stra-245` 406b40a8; rows 2.1 / 2.2) +Speed-train decision (2026-10-29): `ATTN_DAILY` and `GU_SWIGLU` ship **default off**. The paired e2e session at 247k (`/data/leleka-e2e/runs/sm120`, `summarize.sh`) showed no gain: decode tok/s turns 1-4 with both on 127-131, with both off 125-144, turn 5 dominated by the PLE scan stall (fixed separately). The two arms also differ in the input tokens of turn 2 onward (105470 vs 105427), so the e2e outputs are not identical although the replay-identity gate reported d = 0; this is unresolved. Run-to-run spread of the base arms is as large as any gain. + Upstream turns five bitwise switches on by default on a compute capability 12.0 card (`engine/strata/include/strata/core/sm120_series.hpp`). One commit each, all behind `LELEKA_SM120_=0|1` (wins in both directions on a 12.x card; a card below 12.x never takes a switch, the PTX is sm_120 only, so the sm86 build is unaffected) and `LELEKA_SM120_PERF=0` (whole default set off); replay arm flags `!attn/!noattn`, `!gus/!nogus`, `!side/!noside`. Code: `crates/cuda-driver/src/original_verify_window_sm120.rs`; model-free probe `tools/decode-sm120/sm120_probe.cpp` (byte-compares the new kernels with the sealed ones, RTX 5090); @@ -337,8 +339,8 @@ scripts `scripts/decode-sm120/` (build, seal, holder jobs `sm120-replay-id.sh` a | switch | what was done | default on cc 12.0 | model-free result (RTX 5090, driver 595.99, CUDA 13.2.2, graph-timed, warm L2) | end-to-end | |---|---|---|---|---| -| `ATTN_DAILY` | `sm120_attn_daily.cu`: upstream `attn_chunk_kernel_pre75` + `attn_merge_v2_kernel<16>` replace `leleka_qsa_decode_chunk` / `_merge` in `QsaWindow::decode_attention` | on | 66 cases (T 1..8, 0..2051 cells, masked pages): chunk partials, merge of both partial sets and merge_v2 byte-identical; T=4 chunk 29.8 -> 20.3 us, merge 6.5 -> 2.9 us (12 QSA layers a window) | see the jobs below | -| `GU_SWIGLU` | `sm120_gu_swiglu.cu` (+ generated `sm120_iq_prefix.cuh`, the pinned `iq_kernels.cu` up to the dequant banner): upstream `native_gu_swiglu_kernel` replaces `window_moe_gu_` + `swiglu_entries_kernel` + `quantize_q8_1_kernel` for gate/up types 16 17 18 21 22 23 at n_embd 2560 | on | 30 cases (6 types, 1..8 rows, 1..40 groups): the q8_1 blocks the down kernel reads are byte-identical; per layer at 4 rows 20.9 -> 14.2 us (16), 29.8 -> 20.7 us (18), 24.9 -> 19.6 us (21) | see the jobs below | +| `ATTN_DAILY` | `sm120_attn_daily.cu`: upstream `attn_chunk_kernel_pre75` + `attn_merge_v2_kernel<16>` replace `leleka_qsa_decode_chunk` / `_merge` in `QsaWindow::decode_attention` | **off** (opt-in `LELEKA_SM120_ATTN_DAILY=1`) | 66 cases (T 1..8, 0..2051 cells, masked pages): chunk partials, merge of both partial sets and merge_v2 byte-identical; T=4 chunk 29.8 -> 20.3 us, merge 6.5 -> 2.9 us (12 QSA layers a window) | see the jobs below | +| `GU_SWIGLU` | `sm120_gu_swiglu.cu` (+ generated `sm120_iq_prefix.cuh`, the pinned `iq_kernels.cu` up to the dequant banner): upstream `native_gu_swiglu_kernel` replaces `window_moe_gu_` + `swiglu_entries_kernel` + `quantize_q8_1_kernel` for gate/up types 16 17 18 21 22 23 at n_embd 2560 | **off** (opt-in `LELEKA_SM120_GU_SWIGLU=1`) | 30 cases (6 types, 1..8 rows, 1..40 groups): the q8_1 blocks the down kernel reads are byte-identical; per layer at 4 rows 20.9 -> 14.2 us (16), 29.8 -> 20.7 us (18), 24.9 -> 19.6 us (21) | see the jobs below | | `SIDE_MIXER` (GDN half of `=2`) | the GDN gates and the gate projection of every GDN layer on two side streams of the window graph (fork after the quantizer, join before the recurrence); `OriginalCapture` owns the side streams | **off** (no identity or timing result yet) | none (no new kernel) | pending | | `GR_DOWN_TG=1` | not ported: `chain_gr_down_t2w8_nb4` (9.7 us at 4 rows, part of `LELEKA_CHAIN=all`) is the same idea and measured faster than the Original's | - | - | - | | `GR_UP75` | not ported: `chain_gr_up8` (5.7 us at 4 rows) already hoists the loads; vanilla's `gr_up75` averages 9.45 us in its trace (mixed T), not comparable, not probed | - | - | - |