Commit Graph
25 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 a1c5e352f9 Normalize line endings: convert 10 CRLF files back to LF, add narrow .gitattributes
Ten files touched by this branch had been rewritten with CRLF line endings
(base versions are LF), inflating the diff against the merge-base to
13685/13039 lines. Content is otherwise unchanged: the diff ignoring line
endings was and remains 661 insertions / 15 deletions.

.gitattributes: crates/**/*.rs and scripts/gpu-bringup/**/*.py are text=auto
eol=lf, so CRLF cannot re-enter these LF files at commit time. text=auto leaves
files that are already CRLF in the index untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 08:51:22 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6af628aa2a gpu-bringup: refuse PTX built by nvcc 13.2.0/13.2.1 (V13.2.0, V13.2.1, V13.2.51)
CUDA 13.2.0/13.2.1 miscompile some sm_120 kernels (IQ2_S/IQ3_S products wrong). validate_ptx (used by compile_assets and seal_pins) now reads the nvcc build from the PTX header and rejects those builds. A tree-wide test checks that every sealed PTX names a good build (today: none bad).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:25:46 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0765a20958 sm120 decode switch GU_SWIGLU: fused expert gate/up + SwiGLU + q8_1 (upstream native_gu_swiglu_kernel) in the verify window (default on for cc 12.0)
Replaces window_moe_gu_<T> + swiglu_entries_kernel + quantize_q8_1_kernel of every routed-expert group launch (VRAM and PCIe tier) by one launch of upstream's
native_gu_swiglu_kernel (16-lane sub-warp rows, gate and up row at once) for the gate/up types 16 17 18 21 22 23 at n_embd 2560, n_ff % 32 == 0; every other
format keeps the three-kernel plan. New sealed asset sm120_gu_swiglu.cu (group sm120-decode) textually includes sm120_iq_prefix.cuh, the pinned
iq_kernels.cu up to the dequant banner (generated and checked by scripts/decode-sm120/make_iq_prefix.py; the whole file would instantiate 24 MB of PTX).
Kernel parameter: upstream's 88-byte NativeExpertLayout (the window's 64 bytes + tail_off, had_block, d_signs = 0).

Switch: policy.gu_swiglu, resolved at window recording from the card (cc 12.0), LELEKA_SM120_PERF=0 and LELEKA_SM120_GU_SWIGLU=0|1.

Model-free probe (tools/decode-sm120/sm120_probe.cpp gu, RTX 5090): the q8_1 blocks the down kernel reads are byte-identical to the old three-kernel path in
30 cases (types 16 17 18 21 22 23, 1-8 rows, 1-40 groups, 1-7 entries a group, random blobs with valid block scales); per layer at 4 rows 20.9 -> 14.2 us (16),
29.8 -> 20.7 us (18), 24.9 -> 19.6 us (21), warm L2. Types 29 and 42 are not probed and not routed to the new kernel. Not yet measured end to end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 01:20:32 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0ca709cad1 sm120 decode switch ATTN_DAILY: upstream pre75 attention chunk + merge v2 in the verify window (default on for cc 12.0)
Ports engine/strata qsa_decode_attn.cu attn_chunk_kernel_pre75<mode 1, NC 2> and attn_merge_v2_kernel<16> as sm120_attn_daily.cu (new sealed asset,
group sm120-decode) and selects them in QsaWindow::decode_attention when policy.qsa.attn_daily is set. The policy bit is resolved at window recording
from the card (cc 12.0), LELEKA_SM120_PERF=0 (whole set off) and LELEKA_SM120_ATTN_DAILY=0|1 (wins in both directions, any card).

Model-free probe tools/decode-sm120/sm120_probe.cpp on the RTX 5090: chunk partials, merge(old) of both partial sets and merge_v2 are byte-identical to
the sealed Original kernels on 66 cases (T 1,2,4,5,6,8 x n_ids 2051..0, masked pages, two score ranges). Per call at T=4: chunk 29.8 -> 20.3 us,
merge 6.5 -> 2.9 us (warm L2, graph-timed); 12 QSA layers per window. Not yet measured end to end.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 01:07:31 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 4ace54b773 cuda-driver: wide top-k for long prompt tiles and a decode top-k on a thread-block cluster (upstream 586367cb, d05d26e9, row 2.5), both opt-in
leleka_qsa_topk_wide (also _sample/_wide_failed, measured and not used) in qsa_late.cu; leleka_qsa_topk_cluster in the new sealed asset qsa_cluster.cu (sm_90+,
no sm_86 companion); cuLaunchKernelEx plumbing for KernelModule and the verifier window (Launch.cluster); policy.qsa.cluster_topk. Same ids as qsa_topk_ref in
every model-free case (continuous, heavy tailed, tied, all equal; prompt tiles of 256 rows and decode calls of 1..5 rows up to 261,500 tokens).
LELEKA_QSA_TOPK=wide (prompt, from 10,000 blocks) and LELEKA_QSA_CLUSTER=1 (decode window) switch them on; defaults off until their R gate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:52:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 13c342eef7 gpu-bringup: reseal_own.py re-seals one of our own already-sealed PTX assets after its .cu changed (seal_pins.py refuses a pinned asset)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 08:52:14 +01:00
Pavlo Ratushnyi 21ed9fd0d9 qsa-late: faster prompt QSA selection kernels for long positions (imported from the claude/qsa-late worktree), sm86 guard, seal-plan entry 2026-10-25 11:59:30 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ffbb440fc8 feat(chain): latency-hoisted bit-identical window kernels (plan copy, CPU rows, doorbell, GDN ab, GR norm/up, QSA chunk) behind LELEKA_CHAIN, probe tooling
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 00:49:14 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c0190bdb6d feat(cuda-driver): sealed prefill_stage PTX (chunk-wide PLE decode, embedding broadcast, GR/GDN kernels with folded guards, element-parallel dequant)
New precise-recipe asset (extra-seal-plan group prefill-stage, nvcc 13.2.86), sealed with compile_assets.py/seal_pins.py, with its sm_86 companion.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 02:04:42 +02:00
Pavlo RatushnyiandClaude Opus 5.5 2262072206 merge: claude/kv-streaming into the bring-up branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 10:56:28 +02:00
Pavlo RatushnyiandClaude Opus 5.5 6917f7c704 chore(bring-up): register the KV GPU proofs in the qsa smoke group and regenerate the smoke table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 10:54:29 +02:00
Pavlo RatushnyiandClaude Opus 5.5 0103ee90aa feat(kv): per-owner resident KV window for the streamed QSA layers (kv_stream n_slots)
The resolver PTX baked 8192 resident pages (--kv-resident 32768). Port the
Original's KvStreamMap::n_slots: leleka_qsa_resolve and leleka_qsa_stream_reset
take n_slots (resealed with nvcc 13.2.86, sm_120, precise flags; digests in the
window asset, the window seal plan and the ptx_abi test). Every streamed owner
sizes its resident runs and resolver state from the process-wide window
(configure_kv_resident, default 32768 cells = the previous behaviour) and
launches with its own slot count; the verify window carries it in its KV
binding. leleka-context: resident_pages_for (layer.cpp kv_plan rule),
resident_runs, stream_map_bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 10:34:33 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b625aa2fc8 regress_3080.sh: read commits from a Windows git worktree under WSL
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 10:14:07 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 6173c2d309 gpu-bringup: regress_3080.sh, one-command model-free regression of a commit on the sm_86 card
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 10:04:12 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c8a0f602fa sm86: document the companion set and the RTX 3080 smoke results, add offline tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 02:09:58 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 eb674cef0a sm86: drop cvta.to.shared on already-shared addresses in three hand-written PTX
bf16_f32_mmvf, gr_fixed and gr_batch_preview do mov.u64 R, shared_sym followed by
cvta.to.shared.u64 R, R. sm_120 tolerates it, sm_86 faults (CUDA error 700 in
full_matrix_transport_gpu dense-bf16-gdn-z on the RTX 3080 Laptop). The sm_86
companions omit the cvta; sealed sm_120 files are untouched; verified by the
smoke passing after the change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 01:59:52 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 1884e4ab5f cuda-driver: sm86 feature swaps the sm_86 companion in at module-load time
Default build unchanged (arch_ptx::image is the identity without the feature,
sm_120 PTX and all pins untouched). With --features sm86 every cuModuleLoadData
site hands its sealed image to arch_ptx::image, which on a device with
8.6 <= cc < 12.0 looks the image up by the SHA-256 of the sealed sm_120 body in
the generated table and admits the companion only through sealed_ptx::pinned.
The four sm_120-only capability gates (MMQ resident, scalar/full/prefill MTP)
accept sm_86-class devices under the feature. leleka-runtime and
strata-desktop-core forward the feature. run_gpu_smokes.sh: SMOKE_SM86=1 adds
it to the test builds.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 01:56:23 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 676457bf8f sm86: tool that derives sm_86 companions of the sealed sm_120 PTX
scripts/gpu-bringup/sm86_assets.py: survey / infer / build / compare / check.
Default method is retarget (the sealed text with the .target line and two
documented sm_90+ rules edited, accepted only if ptxas -arch=sm_86 accepts it);
recompile from the .cu is the fallback and needs a recipe verified by a round
trip on sm_120. sm86-recipes.json is the round-trip evidence.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 01:54:12 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 b8daf8fe9b gpu-bringup: accept PTX ISA 9.1/9.2 (CUDA 13.1/13.2)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 18:21:13 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 88482263e3 build: pin CUDA toolkit to 13.2.2 (nvcc 13.2.86) matching the host driver (CUDA 13.2); bootstrap reads release from the lock; group closed-kernel smokes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 18:16:42 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 4a640498aa feat(serve): pin-gated PTX assets for native head, sampler and MTP session rope (replace Option::None constants); seal-plan entries and tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:03:42 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 90d3433da4 feat(gpu-bringup): mandatory fast-math reseal of six PTX, flag overrides, PTX ISA/driver precheck
Rust port / port-typecheck (push) Failing after 7s
Rust port / port-fast (push) Failing after 7s
Rust port / port-oracles (push) Failing after 9s
Rust port / port-linux-tests (push) Failing after 32s
Adds the six audited assets (head_native, original_verify_qsa, router, gr_post,
gr_norm, ple_native_batch) as an atomic reseal group built with --use_fast_math,
re-pins their old digests (incl. ple PTX_BYTES) and window-plan hex, and a
generic --flag-override recorded in the manifest and re-applied by the sealer.
compile_assets --isa-inventory/--driver-check and run_gpu_smokes.sh refuse a
driver older than the highest PTX ISA in the tree (9.0 needs >= 580.65.06).
Runbook: mandatory reseal + golden comparison section, step d' (linux-tests).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 17:00:26 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 9189e236e3 feat(gpu-bringup): remote_sync tests, toolkit tests, plan seal slots, doc runbook
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:54:39 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 55b16be9fd feat(gpu-bringup): smoke inventory + runner, remote sync, host sanity and env recording
smoke_inventory.py scans every real #[ignore] attribute, extracts the enabling
LELEKA_* flags and values, classifies tests (device / assets / mock) and assigns
them to dependency-ordered groups (smoke-groups.json). run_gpu_smokes.sh runs
them in order, stops a group at its first failure, skips dependents, continues
independent groups, treats a filter that matches nothing as a failure, records
nvidia-smi before/after, refuses a busy GPU and never starts a model run
without --allow-model-runs plus caller-supplied env. remote_sync.sh mirrors the
tree (no --delete, refuses to clobber unpulled sealed files) and builds the
three binaries and the test binaries on the host; host_sanity.sh is read-only;
record_env.sh captures hardware/software/model digests for the ledger.
Tested with stub cargo/nvidia-smi, shellcheck and a Linux container.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:54:39 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 671be9c786 feat(gpu-bringup): compile_assets/seal_pins toolkit for the Linux nvcc session
compile_assets.py reads docs/cuda-seal-plan*.json (assets and new_sources
formats), an extra plan for assets no plan covers, and the four rope PTX list
of docs/rope-and-memory-plan.md; verifies .cu pins, runs nvcc with the exact
flags (fast-math policy lint, rope flag variants), validates exports and ABI
parameter counts, and writes PTX + build-manifest.json outside the tree.
seal_pins.py installs the PTX in the encoding each consumer expects and patches
every pin form (PtxPin arrays/structs, AssetSpec.sha, Option tuple arrays,
plain len/sha consts, re-pins of regenerated rope PTX, ptx_abi test) with
exactly one replacement per field and a read-back check. fake-nvcc and a
unittest suite exercise the pipeline on macOS; no GPU, no generated PTX.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-14 16:54:39 +02:00