Commit Graph
473 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 d70c1d8dca docs(serve): seed replicate on the merged base
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 15:26:49 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 6e96c497a1 docs(serve): residency seeded from the prompt's routing (first-request A/B on the 5090 and the 3080 laptop)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 12:17:07 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7e29683890 Merge branch 'claude/port-gpu-bringup' into claude/seed-residency
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 11:43:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 5e0bd84901 fix: drop duplicate read_at left by the ms-trim and prefill-kernels merges
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 11:07:27 +02:00
Pavlo Ratushnyi f907a1bfdf Merge branch 'claude/ms-trim' into claude/port-gpu-bringup 2026-10-17 11:06:19 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 30e67ff8d2 diag(serve): LELEKA_SEED_TRACE coverage of the decode routing by the starting set, the prompt's top experts and the oracle
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 10:50:21 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 6050e8644a perf(serve): the refill queued inside the assembly is opt-in (LELEKA_REFILL_DEFER=on) until it has a GPU result
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 10:14:53 +02:00
Pavlo Ratushnyi ad1c047b10 Merge branch 'claude/prefill-kernels' into claude/port-gpu-bringup 2026-10-17 10:13:04 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 8c8ced060c docs(prefill): tier-on A/B
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 10:12:44 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7c4b036384 docs: paired A/B of the step-cost trims, pcie_frac evidence
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 08:52:25 +02:00
Pavlo Ratushnyi 70bf2efe2e Merge branch 'claude/round-overhead' into claude/port-gpu-bringup 2026-10-17 08:52:12 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 1bd72a1a85 docs(serve): job 809, the unmodified Original on the port's corpus
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 08:51:58 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c585f27b2f fix(serve): restore the starting placement slot for slot between experiment requests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 08:32:37 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 073790dc98 feat(serve): seed decay over prompt chunks, long-context text file, prompt-id corpus arms
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 08:30:14 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 935678805c docs(prefill): laptop A/B of the compute-stage kernels
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 08:23:23 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 f29d8ad400 docs(prefill): compute-stage kernel results (RTX 5090 job 961, laptop gates)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 08:23:13 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 3e00018f47 perf(serve): queue the lent-slot refill after the intake uploads and before the graph capture
The refill DMA (1.4 GB, ~40 ms) otherwise held back the decode phase's small synchronous uploads (PLE seed) on the copy engine; now it overlaps the ~75 ms host-side capture.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 05:38:43 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 c30cf5c38d docs: per-step host costs of the Original serve loop
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 03:16:20 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 931e8563c4 feat(serve): seed the VRAM expert tier from the prompt's own prefill routing (experimental, LELEKA_ORIGINAL_SERVE_SEED)
The MoE prompt stage already reads the routed expert ids on the host to group rows by expert; collect the per-expert row counts
(no device work) and, at the end of the prompt phase, swap the most-routed missing experts into the VRAM slots in one batch
queued on the tier's copy stream (same ranking as the adaptive tier). Off by default.

Also: first-request A/B arms (static/adaptive x seed on/off, tier reset between requests) for the corpus, long-context and
laptop smokes, per-round hit-rate marks, and unit tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 02:58:12 +02:00
Pavlo Ratushnyi 5da8f13165 Merge claude/port-gpu-bringup (d777560) into claude/ms-trim 2026-10-17 02:57:09 +02:00
Pavlo Ratushnyi 14eeb39865 Merge branch 'claude/port-gpu-bringup' into claude/prefill-kernels 2026-10-17 02:55:52 +02:00
Pavlo Ratushnyi d777560c58 Merge branch 'claude/round-overhead' into claude/port-gpu-bringup 2026-10-17 02:47:39 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 fc12844537 perf(prefill): GDN chunk starts from the mirror's device state when it holds the prior; more PLE reader threads
LELEKA_PREFILL_GDN_MIRROR=0 keeps the canonical host upload. Final residual of every row bit-identical (PREFILL-R gate) on the laptop.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 02:13:46 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 24000a38b5 perf(prefill): batched input staging, folded finite guards, element-parallel dequant, fast finite checks
- KAR PLE rows of a whole chunk are resolved to cache slots on the host (parallel pread of the misses) and decoded by one kernel straight into the arena; each distinct token embedding is decoded once and broadcast to the four residual streams on the device (LELEKA_PREFILL_STAGED_INPUT=0 keeps the per-token path).
- GR read/inject and GDN chain guards ride on their producer kernels; GDN/QSA weight dequantization is one thread per element (LELEKA_PREFILL_FUSED_SCANS=0, LELEKA_PREFILL_FAST_DEQUANT=0 keep the originals).
- Two-barrier GDN recurrence is EXPERIMENTAL (LELEKA_PREFILL_FAST_REC=1), off by default.
- Branch-free finite check and single-copy upload of the GDN state; PREFILL-R bit gate, per-command profile tags, model-free GPU probes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 02:04:42 +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 Sonnet 5.5 3c33af3e01 perf(serve): the lent-slot refill copies run on the cache's own non-blocking stream
Other synchronous uploads of the decode phase (PLE seed, canonical GDN) no longer queue behind the 1.4 GB of refill DMA on the default stream.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 02:01:14 +02:00
Pavlo RatushnyiandClaude Opus 5.5 7a113d1406 docs(serve): expert residency record (job 805: placeholder profile, static vs adaptive)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 01:56:37 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 ef6e2c54f8 perf(serve): wait for the lent-slot refill behind the decode phase's assembly (LELEKA_REFILL_DEFER=off controls)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 00:59:04 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 2f793d03c9 perf(serve): single-pass canonical GDN intake, one write for the window PLE staging, chat/sampled smoke options, conv span
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 00:42:27 +02:00
Pavlo RatushnyiandClaude Opus 5.5 858f42001e docs(serve): job 804 record (shared window modules, reverted executable reuse)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:13:51 +02:00
Pavlo Ratushnyi e3980f3e21 Merge branch 'claude/port-gpu-bringup' into claude/ms-trim 2026-10-17 00:07:21 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 7dba64c4d5 perf(serve): pread for KAR PLE rows, per-window env reads cached, sampled corpus smoke, bench_encode
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-17 00:07:21 +02:00
Pavlo RatushnyiandClaude Opus 5.5 499faec1ae perf(prefill): the chunk expert stream is EXPERIMENTAL and off by default
Job 0708 (same binary, LELEKA_PREFILL_STREAM A/B): with next-MoE copies
queued under the GDN batches the ring fell 1,108 -> 776 ms per 8192-token
chunk but the GDN windows grew by about as much (2,676 vs 2,730 ms per
chunk), and 2048-token chunks got slower (1,755 vs 1,410 ms). The
per-layer copy ring is the default again; LELEKA_PREFILL_STREAM=1 enables
the stream for experiments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:03:18 +02:00
Pavlo RatushnyiandClaude Opus 5.5 a9f67649ee fix(serve): default --pcie-frac 0.55 only over a pinned expert bank
The 0.55 default (3e8e10e) also applied to the laptop's pageable low-RAM
mapped bank, whose PCIe share is DMA'd from pageable pages (the copy kernel
needs aliases): the coordinator's 3080 runs decoded at 6.66 tok/s against
~10-12 with 0. Unset, the share is now 0 for a pageable bank and 0.55 for a
registered one; an operator's LELEKA_ORIGINAL_SERVE_PCIE_FRAC applies as given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 00:01:47 +02:00
Pavlo RatushnyiandClaude Sonnet 5.5 57fdd21b13 perf(serve): host profile spans, verify GPU profile report, span cache, sparse suffix reset
Driver host_profile spans (LELEKA_SERVE_PROFILE) for the window launch, doorbell waits, syncs, head, commit and MTP draft
graphs; STRATA_VERIFY_PROFILE report printed per request; PCIe/swap/refill source span cache (LELEKA_SPAN_CACHE=off controls);
suffix drafter clears only the slots it claimed (LELEKA_SUFFIX_RESET=full controls).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-16 23:59:59 +02:00
Pavlo RatushnyiandClaude Opus 5.5 c45bcaafd7 Revert "perf(serve): update the previous verifier's graph executables instead of instantiating anew"
Job 804 (RTX 5090, rt-b8): with the parked executables on (the default),
both arms broke the stack in the smoke's cancellation sequence (a window
failed with CudaExecution after a few requests, the stack went Broken)
while every arm with LELEKA_GRAPH_EXEC_REUSE=off passed. The executable
update path is withdrawn; the instantiation it would have saved is ~21 ms
per request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:17:36 +02:00
Pavlo RatushnyiandClaude Opus 5.5 52e0911652 docs(prefill): paired laptop run against the Original (identical greedy outputs, prefill on par)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:03:28 +02:00
Pavlo RatushnyiandClaude Opus 5.5 973e0d2fdf feat(serve): --dump-routing for the expert-cache profile (LELEKA_ORIGINAL_SERVE_DUMP_ROUTING)
generate.cpp's --dump-routing writes every routed expert so tools/make_profile.py
can rank the (layer, expert) pairs a workload uses; the expert-cache profile then
decides what starts resident. The port's tier writes the same records (layer,
k, ids, weights) for every decode window row it serves (prompt routing is not
traced). Off unless the variable names a file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 21:58:46 +02:00
Pavlo Ratushnyi 7e930efc91 Merge branch 'claude/port-gpu-bringup' into claude/round-overhead 2026-10-16 21:56:41 +02:00
Pavlo RatushnyiandClaude Opus 5.5 cdf284c9c3 docs(serve): round-overhead A/B record (jobs 800-803)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 21:56:41 +02:00
Pavlo Ratushnyi ae269b8f14 Merge branch 'claude/port-gpu-bringup' into claude/prefill-throughput 2026-10-16 21:47:03 +02:00
Pavlo RatushnyiandClaude Opus 5.5 deff468321 docs(prefill): chunk-size rounding evidence, 8192-chunk breakdown, stream overlap and laptop findings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 21:47:03 +02:00
Pavlo Ratushnyi 0850cfe272 Merge branch 'claude/prefill-throughput' into claude/port-gpu-bringup 2026-10-16 21:45:43 +02:00
Pavlo Ratushnyi b075aad4d6 Merge branch 'claude/round-overhead' into claude/port-gpu-bringup 2026-10-16 21:45:42 +02:00
Pavlo RatushnyiandClaude Opus 5.5 3eb74054e0 perf(serve): wait for the adaptive tier's swaps at the round start
Job 803 (static vs adaptive tier, paired): with the context synchronizes
gone from the publication, the adaptive swap copies (96 experts, ~0.2 GB
every 4 rounds) overlap the next window and its CPU share; the CPU pool
time per round rose by ~1-2 ms and the fenced publication lost against the
serial one with the tier adapting (62.6/63.8 vs 63.7/64.4 tok/s), while it
was neutral to positive with static residency. The swaps now land before
the next window (wait_swaps at apply_pending, after the draft): what the
synchronizes used to enforce, made explicit, and the resident set of a
window no longer depends on when the copies finished.
LELEKA_SERVE_SWAP_WAIT=off polls as generate.cpp's apply_pending(false).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:54:11 +02:00
Pavlo RatushnyiandClaude Opus 5.5 f2c5f5eb0e perf(serve): router lookahead opt-in (LELEKA_CPU_POOL_LOOKAHEAD=on)
Laptop A/B/A (RTX 3080, mapped experts, 3 prompts x 2 passes, 128 tokens, warm page cache, same binary
7c584c2): decode tok/s on 7.21/8.54/11.49/9.44/10.00/12.94 and 8.17/6.20/10.47/8.29/9.92/12.98 vs off
9.29/8.97/11.82/8.15/9.82/13.53 (means 9.94, 9.34 vs 10.26), identical outputs in all three arms. The
thread warmed ~175k experts and spent ~11 s of CPU on router GEMVs per run on an 8-core CPU that already
runs 7 workers and the host. Off by default until a cold-cache measurement shows a gain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 20:14:03 +02:00
Pavlo RatushnyiandClaude Opus 5.5 6fa92c13e4 perf(serve): update the previous verifier's graph executables instead of instantiating anew
Each request's verifier instantiated its seven window/commit graphs again
(~19 ms of the ~110 ms assembly on the 5090, job 803 profile). A drained
verifier executable is now parked with its context (at most 16, destroyed
with the context) and the next verifier's graph of the same policy and node
count is applied to it with cuGraphExecUpdate; when the driver refuses the
update (topology or node kinds differ) the parked executable is destroyed
and the graph instantiated as before. LELEKA_GRAPH_EXEC_REUSE=off keeps the
per-request instantiation (A/B control).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:45:42 +02:00
Pavlo RatushnyiandClaude Opus 5.5 57c2558961 perf(serve): share the verify window's sealed modules across the per-request verifiers
Every request's verifier bank loaded (and SHA-256 checked) the window's
sealed PTX modules again, ~1 MB of PTX for the expert kernels alone, and
unloaded them at the end of the phase. The context now keeps the modules
an earlier bank loaded (Context::window_modules, unloaded with the context)
and later banks share them: the same sealed image and entries, admitted
once. LELEKA_WINDOW_MODULE_CACHE=off loads per bank as before (A/B control).
The serve profile reports record.modules (window module loading inside
record_all).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:42:09 +02:00
Pavlo RatushnyiandClaude Opus 5.5 ae02262c08 perf(cpu-expert): specialise the AVX-512 IQ, Q2_0 and the IQ4_NL row kernels on format and token count
iq_avx512.cpp templates row_dot<TY, NT>; the Rust kernels looped over a runtime token slice with the
format matched per half block. dot_multi512, rust_q2::dot512 and iq4nl now dispatch once per row to
const-generic bodies (format x 1..8 tokens) with the same operations in the same order per token.
Proof: tests/borrowed_group_parity.rs prints a digest of every output bit of its 120 synthetic groups (all
10 format pairs, 1..8 rows); the digests of the previous and this build are identical. Model-free group
cost on the i9-11900H laptop, 7 workers: 226/250 -> 206/218 ms per 48-group round.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:36:35 +02:00
Pavlo RatushnyiandClaude Opus 5.5 4726afa27e perf(cpu-expert): pin the host loop once to the first physical core (session.cpp SessionLoopScratch)
The direct pool's caller drains beside the workers, which are pinned to every physical core but the
first. Like the Original's session loop, the caller is now pinned once (on its first group) to that free
core and its previous mask is restored when the pool drops; unpinned, its drain and doorbell spin can
land on a worker's core or SMT sibling (the Original measured 26.9 vs 36.3 GB/s for this). Placement
only: no arithmetic changes. LELEKA_CPU_POOL_PIN_HOST=off is the A/B arm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:32:17 +02:00