Files
leleka/docs/experiments
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
..