Commit Graph
531 Commits
Author SHA1 Message Date
Pavlo Ratushnyi b4ef2eec47 Merge branch 'main' into claude/speed-vs-strata-08143a 2026-11-11 01:22:25 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b8bcd7e777 FFN switches D1-D3: probe, identity and window stubs; ledger rows and job names
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:19:31 +01:00
Pavlo Ratushnyi ef128c3b04 Merge claude/speed-vs-strata-08143a: sm_120 defaults, verify side streams, fused commit, step ledger, upstream microbench
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

# Conflicts:
#	deploy/rust-runtime/profiles/rtx5090-32g-file.json
#	deploy/rust-runtime/profiles/rtx5090-32g-gguf-ple.json
#	deploy/rust-runtime/profiles/rtx5090-32g.json
#	docs/experiments/step-ledger.md
2026-11-11 01:18:50 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8b2bd4d5e5 Window job: variants WD/WH/WW/WZ for the FFN switches; unset the per-variant switches between variants (a CS export leaked into CH/CD)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:13:47 +01:00
Pavlo Ratushnyi 278c4b2218 Merge claude/ffn-wait-m-rows (D3); both seal manifests hand-merged and validated as JSON 2026-11-11 01:11:52 +01:00
Pavlo Ratushnyi e76bc1bcbb Merge claude/ffn-hits-combine (D2) 2026-11-11 01:11:19 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 7395f00dee Verify window: LELEKA_SM120_DOWN_SUB16 (group-strided sub8/sub16 routed-expert down projection), off by default
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>
2026-11-11 01:10:46 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 e22027119a D2 HITS_IN_COMBINE: add_hits folded into the combine (sm120_combine_hits, off by default)
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>
2026-11-11 01:07:18 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3362615444 D3 WAIT_M_ROWS: wait on flag M folded into the CPU-rows copy (sm120_wait_copy_rows), sealed asset, probe
LELEKA_SM120_WAIT_M_ROWS (off by default): wait_cpu defers the ring, copy_cpu_rows records one
leleka_verify_wait_copy_rows launch (grid tokens x k, 128 threads) instead of verify_wait_flag_ge +
the rows copy. Thread 0 of each block polls, fences, block barrier, then the copy of
chain_copy_rows_from_mapped_kernel. PTX built with nvcc 13.2.86 and pinned (extra-seal-plan,
ptx-sm86 MANIFEST note). Model-free probe tools/decode-sm120/sm120_probe_waitrows.cpp (late flag,
T 1-8) built, not run (no GPU).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:01:49 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d19d08b698 V2 FFN phase: loss analysis and design (offline CUPTI timeline script)
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>
2026-11-11 00:40:33 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6129eed3e2 Probe stub run2: stage the frozen probe binaries with the executable bit
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 00:04:09 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 51b36adf7a prefill A/B driver: variants PED/PEDP (prefetch with detached drains), PE traces driver errors
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 23:19:10 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 9119e6d29d prefill A/B driver: variant PET (ring prefetch with driver error trace)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 21:49:04 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a4be37beb3 prefill A/B driver: variants FR/FP/PE/PEP/RB/RBP (stream 1536 base, ring prefetch, refill batch)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:50:52 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d885dc5019 Window scripts: holder env var goes before nohup (nohup HOLDER_MEMFD=... failed to start the holder)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:27:08 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 bf13908627 lab queue: holder watchdog (restarts the sparse holder when none runs and no window is pending, alert in decode/notes.md)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:26:52 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 dc828b961b prefill A/B driver: variant YRP (default set + refill deferral + stream 1536); YP carries stream 1536
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:20:50 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ce7c7b69ec prefill A/B driver: variants SR/SRP (expert stream from 1536 rows)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 19:27:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 fc1e94ea55 Speed program: window variants CP/CS/CH/CD/CZ, ledger S11/S9/U5a built and queued (probes, identity, CUPTI windows)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 19:23:28 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2f358e072a Merge repair: valid JSON in extra-seal-plan.json and ptx-sm86/MANIFEST.json after joining the S11/S9 and U5a branches
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 19:15:52 +01:00
Pavlo Ratushnyi 4a1845aedb Merge branch 'claude/u5a-gr-down-fused' into claude/speed-vs-strata-08143a
# Conflicts:
#	crates/cuda-driver/ptx-sm86/MANIFEST.json
#	crates/cuda-driver/src/original_verify_window_sm120.rs
#	scripts/gpu-bringup/extra-seal-plan.json
2026-11-10 19:15:36 +01:00
Pavlo Ratushnyi 1c8c4abac2 Merge branch 'claude/s11-s9-combine-headmix' into claude/speed-vs-strata-08143a 2026-11-10 19:15:14 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0518311567 verify window: LELEKA_SM120_GR_DOWN_FUSED (hc split + tiled down projection as one launch, step U5a), off by default
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>
2026-11-10 19:14:46 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b8a74d01dd Verify window: LELEKA_SM120_COMBINE_VEC4 (float4 routed-expert combine) and LELEKA_SM120_HEAD_MIX_MULTI (one multi-token head mix), both off by default
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>
2026-11-10 19:08:30 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d9ea02037a prefill A/B driver: variants SP1/SP2 (expert stream from 1024 / 256 rows)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 19:00:32 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 456f5336b1 Speed program: ledger V5/V7 analysis of the flag waits (no kernel overhead to remove; the loss is the CPU leg's arrival), cupti_flag_waits.py
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 18:55:34 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2a0542a89f prefill A/B driver: variant APR (profile + routing trace)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 18:39:13 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 1b49397cd0 ring diagnostic: LELEKA_PREFILL_DIAG_SKIP_EXPERT_DMA=N skips the expert copies after the first N (cold slots are uninitialised and the finite guards refuse them)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 17:45:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 edad5e7737 Speed program: QSA prelude on in the 5090 profiles (identity P2/P3/P8, section delta per T); ledger K6/K1/K7/K7a/S10/U3/O7 with the window results; PB/ZQ variants for the set A/B
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 12:13:58 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c1cb1ff5e6 prefill A/B driver: variant DSP (diagnostic: expert DMA skipped, profiled)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:23:55 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 dcd01042c4 prefill A/B driver: variants Y/YP (the default switch set: check merge, park fast, graph reuse)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 10:17:04 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 4fef1b0091 pf_ab_job guard: comment on its own line (the previous edit commented out the job name)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 02:34:37 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6db5d8cc61 pf_ab_job guard: take the newest .running file (stale ones exist)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:04:00 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b732ee37f4 Holder windows restart the lab holder sparse (cmp_window.sh, spd_window.sh); spd_ab_job.sh gets the sparse-memfd guard
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:03:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 e2a2693071 Speed program: the identity harness verifies the extents of a sparse holder memfd instead of reading the whole archive
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:01:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8bd63be469 holder: guard against a non-sparse lab holder in pf_ab_job (restart sparse and requeue); ledger row M1; ladder A/B ran on the full holder
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 01:01:09 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6ba60d7d34 pf_ab_job: variants RG/RGP/RGT (decode graph reuse)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 00:56:14 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 7570247d92 Merge claude/verify-decode-graph-reuse-handles; decode graph reuse (Q7) wired behind LELEKA_DECODE_GRAPH_REUSE
Merge of the speed session's driver part (DeviceRef handles, OriginalVerifier park/rearm, OriginalVerifyCanonicalGdn reseed; ptx manifest and seal plan entries of both sides kept, ledger rows of both sides kept) with the owner loan: the journal's owners are Option behind accessors, lend() uses the same idle precondition as the speed session's require_idle.

DecodeResources implements HeldAssembly for real (park, rearm from the session priors, lend and take_back through the journal loan; every refusal retires the set). OriginalServeStack holds a GraphReuse; decode assemble asks begin first (re-arm, refill queue; or the owners back to record), teardown keeps the assembly for a clean request (drafter end_request_keep_bank, shared-expert pin, park, lend, adopt) or runs the old teardown; retirement releases the drafter before the bank closes, in begin, close and reset_expert_tier. The MoE cache pins the shared experts while a set is held and counts freed window entries (weights epoch). Switch off: begin is not called and teardown runs the old body unchanged.

Tests: GraphReuse policy with a logging probe (switch off touches nothing, key change, moved owners, refused re-arm, lost owners, order release before drop), keepable outcomes, the lifecycle fake scenarios, the GPU-free loan state machine. Not run on a GPU. No speedup claim.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 00:50:19 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a70955970b Speed program: nine-process identity harness and CUPTI/group A/B variants for the new verify switches
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:42:46 +01:00
Pavlo Ratushnyi 182e1ca07e Merge branch 'claude/verify-gdn-fused-kernels' into claude/speed-vs-strata-08143a
# Conflicts:
#	crates/cuda-driver/ptx-sm86/MANIFEST.json
#	crates/cuda-driver/src/original_verify.rs
#	crates/cuda-driver/src/original_verify_window_sm120.rs
#	scripts/gpu-bringup/extra-seal-plan.json
2026-11-09 23:39:52 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 62fd0f88a8 verify window: LELEKA_SM120_FUSED_GDN (GDN conv + gates + step in one launch) and LELEKA_SM120_GDN_AB_UNROLL (upstream SMALL_UNR bit 1), both off by default
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>
2026-11-09 23:38:50 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 96fd240382 pf_ab_job: variants GT/GTP/GTD (prefill GDN tensor-core scan, experimental)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:35:27 +01:00
Pavlo Ratushnyi 05a668c87b Merge branch 'claude/prefill-gdn-tensor-core' into claude/prefill-latency
# Conflicts:
#	crates/engine-qwen35-cuda/src/settings/serve.rs
#	crates/engine-qwen35-cuda/src/settings/serve_tests.rs
#	scripts/gpu-bringup/extra-seal-plan.json
2026-11-09 23:33:44 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c5a8b77942 prefill: LELEKA_PREFILL_GDN_TC (EXPERIMENTAL, LOSSY, off by default): the prompt GDN recurrence as a chunked scan on the tensor cores (ledger U1)
Port of Strata upstream gdn_tc.cuh (strata-upstream/main 504b1433; history 8c2a84694, 06f212aef 99-KB split plan, 51567de1a two value tiles
per head from 96 SMs) as a new standalone sealed asset gdn_prefill_tc.cu/.ptx (sm_120, precise recipe of prefill_stage, extra-seal-plan group
gdn-prefill-tc, ptx-sm86 manifest: not built, the plan refuses cc < 12). Kernels: leleka_gdn_tc_prep (chunk algebra A, T = (I + A)^-1, P, f16
hi/lo images), leleka_gdn_tc_scan_t1 (48 blocks x 256) and _t2 (96 blocks x 128, the RTX 5090 plan, 170 SMs), 97,808 B of dynamic shared
memory, 254 registers, no spill. Same interface as leleka_prefill_gdn_rec_kh: state_in -> state_out, readout y, the non-finite state
witness from the final state. The fused norm, the 124-KB plan and the NP experiments are not ported; our out-norm kernel runs after as before.

Switch: typed setting prefill_gdn_tc (LELEKA_PREFILL_GDN_TC=1|on, serve_tests), GdnPromptOptions.tensor_core_scan through
Context::original_gdn_prompt_device_with; no env read in cuda-driver. Dispatch (gdn_prefill_tc::plan/ScanPlan::takes, host tests of the whole
decision table): switch on, cc >= 12, >= 48 SMs, >= 97,808 B opt-in shared memory, a run of >= 128 tokens; else the sequential kernels
unchanged, with one stderr line why. The scratch (942,272 B a chunk, 60,305,408 B at upstream's 64 chunks) is the prompt device's
dequantization scratch, idle during the recurrence on the one stream, so the super-block is 55 chunks (1,760 tokens) and the switch costs no
device memory. KernelModule gets launch_dynamic (cuFuncSetAttribute opt-in above 48 KiB) and device_geometry.

Identity is NOT bitwise, by design: the reduction order changes (WY chunking, f16x3 splits on mma.sync). Upstream first-token KL against the
sequential path: mean 0.0019, max 0.0125. The gates that decide are docs/quality-gate.md (first-token KL, q_tail_gate, logprob envelope) and
the harness gate 1e-4 (ignored GPU test gdn_tensor_core_scan_stays_within_the_gate_of_the_sequential_recurrence). Not run on a GPU here: no
parity, quality or speed result yet, no speedup claim.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:32:34 +01:00
Pavlo Ratushnyi 6bcc4742b1 Merge branch 'claude/verify-hc-down-microbench' into claude/speed-vs-strata-08143a 2026-11-09 23:26:48 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 aa2f237590 speed: kernel micro-benchmark of upstream gr_down_v3 (masks 0/5/133) against chain_gr_down_t2w8_nb4 (ledger U5)
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>
2026-11-09 23:26:26 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 997aaa5e77 pf_ab_job: variants DT/MC/MT/MCP/X/XT (draft trace, check merge, the group of host/draft switches)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:23:56 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c67912b501 pf_gputest_job: run GPU-ignored driver unit tests from a package test binary
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:21:18 +01:00
Pavlo Ratushnyi 7a4d225a42 Merge branch 'claude/draft-finite-check-merge-2' into claude/prefill-latency
# Conflicts:
#	crates/engine-qwen35-cuda/src/settings/serve.rs
#	crates/engine-qwen35-cuda/src/settings/serve_tests.rs
#	docs/experiments/step-ledger.md
2026-11-09 23:20:13 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 306b39807a draft: LELEKA_DRAFT_CHECK_MERGE (opt-in): adjacent finite and Q8_1 scale guards of a draft step launch as one batched guard
A draft step launches 48 numerical guards, one kernel per buffer. Runs of guards that are neighbours in the program (no kernel or copy between them) are launched as one mtp_original_check_batch at the position of the run: each entry keeps its own buffer, count, kind and status word, with the predicate and loop of mtp_original_finite / mtp_original_q8_guard, so the status words are the separate launches' words. 3 runs per step (5 prefix guards after the GR block, 5 tail guards after the MLP GR, 2 after the shared gate and up): 12 launches become 3. No guard moves across another command; nothing is removed.

New standalone sealed asset mtp_original_check_batch.cu/.ptx (extra-seal-plan.json entry, compile_assets.py + seal_pins.py with nvcc 13.2.86, sha pinned in mtp_original_full_symbols.rs), loaded only with the switch on; no existing sealed asset is touched. Pure planner and descriptor in cuda-model (draft_check_batch) with a simulated-step proof that a NaN/Inf placed in any checked buffer after any kernel leaves identical status words; driver tests on the real command lists; an ignored GPU test (batched against separate guards). Typed setting draft_check_merge, policy field check_merge, off by default. Identity, section delta and GPU proof pending; no speedup claim.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:19:32 +01:00