Commit Graph
1061 Commits
Author SHA1 Message Date
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
Pavlo RatushnyiandClaude Sonnet 5.5 b03510f43f scripts/decode-sm120: summarize.sh
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 02:16:20 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 359b4b5a6a residency: the seed row cap is an experimental setting, not a default (orchestrator: placement-class change, no quality gate yet)
LELEKA_ORIGINAL_SERVE_SEED_MAX_ROWS stays available (default 0 = no cap, behaviour unchanged); the earlier commit's default of 4096 is removed and the docs say so.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 02:10:28 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 5ef2c6eb7a residency: no prompt-routing seed for a prefill that routed more than 4096 rows (LELEKA_ORIGINAL_SERVE_SEED_MAX_ROWS, 0 = no cap)
At 45k-247k prompt tokens the seed (default on, keep 0) replaced the ranked profile's resident set by the prompt's top experts and cost 25-35 % of decode on the frozen
245k session: VRAM share 80-85 % against 93-96 % with the seed off, windows 0-20 serving ~240 CPU + ~245 PCIe experts against 23-79 + 13-60, 17.5-20 against 13.4-15.4 ms per round,
107-110 against 132-149 tok/s (turns 1-4; one run each, bin-e2e4, upstream profile). Behaviour for prompts up to 4096 routed rows is unchanged. Placement-only; greedy ids can differ (GPU/CPU rounding).
Not yet measured with this binary; the paired evidence is the env switch run of the same code path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 02:08:26 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c9b91ac543 scripts/decode-sm120: jobs for three switches (replay identity in three processes), build_rt/test_driver fixes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 01:55:59 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 75f166c9ba sm120 decode switch SIDE_MIXER (GDN part): gates and gate projection on side streams of the verify window graph (off by default until its gates pass)
Upstream STRATA_SIDE_MIXER=2, GDN half: each GDN layer's alpha/beta gates (gdn_alpha_beta) and gate projection (mmvq GdnGate) are issued on two side
streams that fork from the capture stream right after the q8_1 quantization (before the qkv projection) and join before the recurrence; no kernel changes,
only the dependency edges of the captured graph. OriginalCapture owns the side streams and their fork/join events (created before cuStreamBeginCapture
for a VerifierWindow capture when the switch is on, destroyed after the capture ended) and hands out the side stream from stream_handle() between
side_fork(i) and side_end(i). Not in a split (two-group) window, as upstream. The QSA half of upstream's switch (indexer chain, queries chain) is not ported.

Switch: policy.side_mixer, LELEKA_SM120_SIDE_MIXER=0|1, replay arm flags !side / !noside. Default OFF: no identity or timing result yet.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 01:52:15 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0a3cda3769 residency: choose_swaps selects the victims it can pair instead of sorting every resident expert (same swaps, same order)
Per layer only min(candidates, residents) victims can pair; select_nth + a sort of those, with (value, expert) as the total order (= the earlier stable sort), and the
per-layer vectors are reused. Test: 40 random usage/resident cases with ties against the kept reference implementation, identical swaps and order for max_swaps 1/5/96/4096.
Micro timing (laptop, synthetic 46 % resident): 580 -> 480 us per call; one call per adaptation (every 4th round). Not measured on the 5090.

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