Commit Graph
488 Commits
Author SHA1 Message Date
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 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 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 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 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 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 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 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 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 506527bb9e Verify window: LELEKA_SM120_FUSED_QSA_PRELUDE (K/V rows and tail snapshot + indexer rows of a QSA layer as two launches, opt-in, off by default)
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>
2026-11-09 23:12:25 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 5b8c0eba0e Speed program: readable job names (queued stubs and dirs renamed, old->new table in the ledger), content labels on the touched ledger rows
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 21:54:38 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a199b3ad11 Speed program: S6/O11 plan (fused commit graph exists, to be measured and enabled), LELEKA_DRAFT_* allowed in profile engine_env, CF/CU CUPTI variants
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 21:16:33 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 35040ea9a6 Speed program: ledger V4a A/B (ab-sqe n=10, not significant, stays off), variant U for the set A/B
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 21:10:51 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d5fd270f81 Speed program: step ledger (every gap to vanilla per step of round and request), counts tool
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 15:05:58 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 92cffd3b97 Speed program: A/B variants for the side-stream parts (N, E, T and CUPTI CN/CE/CT), layer-phase and doorbell-latency analysis scripts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 15:02:21 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0c30105d42 Speed program: SIDE_MIXER QSA part (LELEKA_SM120_SIDE_QSA, experimental, off): indexer and query chains of each QSA layer on the two side streams
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 14:49:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a310533186 Speed program: CUPTI kernel-level comparison LEL against VANL (67k window): the gap is the missing parallel branches in the verify graph
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 14:36:19 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3ec79f9d98 Speed program: CUPTI kernel-window variants (ours CL, vanilla SPD_CUPTI) for the per-kernel comparison at 60-100k context
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 21:46:30 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 e7dde84ea9 Speed program: time-weighted hit-rate gap and gap by context from the real Codex sessions (ceiling of the hit-rate levers 1.8-2.6 % of task time)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 21:40:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 cac5802fe6 Speed program: spd_ab_job.sh takes SPD_BIN (a different binary for both arms)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 21:22:50 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 9d130fd380 Speed program decode misses: experimental LELEKA_ADAPT_TIE_SPREAD (equal-gain swaps share the per-round cap across layers), tests, variant X
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 21:20:18 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 53b1ed39bf Speed program: tier-policy screening variants W1-W4 and a complete unset list in spd_ab_job.sh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 20:50:11 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6d782b0e15 Speed program levers 3 and 5: job script leaked the variant variables (first R and H pairs invalid, reruns queued); small-tail prefill profile: 72-80 % is moe.ring
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 20:14:29 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 9c984ba74b Speed program lever 3: variant G opened the same 12192 slots (null experiment); variant H (reserves lowered) queued
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 14:49:37 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 743f742b32 Speed program levers 4 and 5: the 106k draft subset is already bound in the product; fixed per-request prefill cost from the profile lines; variants Q and R queued
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 14:37:32 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ede9542fd9 Speed program: per-request split of the real-session gap LEL vs VANL (no gateway cost: 85% decode, 16% prefill) and session_split.py
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 14:31:27 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b686f6ab75 STRA-338: rename the 854 mechanically named modules (impl_*, *_fn, *_<N>) after what they hold; mechanical_names census 854 -> 0
git mv of the files and of the module directories next to them, mod declarations, #[path] attributes and
the paths that name the modules, rewritten by scripts/dev/rename_mechanical.py from a reviewed name table.
Two files lost one to two lines so the 400-line limit holds again (qsa_prompt_index, original_verify_expert_probe).
limits-baseline.json: test fn_lines 0 -> 1 is --allow-increase for crates/deploy builtin_profiles.rs:149 (37 lines,
the speed-vs-strata session's file, not touched here); the prod params census falls 108 -> 1 (w_launch, extern C ABI).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 13:43:56 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8def0e96e2 STRA-338: scripts/dev/rename_mechanical.py plans and applies the rename of mechanically named modules
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 13:26:16 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 1e258fe469 Speed program: lever 7 gate on n=7 (not passed on rounds), lever 6 result (no gain), lever 3 A/B variant G queued
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:31:48 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 812b82ff7e Speed program lever 1: final 10-pair A/B (+1.85% decode) and the frozen-placement identity job
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 04:10:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 13f3adb482 Speed program: paired A/B tools (lossless sm_120 variant, output hashes, report) and lever 1 queued
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 04:10:44 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ac60df040f STRA-338: architecture gate forbids new mechanical file names (impl_*, *_fn, numbered), baseline lists the 964 existing; rustsplit names modules after what they hold
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 00:50:17 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 4b04c24981 STRA-338: limits gate gets the params metric (max 5 parameters, self counted): scanner, diff gate, census baseline, tests, doc
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 23:54:40 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d837d3f634 Merge claude/s24-cuda-model (S24: leleka-cuda-model crate); baselines for the new keys, one doc line wrapped
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 18:00:40 +01:00
Pavlo Ratushnyi 40896ba217 STRA-338 S24: peel the pure host-side models out of cuda-driver into leleka-cuda-model
New L1 crate crates/cuda-model (leleka-cuda-model, forbid(unsafe_code), depends on leleka-context only) holds:
Error/Result with Display, DenseFormat, RoutedFormat, ProjectionKind (+ layout/alignment/required_modes), ProjectionSpec,
the Bf16/Q5K/Q6K projection shapes, bringup_trace_enabled, and the modules serving_context, host_profile, command_profile,
original_mtp_loader, original_prefill_schedule, qsa_prompt_attention_select, original_expert_slots, native_flash_attn,
s_gemv_legacy, device_arena, mmq_original_prefill_misc (moved with git mv; code unchanged apart from pub visibility and
#[inline] on the tiny cached-switch readers, host_profile::add split into an inlined gate and a cold body).

leleka-cuda-driver re-exports every item at its old path, so no use path in the driver, engine-qwen35-cuda or
native-parity-bench changes. Tests moved with their modules; they read the .cu sources and oracle fixtures of the driver
through driver_source!; the one loader test that needs the driver's session geometry stays in the driver.

Housekeeping: workspace members/default-members, Cargo.lock, architecture.json (L1), hexagonal.md, ci-coverage.json,
check-local.sh, port.yml, linux-tests/run.sh, AGENTS.md. architecture-baseline.json: the source ratchets of the moved code
change crate key (dyn-trait driver 56 to 49 + model 3, env-read 72 to 67 + 5, process-global 110 to 99 + 11), regenerated
with --allow-increase for the new keys only; per-pattern totals do not rise. limits-baseline.json is unchanged: no moved
function is over a limit.
2026-11-07 17:40:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 bd18c91065 STRA-338: archcheck test_only_modules within the limits; limits census at zero
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 17:39:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 5ba57146ed STRA-338: deploy USAGE wide lines wrapped with string continuations (cooked bytes identical), archcheck python within the limits, baselines at zero
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 17:37:52 +01:00
Pavlo Ratushnyi 1a9ff645c6 STRA-338 size: limits-offenders.py --over lists every function over any limit 2026-11-06 23:37:13 +01:00