Commit Graph
1067 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 b5d5b24faa decode: a verifier graph that runs out of device memory costs the widest windows, not the engine
cuGraphInstantiateWithFlags answering out of memory used to poison the whole CUDA context (every call after it failed, so the engine was lost; upstream a8c1d4b7 / 2a9a67c1). The refusal is not sticky and changes no state, so now:
- the instantiate step does not poison the context on that one code (every other failure still does), the half-built graph is destroyed, and a line is logged;
- a failed cuGraphUpload (a warm-up) is skipped with a line;
- OriginalVerifier::record_all names the graph that did not fit (Error::GraphOutOfMemory { window }, 0 = commit graph);
- the serve stack repeats the assembly with the windows that fit (assemble_with_window_fallback; owners come back from each failure), logs each step, and narrows the settings, controllers and MTP draft cap of every arm to the window it ended with, for the later requests too. No cap below T=2: a failure with nothing left is returned as before, but with the context intact.
Test hook for a card with room: LELEKA_TEST_WINDOW_INSTANTIATE_OOM_AT=N fails the N-th window instantiation once.

CPU tests: poison decision, error classification, cap computation, retry loop (terminates, stops at the floor, no retry on other errors), settings cap. Not verified on a GPU.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:33:18 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 58305a193d cuda-driver: guard that chain_swiglu_quant_kernel divides like the pair it replaces (q8_1 division flavour)
Read-only analysis of the sealed PTX (sm_120 and sm_86): the fused kernel and swiglu_entries_kernel + quantize_q8_1_kernel of mtp_original_full_head_iq (the window's routed-expert path) all use div.rn.f32; the fast-math quantizer copies (native_head_iq / native_head_native, div.approx.ftz.f32) are not used for this pair. CPU tests compare the numeric instruction multiset, flavour for flavour, and check a fast-math quantizer would be flagged. No kernel changed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:25:46 +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 7d0166258d residency: LELEKA_ADAPT_DECAY outside 0..1 falls back to 0.7 with a logged line
Above 1 the usage counts grow without end (inf after a few hundred adaptations) and swap gains turn NaN, which breaks the swap sort; below 0 the counts flip sign (upstream 4a7e373d). Experiment knob only; the default is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-30 03:21:18 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 e92513b722 docs: deletable files go to garbage/ inside the work folder
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 17:29:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 1df52575f3 docs: server work folder is ~/work/leleka (symlink to /data/leleka-e2e)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 17:27:42 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 47ec9fddeb docs: one folder per machine, read-only outside it
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 17:27:23 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 1b8d61e59b docs: measurement inputs must live in one named, frozen, digest-recorded place
A removed unowned folder turned the 245k corpus into a ~300-token session
without any error; inputs are now frozen, hashed and checked at run start.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 17:18:13 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b63a91b2fa deploy: rtx5090-32g gpu_budget_bytes 30 GiB -> 32,819,404,800 (31,299 MiB) so the dense-slab slot gain reaches the product
Needed for the slot gain: the slabs save physical bytes the Context never charged, so the
budget must rise by about that much. Smoke with this budget: ~11,568 slots, lowest free VRAM
1,035 MiB. Also the systemd unit template, the config and reconfigure tests, and the docs.
Preflight now needs 31,299 MiB free at start (was 30,720; idle 5090 reports 32,110).
Revert by restoring 32212254720. Owner confirmation required before merge.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 11:59:55 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 7717961a51 scripts: speed-train3 paired A/B (budget 31,300 MiB, RUN_TAG, optional reserve-130 arm) and fixed-slot identity job for the combined branch with the slots-footprint planner fix
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 11:12:56 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 83df1cfa7f Merge claude/slots-footprint (eef6f598, planner fix) into speed-train3
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 11:12:30 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 eef6f598b4 decode reserve back to 300 MiB (130 stays opt-in), A/B job: budget 31,300 MiB, RUN_TAG, slots-res130 arm; docs: the failed first A/B and its fix
The reserve cut was not the cause (the budget was) but it is unproven on the card; per the conservative rule only the slab ships by default. The job runs
both arms with E2E_GPU_BUDGET 31,300 MiB (the slab's savings need budget headroom; the base is card-bound at either value) and RUN_TAG lets a rerun sit beside the
earlier run directories.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 11:07:46 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6e58e77548 expert cache planner: size against min(card free, Context budget - allocated), reserve kept under both (fixes BudgetExceeded at the first chunk)
First slots-footprint A/B (7823672f): every request failed in layer 27 with BudgetExceeded. The Context charges requested bytes against its budget (30 GiB);
the dense slabs saved 540 MiB of driver rounding that the budget never counted, and the planner sized the cache from the card's free VRAM alone, so the
cache (22,765 MiB) left only 305 MiB of budget for the lazily allocated first-chunk buffers and the verifier. usable_room() = min(card free, budget -
allocated) now feeds the auto count, the per-layer and profile caps and the post-open shrink loop; the reserve is subtracted from it. Base behaviour is
unchanged (card and budget coincided to 1 MiB). Tests pin the arithmetic with the failed run's numbers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 11:07:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 22dadc3c9c scripts: speed-train2 paired A/B (speed-train, speed-train2, vanilla; seed off) and the fixed-slot static-tier logprob identity job
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:37:27 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f762fc5502 Merge claude/draft-tail into speed-train2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:36:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2d38ffb1c5 Merge claude/slots-footprint into speed-train2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:36:01 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d6ec7710e4 docs: 5090 per-round budget of the MTP draft and the host tail, the four lossless reductions, jobs and what is not verified
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:33:42 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 5326e634af docs: vram footprint page names the alias commit
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:29:21 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2132886807 scripts: draft-tail paired A/B (speed-train against draft-tail, seed off, per-round host budget in the summary) and the logprob identity job
drafttail-ab.sh is speedtrain-ab.sh with the two ours arms speedtrain-noseed / drafttail-noseed (optional drafttail-ac-noseed =
LELEKA_SERVE_DRAFT_AFTER_COMMIT=on for attribution, v-def for vanilla in the same session), alternating, and a summary that prints the
adjacent-pair differences and the per-round ms budget from the DBG profile lines. drafttail-id.sh is dt-id2.sh with rt-speedtrain
against rt-drafttail (+ the same binary with the draft waiting for the commit): bitwise q_pair identity of the teacher-forced top-16 logprobs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:28:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c2198a7b9c kar ple cache: persistent staging buffers for the scatter's update records instead of a cuMemAlloc and cuMemFree per token
`KarPleCache::gather` (one decode token: 16 rows) allocated a device buffer for the update records of its misses, copied into it, ran
the scatter and freed the buffer on every call. cuMemFree also waits for the whole device. With ple.device at 0.046 ms per call and
2.5 calls per round (speedtrain-ab spans) the allocation pair is a measurable part of a 0.116 ms per round span that runs before every
window launch. The cache now owns sixteen buffers, `scratch[k - 1]` of `k * 56` bytes, because the scatter's layout names the exact
byte length of its update block (a single 16-record buffer would be refused for fewer misses).

Output identity argument: the same bytes are copied into a device buffer of the same length before the same kernel call with the same
count; the kernel and the decode that follows are unchanged, and every `kar_ple_*` launch is followed by a context synchronize
(`execute`), so a reused buffer is never overwritten while the scatter reads it. The decoded rows depend only on the packets.

Test: the staging sizes are the record sizes the layout and `gather` use (CPU). Not run on a GPU: covered by the replay identity job.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:25:16 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 7823672f04 docs+scripts: VRAM footprint account (ours vs vanilla), slots-footprint A/B job and static-tier identity job
docs/experiments/vram-footprint-5090.md: stage-by-stage account from the speedtrain-ab logs (882 MiB of the 2.27 GiB gap is driver rounding, 324 MiB a second token
table, ~1 GiB the prompt/MoE/MTP side), the three reductions with estimated slots, the candidates not done, what is not verified.
slots-footprint-ab.sh: base-noseed vs slots-noseed (and the alias arm, and a short ledger arm), 100 ms card sampler, FOOTPRINT.txt per run.
slots-id.sh: replay with a static tier and an equal fixed slot count; the footprint changes must not move a logit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:21:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 521bfc91d5 prompt path: optional alias of the token table onto the native embedding's mapped host copy (EXPERIMENTAL, LELEKA_PROMPT_EMBED_ALIAS=1; -324 MiB VRAM, -322 MiB pinned RAM)
OriginalPromptEmbedding::load and OriginalNativeOutput::load(.., true) both stream the GGUF TokenEmbedding tensor (IQ4_XS, 248,320 rows of 1,360 B):
the first uploads a 324 MiB copy to VRAM for the prompt path and the MTP prefill, the second keeps the same bytes in a pinned host mapping that the
decode gather reads over PCIe. Vanilla keeps one (mapped). With the switch on, OriginalNativeEmbed::table_alias() hands the prompt path a borrowed
DeviceBuffer over that mapping (not charged, frees nothing), the native head and embedding open first, and the stack closes the prompt table before
the native embedding it aliases.

Off by default: the drafter gathers a row per draft step over PCIe beside the expert staging traffic and the effect on decode is unmeasured; the
A/B job has an arm for it and slots-id.sh a bitwise-identity arm. Tests: the switch is opt-in; a CUDA test of a borrowed alias over a cuMemHostAlloc
block (reads the host bytes, costs no device memory, survives drop; passes on the RTX 3080 laptop); an sm_120-only test of table_alias itself
(ignored, for the server).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:21:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8735bbc5d5 kar ple: a decode token reads its 16 rows on the calling thread when the archive answers from memory (8 threads otherwise, as before)
`VerifiedKarPleArtifact::read_rows` (one token's 16 rows, 48 positional reads) started and joined eight scoped threads on every call.
The speedtrain-ab spans show ple.read_rows at 0.119 ms per call and 2.1 calls per round (0.25 ms of a 15.0 ms round, before the window
launches), while a memory-served pread of 10-20 bytes takes about a microsecond. The call now reads the first row itself and times
it: at 20 us or less (a row is three reads) the other fifteen rows are read on the same thread; slower means the file waits for a
device, and the previous eight-thread read runs, with the next 256 calls skipping the probe so a cold archive pays one probe per 256
tokens at most. The prefill's batch and read-ahead paths are untouched.

Output identity argument: the same `read_rows_chunk` reads the same offsets into the same packet slots in every path, with the same
bounds, length and non-finite-scale refusals; only the number of threads differs. The test reads random rows of a two-partition
synthetic file through the probing, the post-cold-verdict parallel and the non-probing paths and compares every packet with the
single-thread reference, plus the refusals (row outside the table, changed archive length, row beyond the partitions).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:20:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2f267df973 serve: the per-round checks over the whole token history examine only the tokens appended since the last round
Five passes over up to 262,144 i32 ran on the host every round: the controller's validate_current and the ledger's begin_window each
compared `committed` with `consumed`, with_sampling authenticated them twice more and range-checked the whole tail, after_verified
range-checked `consumed` once more. In the speedtrain-ab spans the host work outside the GPU grows linearly with the context:
window.sampling_setup 0.021 ms at 45k to 0.112 ms at 247k, the un-spanned part of verify_commit 0.038 to 0.098 ms, of finish_round
0.024 to 0.068 ms (about 0.19 ms per round at 247k, 1.3 % of a round, all of it before a launch or after a read-back).

`token_memo::PrefixMemo` remembers (address, length, first/middle/last token, criterion) of the buffer a check last passed over; the
next check starts at that length, and every 32nd use examines everything again. `consumed` (reserved at the request's start) and
`committed` only ever grow within a request, so a pass over the first n tokens stays true for them. Ledger, penalty history and
controller each own a memo; a request has its own ledger and controller request, so nothing carries across requests.

Output identity argument: these are assertions between two host copies of the same tokens. A passing check is the same answer as
before; a new token that differs, a different length, another buffer or a rewritten first/middle/last token fails exactly as before;
a rewrite of any other old token, which no owner can do (both vectors are append-only inside their owner), would be reported up to
32 rounds later instead of at once. Nothing the GPU runs reads these results.

Tests: token_memo (tail-only examination, address/length/criterion/probe reset, periodic full pass, random growth against the slice
comparison), ledger (100 rounds of growth, newest-token mismatch, length mismatch, rewritten old token found within FULL_EVERY, copy
at another address), the existing controller/engine suites (99 tests) pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:20:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3cf185a34a serve: the MTP draft stream no longer waits for the verifier's commit event (upstream's order); LELEKA_SERVE_DRAFT_AFTER_COMMIT=on restores the wait
Upstream enqueues the commit graph on the verifier's stream and launches the draft round graph on the drafter's own stream with no
dependency between them (core/verify.cpp set_commit_async: "the drafter (its own stream) reads only this window's final rows and its
own K/V"). The port made the draft stream wait the commit event on the device, so the commit graph (36 GDN layers, 12 QSA appends, the
PLE history; the host sees ~0.36 ms from enqueue to event) ran in front of every draft's first graph. With the 5090 spans of
speedtrain-ab (draft_committed 1.66 ms = launch 0.03 + deferred adapt 0.08 + commit.wait 0.25 + publish 0.12 + finish 1.18) the commit
is on the critical path of every round; running it beside the draft is worth up to its length per round (estimate 0.2-0.35 ms of a
15.0 ms round, not measured).

Output identity argument: the draft reads the completed window's final residual rows (verifier arena span "R"), the head ids staged in
its own mapped block, its own MTP ring and weights; it writes its own scratch, ring and mapped outputs. The commit graph reads the
window intermediates (qkv_L, h_L, gate_L, beta_L, z), writes the canonical GDN state, the QSA index images, the PLE history and the
"commit" span (verify_gdn_conv_commit_kernel, verify_gdn_step_norm_multi_kernel, verify_qsa_append_*, verify_copy_*). No span is
written by one graph and read or written by the other; neither module declares a device global. Host-side publication already ran
beside the draft's first graph, and the next window still starts only after both the commit event and the draft read-back.
The decoded ids cannot depend on which of two independent graphs ends first.

Not run on a GPU. Gate: replay logprob identity (rt-speedtrain against rt-draft-tail) and the paired A/B of scripts/e2e/decode/drafttail-ab.sh.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:20:17 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 981c7aad42 expert tier: decode reserve 300 -> 130 MiB (free VRAM at decode 563 -> 316 MiB, vanilla runs down to 315; about +90 slots)
5090, 5 x 245k session (runs/speedtrain-ab): the per-request verifier assembly takes 514 MiB (1,077 MiB free after the expert cache, 563 after),
and nvidia-smi at 10 s shows the card never had less than 563 MiB free in any turn, while vanilla Strata 0.2.6 starts with 389 MiB and
captures its windows down to 315 MiB. 700 + 130 - 514 = 316 MiB keeps the same floor. ExpertTierConfig::decode_headroom_mib() states that
arithmetic, a startup warning fires when an auto-sized configuration leaves less, and the default is pinned by a test. Laptop profiles
set their own DECODE_RESERVE_MIB (1024) and are untouched.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:16:14 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8c9748a301 dense weights: pack the ~700 resident weight buffers into 64 MiB slabs (-688 MiB measured rounding, about +300 expert slots)
The driver rounds every cuMemAlloc above 1 MiB up to a multiple of 2 MiB (laptop probe: 3 MiB takes 4 MiB, 2.5 MiB takes 4 MiB; the 5090
token table: 322.1 MiB takes 324 MiB). The dense-weights stage of the 5090 load ledger asked for 3,890 MiB and the driver took 4,578: 688 MiB
of rounding across ~700 matrices of 0.5-10 MiB (the 48 routers of 2.5 MiB alone lose 72 MiB). The parity audit listed it as "unaccounted".

SlabAllocator packs requests of up to 16 MiB first-fit into 64 MiB slabs (a multiple of the granule), 512-byte aligned (cuMemAlloc
guarantees 256); larger ones keep their own allocation. A DeviceSlice derefs to the ordinary &DeviceBuffer every kernel entry point takes, so
no kernel code, byte, or arithmetic changes: only buffer addresses move. DeviceBuffer gets a `borrowed` flag (an alias frees nothing and is
not charged) which the view uses; the new id-less tests pin the placement (aligned, non-overlapping, in-slab, hole filling, direct limit),
the dense mix saves the rounding in a model, and a CUDA test (ignored by default, passes on the RTX 3080 laptop) reads every view back and
checks neighbours stay intact and the context is charged only the slab.

LELEKA_DENSE_SLAB=0 restores one allocation per weight (A/B arm, rollback). The dense stage prints one summary line.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:16:13 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 bea07c3d64 vram: per-call-site device allocation ledger (LELEKA_VRAM_LEDGER=1) and a free-VRAM low-water mark
The fixed VRAM footprint of ours is 2.1-2.3 GiB above vanilla's and the load ledger could not say where: the dense-weights stage shows
4,578 MiB taken for 3,890 MiB accounted. LELEKA_VRAM_LEDGER=1 records every Context::allocate by call site (innermost workspace frames of a
backtrace), removes it on free, and prints at each `vram_note` the sites that changed since the previous note, with the bytes the driver is
estimated to reserve (allocations above 1 MiB rounded up to 2 MiB, packed below, as probed on the WDDM laptop and as the 5090 token table
shows: 322.1 MiB takes 324 MiB). Off by default; the off cost is one cached bool per allocation.

`DBG vram` lines now carry the lowest free VRAM seen so far, and a new note "decode end before disassemble" reads the card after the graph
pools and every window are captured: the real low-water mark of a request, for sizing the reserve.

scripts/dev/alloc-granularity-probe.py is the offline ctypes probe of the driver's rounding.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:14:22 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 fcb4f02ba9 deploy: RTX 5090 profile sets LELEKA_ORIGINAL_SERVE_SEED=off (placement class, owner confirmation required)
Seed OFF is a profile setting only: the engine default (seed on) and the laptop profile are unchanged. Placement-class change, NOT bit-identical; it does not fit the strict Original
envelope (p99 <= 0.22, max <= 0.43) and neither does the control; it meets the relative criterion on 1,717 teacher-forced rows (p99 0.2500 vs control 0.2278, max 0.7567 vs 0.6751,
flips 2.10 % vs 2.59 %; limits 1.5x control and 2.8 %). Gain: 108.1 -> 137.2 tok/s decode over turns 1-4 of the frozen 245k session (3 runs per arm). Revert: remove the key or set
LELEKA_ORIGINAL_SERVE_SEED=on in the operator environment. Test: only_the_server_profile_turns_the_prompt_routing_seed_off; leleka-deploy tests 125 passed in WSL.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 10:09:44 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 47d2d38976 scripts: speed-train paired A/B job (ours seed on/off against vanilla, frozen corpus, validity checks incl. turn-5 PLE)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:30:27 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 21401dd759 docs: decode-gap pages carry a note that their old-corpus numbers are unpaired and superseded
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:28:51 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a741f8e54e sm120: ATTN_DAILY and GU_SWIGLU default off (opt-in); paired e2e A/B showed no measurable gain
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:28:28 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 47707480d0 Normalize line endings to LF in files the decode-tail/sm120 branches had converted to CRLF (whitespace only)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:27:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 463a432a9c Merge claude/stra-258 into speed-train
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:26:42 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0bfb81d4ff Merge claude/agents-workspace-layout into speed-train
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:26:42 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 4a35f39889 Merge claude/parity-audit into speed-train
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:26:41 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 94af186c8c Merge claude/fix-batch-326-329 into speed-train
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:26:40 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 046e15fea2 Merge claude/decode-sm120-switches into speed-train
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:26:40 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a57aa5d50d Merge claude/ple-stall into speed-train
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:26:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6fae7233ae Merge claude/decode-tail into speed-train
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 08:26:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 589ed7d1e3 scripts/decode-sm120: replay job runs a one-request smoke first and aborts if it fails
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 03:38:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 bfb8bbe2ee docs: 5090 decode at 247k, seed, placeholder profile and the PLE row-cache scan (STRA-245 decode gap, first draft)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 03:27:36 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a73d090601 kar ple cache: evict from a recency queue instead of scanning the whole row map (turn-5 decode stall)
Once the 1,048,576-slot device row cache is full, KarPleCache::gather picked the victim of every missed row with a scan of all
entries (filter + min_by_key), and assign_slots collected every entry into a Vec per prompt chunk. A decode token with a new trigram
misses its 8 trigram-head rows (input_hash::rows), so it cost 8 full scans: ~53 ms per such token in window.ple at turn 5 of the
245k session (the cache fills only then), against 0.14 ms before.

Residents keeps the row map plus a queue of (age, row) items, pushed at every age change and valid while the map still holds the
row at that age. oldest() reads the front of the queue: O(victims + skipped), with the full scan only as the fallback when the
queue gives fewer rows than asked (the caller then refuses the chunk, as before). The planning and publishing of a gather are now
the pure functions plan_gather/publish_gather so the tests drive the production code.

The cache only decides which slot holds which row, so the decoded values are unchanged. Tests: gather victims, slots and final state
equal to the scan implementation on random sequences (4 cache sizes, 6000 gathers each, every gathered row is its own row); chunks
and gathers interleaved keep every row in its own slot and every victim among the oldest untouched rows; eviction in a full cache of
200,000 rows examines <= 40 items per miss (the scan: 200,000); the queue stays bounded.
Measured (laptop, release, full 1,048,576-row cache): old scan 7.3 ms per missed row, queue 61 ns (ignored timing probe).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 03:27:11 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8713ccd7b2 scripts/decode-sm120: replay job sets the explicit replay opt-in
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 03:27:08 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6fd2e897d2 kar ple cache: profile spans around the archive read and the device scatter/decode
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 03:14:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d6aee34af4 sm120 ATTN_DAILY for the MTP draft step: opt-in LELEKA_SM120_ATTN_DAILY_MTP=1 (default off, not run on the GPU yet)
The draft step attends over the 32,768-cell MTP window (512 chunks, one query): with the opt-in, the Original chunk kernel and chain_qsa_decode_merge_n of that
step become sm120_attn_daily.ptx's leleka_qsa_decode_chunk_daily / leleka_qsa_decode_merge_v2 (module slot 22 after the chain slot; the window_ids pre-launch
keys on the new chunk entry too). sm120_probe `attn512` byte-compares the pair against the Original on the draft shape and times them; it has not been run
yet (no GPU slot), so the switch stays default off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 03:04:43 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 7636ec5d91 scripts/decode-sm120: trimmed jobs (e2e: base1 all1 all2 base2, seed off, no CUPTI by default; replay: two processes, side optional)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 03:00:32 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 321c233539 sm120 switches: a card below compute capability 12.x never takes a switch; sm86 manifest records the two new PTX as not built (sm86-feature tests pass)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 02:59:24 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d9bed432e7 docs: rows 2.1 status and the sm_120 decode switches section (model-free results, pending gates)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 02:46:45 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 bb47b296c0 serve: plan and queue the adaptive swaps while the GPU runs the draft, not before the commit (LELEKA_SERVE_ADAPT_DEFER=off restores the earlier order)
begin_adaptation (choose_swaps over 24,576 counts, up to 96 span lookups and swap queueings, the count decay) ran on the host between the window and the commit/draft launch:
0.6 ms on an adaptation round, 0.15 ms per round on average, during which the GPU sat idle. The host now records the round at begin_adaptation and runs the same work right after
launch_draft (span round.adapt_deferred), at the latest at join_adaptation, always before the next round's apply_pending. The decision inputs (counts, residency) cannot change in between,
so the swaps are the same ones in the same order; only the host time they take moves into the draft's shadow. Not yet measured on the 5090.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 02:24:02 +01:00