Commit Graph
675 Commits
Author SHA1 Message Date
Pavlo RatushnyiandClaude Sonnet 5.5 6023e97847 ledger: stage 7 default-profile e2e (CRM 0/3 on two static frontend checks, decode -39/-58 tok/s, wall inside noise); CRM bisect step 1 stubs
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 04:07:14 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d438db62f9 ledger H4: control gate (shares 0.35/0.55 vs 0.45) - max d_top1 0.67..0.75 is the size of any placement change; control-relative rule applies; candidate passes
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 03:25:15 +01:00
Pavlo Ratushnyi 1b2b27cc7c Merge claude/speed-vs-strata-08143a: slots/adapt rerun verdict in ledger 2026-11-12 03:04:53 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d682da4983 Ledger: verdict of the slots/adapt-every group A/B rerun (PS +1.48 % decode, PW +1.43 %, placement-class, no default change)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 03:04:09 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f6bd8722b1 A/A twins (PH, QQ) in the reruns, A/A control stub, reserve-240 256k retry; ledger: guard incident
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 01:13:23 +01:00
Pavlo Ratushnyi 68d7c58fed Merge branch 'main' into claude/prefill-latency
# Conflicts:
#	docs/experiments/step-ledger.md
2026-11-12 01:13:07 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 50b1ac7ab4 ledger: group e2e A/B of the prefill/host set (TTFT -144..-205 ms/request, fixed), vanilla per layer, placement gate and VRAM floor verdicts
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 01:11:11 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 248a39d612 Ledger: R8 identity and bitwise probe pass, delta pending rerun; H4 256k PS floor 212 MiB (not passed)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-12 01:10:57 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 a77d60afba ledger H4: global rank fill against the uniform layer quota (VRAM share +1.1 points, ms/round -5.2 %), cross-layer potential ~0
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 20:19:19 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8a4cb5b18f Ledger: PcieAuto closed (vanilla descending policy loses with our cheaper PCIe leg; optimum share >= 0.55)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 19:45:13 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0d4d8d67c1 A/A guard for the spd A/B arms (effective switches vs exports, per-arm profile via SPD_ARM_PROFILE); ledger: PB/PN is valid (binaries with the old profile)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 19:08:48 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 f850577875 Ledger: device section deltas do not carry into the round while the critical path is host/tier (stage A/B PB vs PN)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:46:17 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 02c784249a Merge claude/speed-vs-strata-08143a: PcieAuto (off), tail fusion HEAD_CHAIN_BATCH (off), D1/D2 default on, hit-share-gap analysis
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:43:42 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ff6667d89b Merge claude/prefill-latency: hit-gap analysis, per-layer tier counters
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:43:41 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 290dd06300 Tail head-chain switch: probe, identity and window stubs, variants QP/QT; ledger R6/R7 proved-equal, R8 fixing
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:32:48 +01:00
Pavlo Ratushnyi 26dd97c994 Merge branch 'claude/tail-fusion' into claude/speed-vs-strata-08143a 2026-11-11 17:28:23 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d1ad19e765 Tail fusion: LELEKA_SM120_HEAD_CHAIN_BATCH (off), residual write and head mix of all rows in 6 launches
Analysis (docs/experiments/verify-tail-and-gaps.md, CUPTI windows CP.1 / CL.2 / CY.1 against VANL): R6 is the
single-stream control (2035 gaps, 211 us) against VANL (1194, 119 us); with the side streams LEL has 1124 / 123.7 us,
residual +0.006 ms. R7 has no gap. R8 (+86.5 us at LEL's T mix) is the hyper-connection chain 31.2, the head matmul at
T >= 3 38.4 and the greedy pick 18.0.

The switch batches the 6 T launches of the tail (mtp_full_native_write plus the five lm_head_mix kernels a row) into
6: new sealed sm120_head_chain.cu/.ptx (final write, head norm, pre-final mix with the row as grid.y, compiled with the
--use_fast_math flags of the originals), the existing multi-column bf16 gemv, mtp_full_down_silu over the contiguous
rows. Bitwise by construction (same bodies, same per-column fma chain). Flag in GrConfig::head_chain_batch like U5a;
HEAD_MIX_MULTI untouched. Model-free probe tools/decode-sm120/sm120_probe_head_chain.cpp (built, not run), report
script scripts/e2e/codex/speed/verify_tail_report.py, 15 unit tests (288 original_verify tests pass).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:27:58 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0c9aad0d23 Ledger H4: 256k pass criteria and threshold from the memory owner
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:22:39 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 cb60ba8e49 Ledger: H1/H4/H6/H7 from the hit share analysis, H4 correction (variant H was a real gain), 256k precondition for fewer reserves
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:22:06 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 350ff9f070 Hit-share gap research: slots (about 0.9 point), window width (0.55), per-layer quotas (second order), start of request; ranked experiments
Read-only analysis of the surviving replay and CUPTI logs on the 5090 server: VRAM hit share of ours against vanilla per cause, per-layer quota
evidence, start-of-request curve, tier knob A/Bs recomputed, ranked list of changes. Adds hit_share_gap.py (server) and hit_share_layers.py (local).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:19:34 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 188abdd27e docs: causes of the VRAM hit-share gap to vanilla (ledger C6 H1-H7), sizes, gates, next experiments
Read-only analysis of existing logs and code; no code, GPU job or ledger change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 17:17:07 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 0cb24b840c Final stage group A/B stub PB vs PG (n=5), variant PG (PN + D1 + D2); D3 retry key in the ledger
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:54:38 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d635a73c9a Enable LELEKA_SM120_DOWN_SUB16 (D1) and HITS_IN_COMBINE (D2) in the 5090 profiles (identity and probes PASS, window deltas); D3 WAIT_M_ROWS is a measured loss, stays off; ledger
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:52:52 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 ee9264c528 FFN switches D1-D3: CUPTI window section deltas (D1 gain, D2 small gain, D3 loss) and report script
Reads the five independent windows CP/WD/WH/WW/WZ of request 29 (read-only on the server) per window rows T:
D1 DOWN_SUB16 -0.21 ms per graph on F layers (resolved at every T), D2 HITS_IN_COMBINE -0.043 ms per graph
(tail after the CPU rows, resolved), D3 WAIT_M_ROWS a resolved loss (kernel floor 1.4 us + 0.43 us per block).
ffn_window_report.py extracts one trace per call (stdlib, lct.py) and prints the report with the noise estimates.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:50:56 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 c548f0939c ledger V5/V7: non-resident experts per layer from the tier counters (early layers carry more), plan
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:24:25 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 76e09a4570 Merge claude/speed-vs-strata-08143a: S11 default, S9/U5a windows report, D1-D3 switches
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 16:21:11 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 8736d8ceb7 ledger Q5: ring prefetch after the slot-wrap fix (identity PASS, section delta negative, stays off)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:38:56 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 622c16e15d Enable LELEKA_SM120_COMBINE_VEC4 (S11) in the 5090 profiles (identity PASS, window delta -0.016 ms a graph); S9 and U5a stay off, ledger
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:25:31 +01:00
Pavlo Ratushnyi 0dbb4db2f6 Merge branch 'claude/s11-s9-u5a-windows' into claude/speed-vs-strata-08143a 2026-11-11 01:24:44 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 6c0a5fc1f0 Windows of S11, S9, U5a: section deltas with the repeat as noise (reader script and note)
window_increment_report.py reads CUPTI windows offline (extract on the server, report on the laptop): switches that
really ran (kernel names, engine log), per-T per-launch durations, increment deltas against the CZ-CD repeat.
The note records that the windows of verify-s11-s9-u5a-cupti-windows are cumulative and the deltas per switch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:24:28 +01:00
Pavlo Ratushnyi b4ef2eec47 Merge branch 'main' into claude/speed-vs-strata-08143a 2026-11-11 01:22:25 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 b8bcd7e777 FFN switches D1-D3: probe, identity and window stubs; ledger rows and job names
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:19:31 +01:00
Pavlo Ratushnyi ef128c3b04 Merge claude/speed-vs-strata-08143a: sm_120 defaults, verify side streams, fused commit, step ledger, upstream microbench
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

# Conflicts:
#	deploy/rust-runtime/profiles/rtx5090-32g-file.json
#	deploy/rust-runtime/profiles/rtx5090-32g-gguf-ple.json
#	deploy/rust-runtime/profiles/rtx5090-32g.json
#	docs/experiments/step-ledger.md
2026-11-11 01:18:50 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 638dd8c812 Merge claude/prefill-latency: prefill ladder, stream-all 1536, graph reuse, park fast, check merge, host holder tooling
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 01:18:12 +01:00
Pavlo Ratushnyi b800bba09e Merge branch 'worktree-agent-acd2587ce4944ff56' into claude/prefill-latency 2026-11-11 00:47:02 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3a3e3d6569 prefill ring prefetch: stage into the first free unreserved slot (fix stage.slot_not_gathered at sources > slots)
pkg-s16 (51b36adf7), 9/30 requests: RING-REFUSE layer=46|47 check=stage.slot_not_gathered reserved=0
slots=384 sources=410..460. With prefetch hits the copies skip the hit sources, so once a layer's sources exceed
the ring the wrap reaches a slot holding an earlier source's copy that is not gathered yet; the stage_room
shortcut (reserved == 0) then let stage_one refuse.

- stage_target (leleka-cuda-model ring_prefetch) searches forward, wrapping, for the first slot that is not
  reserved and free (never filled or gathered); without a prefetch it is stage_next itself (the literal ring:
  copies and gathers in one order, lookahead one short of the ring).
- Ring::stage_room: no reserved shortcut; "no copy needed or stage_target finds a slot", so the walk waits for
  a gather instead of refusing.
- Host tests: 200 seeds of 460 sources / 384 slots with random prefetch hits among the first 300, other sizes;
  the model asserts no stage onto a reserved or unread slot and that stage_target refuses only when no
  unreserved slot is free (both fail with the old stage_target). 18 tests.

Switch stays OFF by default. Not run on a GPU.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 00:46:48 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 5267c9d538 Ledger: V2 device part at parity, V4b closed by V4a, K11 per layer, S7/D2/D3 rows (FFN phase analysis)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 00:41:16 +01:00
Pavlo Ratushnyi 8d73d862c1 Merge branch 'claude/v2-ffn-design' into claude/speed-vs-strata-08143a 2026-11-11 00:40:55 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 d19d08b698 V2 FFN phase: loss analysis and design (offline CUPTI timeline script)
Per kind/T/layer-class timeline of the FFN phase for LEL (CL.2, CT.1, CY.1)
and VANL from the request-29 windows, shift-share of the +0.95 ms into device
chain / arrival of the CPU rows / tail / tier mix, and the device-side options
that remain (sub16 down kernel with PCIe pass rows, add_hits in combine, wait M
folded into copy rows) with a task split. Analysis only: no engine code, no GPU.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 00:40:33 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 917289a5e5 Ledger: S11/S9/U5a identity results, probe run 2
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-11 00:04:55 +01:00
Pavlo Ratushnyi 1de8a37a13 Merge branch 'worktree-agent-acd2587ce4944ff56' into claude/prefill-latency 2026-11-10 23:18:48 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 61e72f36fd prefill ring prefetch: detached drains opt-in, RING-REFUSE trace, slot bookkeeping in the host model
PET.1 (3ba2a0e37, LELEKA_PREFILL_RING_PREFETCH=1): 5/12 requests failed with InvalidProjectionShape.
The slot bookkeeping the suspects named (prefetched source staged again, reserved slot reused, gather of an
empty / read slot) is now the pure SlotState / stage_needed / stage_target of leleka-cuda-model::ring_prefetch,
called by the driver's Ring and by the host tests: none of those paths is reachable. The unreviewed change was
the compute_drain background stream (process-wide: scoped drains that skip unregistered streams, memsets for
zero uploads, deferred frees in the small-chunk mixers/routers while copies are pending). It is now opt-in:
LELEKA_PREFILL_RING_PREFETCH_DETACH (policy field detach_drains, default off); by default the drains stay
context-wide.

- RING-REFUSE trace under LELEKA_TRACE_DRIVER_ERRORS / LELEKA_BRINGUP_TRACE (passed in with
  set_ring_error_trace; no env read, no new global): one line naming the refused check (new.validate,
  new.schedule_slots, layer.preflight, sources.spans, stream.*, stage.*, gather.*, enqueue.*) with layer,
  source, stage_next, reserved, slots; RING-PREFETCH lines for issued / hits / wasted / dropped / cancelled.
- Host tests: 15 (prefetched source never staged again, reserved slot skipped until its gather then reused,
  gather reads a slot exactly once, distinct refusal names, detach default off) plus a settings test row.
- Without the prefetch, stage_one / gather keep the literal checks and order (stage_target from stage_next).

Switch stays OFF by default. Not run on a GPU.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 23:18:30 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 318190a55c ledger Q6: raw batch copy driver check passes on the 5090 (719 is test-specific)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 23:06:53 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 94185828f9 ledger: refill batch copy result (bytes-bound), prefetch first GPU run fails
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 21:49:18 +01:00
Pavlo Ratushnyi 4f6c2b7155 Merge branch 'worktree-agent-a1dcdd989fb63fb9a' into claude/prefill-latency 2026-11-10 20:50:04 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 2e8bd2040a refill: batched lent-slot refill copies behind LELEKA_REFILL_BATCH (experimental, off)
- cuda-driver: optional cuMemcpyBatchAsync_v2 + cuStreamWaitEvent in AsyncApi (api/enabled/batch_copy.rs,
  stub answers can_batch() == false); pure call plan refill_batch_copy::plan_batch_calls (<= 512 copies per
  call, same order/bytes/destinations) and issue_copies with per-copy fallback after a refusal.
- OriginalExpertCache::fill_slots_queued_batched: same checks, pieces and order as fill_slot_queued_on, one
  context entry; batch on the fill stream ordered after the legacy default stream by fill_event; registered
  bank only; a refused call is reported once and the rest goes per copy; driver errors poison as before.
- engine: settings memory.refill_batch (LELEKA_REFILL_BATCH on|1) and refill_lent's batched branch;
  profile counters refill.batch_calls / refill.batch_copies / refill.per_copy.
- tests: host-side plan tests; #[ignore] GPU test comparing per-copy vs batched slot bytes.
- docs/experiments/refill-batch-copy.md. No GPU run, no speedup claimed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:49:32 +01:00
Pavlo Ratushnyi 83e21ebdfb Merge branch 'worktree-agent-acd2587ce4944ff56' into claude/prefill-latency 2026-11-10 20:42:25 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 3ba2a0e371 prefill: EXPERIMENTAL copy-ring prefetch behind LELEKA_PREFILL_RING_PREFETCH (off by default)
After a layer's copy ring drained, the experts the next layer missed most often in its last N chunks (per-layer
miss history, top K <= ring/2, none on the 8-slot ring) are copied into the next ring's stage slots on the copy
stream, overlapping the combine and the next mixer. The next Ring::new adopts the set: a routed, non-resident
source with the same host bytes reads its prefetched slot (reserved until its gather, ordered by the slot's
copied event); the rest are dropped. stage_one skips reserved slots; the stage-ahead walk waits for a gather
when the next free slot is still live. Same experts, kernels and group order: bitwise neutral by construction.
A set no ring took is drained on end_prompt_stream / begin_prompt_stream / close.

- leleka-cuda-model ring_prefetch: policy, MissHistory ranking, match_prefetch, next_unreserved_slot (+ host
  model of the reserved-slot ring walk), 10 tests
- driver: policy passed via OriginalMmqCopySchedule::set_ring_prefetch (no env read); counters
  ring.prefetch_issued / _hit / _wasted / _failed (MB), span ring.prefetch_issue
- engine: ServeSettings::prefill_ring_prefetch (+ _WINDOW), settings test; issue from run_prompt_layer
- docs/experiments/ring-prefetch.md: design, switch, counters, GPU validation plan (R-hash identity, A/B by tail)

Not run on a GPU: no identity probe, no A/B, no speedup claimed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:41:57 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 cdb0958b6d ledger: Q6 refill deferral on top of the default set (no gain), batch copy plan
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:36:21 +01:00
Pavlo RatushnyiandClaude Sonnet 5.5 4bcf913773 ledger: U6 expert-major bank copy (deferred), U7 fused int8 prompt experts, Q2/Q3 against the VANL logs after the stream threshold
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 20:23:03 +01:00