D1 of docs/experiments/ffn-phase-loss-design.md. New sealed sm_120 asset sm120_down_sub16.ptx
(nvcc 13.2.86), entries sm120_moe_down_20 (IQ4_NL, 8 lanes a row, 32 rows a block) and
sm120_moe_down_42 (Q2_0, 16 lanes a row, 16 rows a block): upstream's
native_down_multi_kernel<TD, SUB_DOWN> hb == 20 branches, with the row-dot reduction tree of the
literal window_moe_down_<T> (row_dot_multi) reproduced in 8 / 16 lanes. grid.y strides over the
groups, so the PCIe pass launches kPcieGroupRows = 4 block rows (the fused GU_SWIGLU gate/up of
that pass too) instead of one per possible group. Only n_ff == 640 and the two formats; any other
layer keeps window_moe_down_<T>. Switch off: the recorded graph is unchanged.
Planner: group_kernels / GroupKernels / DownKernel in plan_expert_groups.rs. Asset, formats and
the PCIe block rows in original_verify_window_down.rs; asset pinned in extra-seal-plan.json and
ptx-sm86/MANIFEST.json ("not built for sm_86 by design"). Probe: sm120_probe `down` compares the
whole output buffer of both kernels byte for byte (T 1-8, 0-16 groups, grid.y cap and 4,
n_embd 2560 and 2552); built, not run (no GPU).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
LELEKA_SM120_HITS_IN_COMBINE: one leleka_verify_combine_k10_vec4_hits launch per layer
replaces moe_hit_add + the combine (mtp_full_combine or the COMBINE_VEC4 kernel), -48
launches per graph. New sealed asset sm120_combine_hits.cu/.ptx (nvcc 13.2.86, sm_120,
--fmad=true --ftz=false; pinned in extra-seal-plan.json and ptx-sm86/MANIFEST.json),
planner and ffn_hits_combine in original_verify_window_ops/hits_combine*, asset preloaded
via required_assets. Shapes the kernel does not fit record add_hits + the scalar combine.
Model-free probe tools/decode-sm120/sm120_probe_hits.cpp (+ build_hits.sh): add_hits +
combine against the folded kernel byte for byte, T 1-8; built, not run (no GPU).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
T0 of docs/experiments/ffn-phase-loss-design.md: three opt-in switches resolved in
original_verify_window_sm120.rs, the FfnSwitches DTO carried in WindowPolicy::ffn, one-line
hooks in the window ops (wait_cpu, copy_cpu_rows, hit_add, combine) and the planner site
(ExpertGroupSite::down_sub16), and per-task stub files. All switches off: the recorded
graph is unchanged.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Per kind/T/layer-class timeline of the FFN phase for LEL (CL.2, CT.1, CY.1)
and VANL from the request-29 windows, shift-share of the +0.95 ms into device
chain / arrival of the CPU rows / tail / tier mix, and the device-side options
that remain (sub16 down kernel with PCIe pass rows, add_hits in combine, wait M
folded into copy rows) with a task split. Analysis only: no engine code, no GPU.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New sealed sm_120 asset sm120_gr_down_fused.ptx (nvcc 13.2.86): leleka_gr_down_fused_t2w8 replaces
chain_gr_split + chain_gr_down_t2w8_nb4 (96 launches fewer per verify graph). The block stages R' * w_norm of
its two tokens into shared memory, adds the sum of squares in the split kernel's order, scales with rs and
runs the down kernel's dots; the operations and their order are those of the two kernels (bitwise by
construction; upstream's gr_down_v3 sums in another order). A no-op, said once, without the chain gr pair.
Planner, switch resolution (Sm120Switches, GrConfig.down_fused), unit tests, model-free probe
tools/gr-down-fused (not run: no GPU). Not measured. Microbench harness: the NaN outputs were a stream race
between the poison memsets and the kernels, fixed; inputs are checked finite.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
COMBINE_VEC4: new sealed sm_120 asset sm120_combine_vec4.ptx (nvcc 13.2.86), entry leleka_verify_combine_k10_vec4,
upstream combine_k10_vec4 (non-hits form). Same per-element operations as the sealed mtp_full_combine: first
product rounded, nine fmaf in expert order, one add of the shared row. Falls back to the scalar launch when
k != 10, n % 4 != 0 or a row base is not 16-byte aligned. Same launch count as the scalar path.
HEAD_MIX_MULTI: upstream STRATA_HEAD_MIX_MULTI. The final mixer as one multi-token hc read over output_hc_* (the
layer read kernels, apply = false, no inject), 3 launches instead of 5 per token. No new PTX.
Switch DTO CombineHeadKernels (original_verify_window_combine_head.rs) travels beside the GDN policy; the shared
switch file gets two fields. Unit tests (asset seal, PTX arithmetic shape, launch plans, whole-window launch order with
both switches). Model-free byte-compare probe tools/combine-head written, compiled, not run (no GPU). Design and
CUPTI names: docs/experiments/verify-combine-and-head-mix.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
What changed, the reset checklist with the code location of each item, what is not covered, how to test it
on a GPU and the risks. No measurement: nothing was run on a device.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
park drains the commit and both streams and retires every graph's launch, keeping the graphs, the bank, the
streams and the event. rearm(OriginalVerifyRearm { gdn_states, gdn_histories, ple_history }) puts back what
a fresh new() + record_all leaves: the verifier counters and completed-window memory, the bank (staged
window, generation + 1 so stale rows and windows are refused, released = false, held PCIe sources), every
mapped staging allocation (doorbell, the three flag words, the published GPU plan, the CPU rows), the arena
and the profile stamps, and overwrites the canonical GDN image and the PLE history in place (reseed,
117.7 MB). Preconditions (parked, no window outstanding, graphs idle, QSA journal not armed) are refused
without changing anything; an error after the first change fails the verifier so the caller retires it.
Pure parts (seed shapes, the bank book, the reset plan, the registry reset, the refusal order) are unit
tested without a device; the device half is for the identity job.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The verify-window aggregates borrowed every weight, scratch and history buffer from the cache that owns
it (&'a DeviceBuffer), so a recorded graph set could not be stored next to its owner and was dropped and
recorded again for every request. DeviceRef<'ctx> is an Rc handle to the allocation (own, or a range of
a slab it keeps alive): Clone is one count increment, Deref reaches the DeviceBuffer the kernels take, a
release while another holder remains frees nothing.
OriginalVerifyWindowResources<'ctx>, OriginalVerifyResources, the GDN/QSA journals, the GR/MoE/proj/QSA
bindings and the RoPE tables carry no 'a any more; DecodeResources<'ctx> likewise. The engine caches
(dense: Vec<DeviceRef>, MoE: EncodedWeight::Raw(DeviceRef)) hand out clones in the assembly only;
seed_ple_history writes through the handle (copy_from_shared). Nothing changes on the existing paths:
same kernels, same arguments, same order. A guard test keeps .clone() out of the window and journal
modules, which only dereference.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
New sealed sm_120 asset sm120_gdn_fused.ptx (nvcc 13.2.86): leleka_verify_gdn_fused_step
(the Original's step loop over shared memory, conv prologue, gates in two warps or joined from the
SIDE_MIXER branch, split-window replay) and leleka_gdn_ab_unrolled_t1..t8. Written with the Original's
plain expressions on purpose: ptxas contracts a plain mul+sub into one FFMA, so __f*_rn intrinsics
would not be bitwise equal after the driver JIT. PTX shape compared with original_verify.ptx in unit
tests; model-free probe tools/gdn-fused written, not run (no GPU). Design: docs/experiments/verify-gdn-fused-kernels.md
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Harness (one TU including upstream fused_gr.cu whole, ours from the sealed PTX through the driver API plus an nvcc cubin),
GPU queue stub, and the method note with input sha256. Not run on the GPU yet.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Replaces 12 x (2n+1) per-row launches of a window graph by 24: leleka_verify_qsa_kv_rows (n x mtp_original_append, precise math) and
leleka_verify_qsa_index_rows (tail snapshot + n x verify_qsa_append_analytic, fast math). Both PTX built with nvcc 13.2.86 (compile only)
and pinned; model-free probe tools/verify-qsa-fused-prelude/prelude_probe.cpp not yet run. No GPU number.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Off by default. With the switch the verify graph ends with verify_clear_status, verify_scan_logits and a
one-word store of the status into a host-mapped verdict word (vanilla's logits_nonfinite_rows order); the
post-drain check reads that word instead of launching the scan, synchronising the stream, copying the status
back and synchronising the context. Same error at the same place, before complete_window and any commit.
Sealed PTX unchanged. Unit tests for the switch, the graph tail commands, the verdict decode and the post-drain
dispatch. Note updated with the corrected O7 ledger wording.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>