Commit Graph
594 Commits
Author SHA1 Message Date
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 22d7e9d824 prefill: the loan ladder (LELEKA_PREFILL_LOAN_TIERS=1) is on in the shipped 5090 profiles
Identity: chunk residual hashes equal (PREFILL-R, jobs id1-id4). Paired A/B n=10 on the sparse holder:
session TTFT sum -3.0 s +-0.3, median -104 ms per request, <= 2048 new tokens -154 ms (19 of 19 faster),
above 2048 tokens -10 ms. The engine default stays off; the profile allow-list accepts LELEKA_PREFILL_*.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 00:58:37 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f1175265cb ledger: job-name map for the Q7 identity and profile job
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 00:56:52 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2a1f2eccf9 ledger: Q7 status (code 7570247d9, wired behind LELEKA_DECODE_GRAPH_REUSE, identity and section delta pending on the GPU)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 00:50:24 +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 0e84729686 docs/experiments: driver side of the decode graph reuse (DeviceRef handles, park, rearm, reseed), ledger Q7
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>
2026-11-10 00:24:02 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a2f5854d72 Speed program: ledger rows of the merged verify switches -> fixing with job names
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:47:31 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 16dea5cb90 Speed program: ledger V3b, A/B ab-sqn (no regression, not significant alone)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:43:43 +01:00
Pavlo Ratushnyi c3ab38ce82 Merge branch 'claude/host-decode-graph-reuse-2' into claude/prefill-latency 2026-11-09 23:41:40 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0688595d4a ledger: Q7 status (code 278d67eeb; owner loan, protocol and fake scenarios in; waiting on the speed session's handles and park/rearm)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:41:26 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 278d67eeb7 decode graph reuse (Q7), part 2: QSA owner loan in the journal, HeldAssembly protocol (begin/end, drafter release on retire), re-arm scenarios on the lifecycle fake
OriginalVerifyQsaJournal keeps its owners as Option behind accessors; lend() hands the twelve index images and mapped journals to the prompt executor without dropping the journal (and so the graphs), take_back() accepts them only when every address the captured commands bind is unchanged (else the journal is failed for good and the owners go back to the caller). The pure loan state machine (owner_loan.rs) has unit tests that run without a GPU.

GraphReuse gets begin/end over a HeldAssembly trait (park, lend, take_back, rearm): the kept assembly is reused only for an equal key, owners at the same addresses and an accepted re-arm; anything else retires it after the MTP drafter's bindings are released, and the owners are never lost. DecodeResources implements the trait (owner loan real; park and rearm refuse until the verify bank has them, so nothing is kept and every request records as before). The lifecycle fake models the bank (generation, counters, wait flag, canonical image) and the owners, and the scenarios the real implementation must pass are in docs/experiments/decode-graph-reuse.md. Switch off: unchanged path. No speedup claim.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:41:02 +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 deed78f72b ledger: job-name map for the GDN tensor-core parity, logit gate and profile jobs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:38: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 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 42585e3455 ledger U1: LELEKA_PREFILL_GDN_TC is code (c5a8b7794), experimental/lossy; parity, quality gate and section delta pending
No speedup claim: nothing was run on a GPU. Identity is not bitwise by design; docs/quality-gate.md decides.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:32:43 +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 RatushnyiandClaude Sonnet 5.5 aaf14df80b Speed program: ledger U5, microbench queued
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:27:05 +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 d00ade5ed9 ledger: job-name map for the group A/B, check-merge proof and switches identity jobs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:24:16 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f252aa162c Speed program: ledger Q7 owner and plan (shared handle + re-arm API)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:22:05 +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 afbd38bfaf ledger: rows O8 and K13 for LELEKA_DRAFT_CHECK_MERGE (fixing, identity and section delta pending), job names
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:19:32 +01:00
Pavlo Ratushnyi a4a8d597fe Merge branch 'claude/host-decode-graph-reuse-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:17:14 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2e7658567d ledger: Q7 status (code 3e68def28, switch, identity and section delta pending)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:16:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3e68def28e decode graph reuse (Q7), part 1: LELEKA_DECODE_GRAPH_REUSE (off), key and policy tested on the lifecycle fake, shared-expert pin and weights epoch; assembly borrow and re-arm API documented as blocked
DecodeGraphKey (shape, tier, pcie mode, cluster top-k, weights and owners epochs) and GraphReuse hand a kept assembly out only for an equal key after Reusable::rearm accepted the new request's seed; anything else retires it and records. The lifecycle fake bakes key and seed into its graph set and fails a stale replay: kept and re-recorded sets give the same text, each key input forces a re-record, a refused re-arm and a failed request do not replay. MoeWeightCache gets pin_for_window / unpin_window / weights_epoch (not wired). With the switch on, open states that the stack cannot keep the graphs yet; every request records as before.

Not done: the assembly still borrows the stack (needs handles instead of &'a DeviceBuffer in original_verify_window_{moe,gr,proj,qsa}), the QSA owner loan and the MTP binding follow it, and the verify bank's re-arm API is the speed session's. Exact changes in docs/experiments/decode-graph-reuse.md. No speedup claim.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:16:19 +01:00
Pavlo Ratushnyi 009585f285 Merge branch 'claude/verify-qsa-fused-prelude' into claude/speed-vs-strata-08143a
# Conflicts:
#	crates/cuda-driver/src/original_verify_window_ops/original_verifier.rs
#	crates/cuda-driver/src/original_verify_window_sm120.rs
2026-11-09 23:13:12 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 595e34feb4 Docs: name the resolve function of the fused QSA prelude
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:12:29 +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 Ratushnyi 0c2314677c ledger: job-name map for the parking identity and profile job 2026-11-09 23:09:09 +01:00
Pavlo Ratushnyi 7a549b68e4 Merge branch 'claude/prefill-prefix-park-fast' into claude/prefill-latency
# Conflicts:
#	docs/experiments/step-ledger.md
2026-11-09 23:06:31 +01:00
Pavlo Ratushnyi 6b2a69f1d9 Merge branch 'claude/verify-accept-on-device' into claude/speed-vs-strata-08143a 2026-11-09 23:06:30 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3887d777d6 Speed program O7: LELEKA_SM120_ACCEPT_ON_DEVICE, the finite verdict of the head logits in the verify graph
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>
2026-11-09 23:05:51 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 e65cbe9149 ledger: row B3 fixing (code a88a77b25, LELEKA_PREFIX_PARK_FAST and LELEKA_PREFIX_PARK_ASYNC), the listed spans are nested
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:05:33 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 cca8f3cbab ledger U4/U5: proved-equal by the speed session's read-through
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:03:58 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 15fea581a7 ledger O7: timeline from verify end to the first draft kernel (CUPTI LEL vs VANL, PROFILE host spans)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 23:03:21 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 11bdb54666 prefill: the MMQ identity row table gets the stream-k fixup's over-read margin (ledger U3, upstream f225844d1); results unchanged
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 22:57:41 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 79a7d5ed05 ledger: upstream items U1-U5 (GDN tensor-core scan, batched PLE, MMQ row-table margin, flag B, adaptive-copy range) checked against our port
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 22:53:13 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 91a130da6a Speed program: ledger U5, retract the cross-kernel grid-y comparison (different row mapping)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 22:52:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 00d90124a9 Speed program: ledger U5, chain down kernel by window rows against vanilla
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 22:52:35 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6d61656177 Speed program: ledger section C2u (upstream cc 12.0 defaults: PDL, SMALL_UNR, GR_V3_PF) and the O7 correction
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 22:52:00 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 23f0ecb97d Speed program O7: trace of verify end to first draft kernel (ours and vanilla)
Vanilla's greedy accept is host-side (generate.cpp:15255); the difference to ours is the
post-drain finite-verdict scan (three syncs against one) and the host chain before the draft
launch. A device-side accept needs draft-chain edits; options and recommendation in the note.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 22:51:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 4130f9c366 decode graph reuse (Q7): design note; cause is ownership, needs a re-arm API in the verify bank
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 22:51:07 +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 7f2612cd42 ledger: rows of the host/prefill part labelled by meaning, queued jobs renamed (job-name map), vanilla probe removed
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 21:54:32 +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 a838d0abe7 Speed program: SIDE_QSA and SIDE_SHARED on by default in the 5090 profiles; ledger V3a/V3b/V4a/V4/S3 fixed (section delta + identity)
Owner method: a step closes on a measured section delta plus identity; the set A/B (spd-sqa, M against M+QSA+shared) checks the set for regression.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 21:14:37 +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 4c8919610a Speed program: ledger V3b/V4a/V4 section deltas from the CE/CN/CT windows (spd-sqw)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 20:13:02 +01:00