[Docs] record 2026-12-02 landed state: batched+WMMA prefill, flat VRAM, budget clamp

README + ORIENTATION refreshed to the measured current state (the 618s sequential
first-token is now historical): chunked batched prefill + FP16 WMMA MoE + BF16 WMMA
dense + FlashAttention-2 WMMA prefill => synthetic 2048 prefill 60->12.9s (-78%),
~6.3ms/token (16k agent prompt ~105s, was ~7min); greedy-vs-reference EXACT gate,
internal M=1-vs-M=B parity global-scale tolerance (P1 policy). Flat bounded VRAM
(persistent states, SWA-window ckpt, cap8 grid-protected prefix cache, 512MiB pool
cap, long->short KV reuse). Budget clamp (clamp_max_new) + configurable window
(--max-context): 16504-token prompt generates live (was ERR 0). Roadmap: drafter
integration next, then DMA layer streaming (io_uring O_DIRECT + hipHostRegister
SlabRing) as the hard memory frontier; INT8 fused MoE + HIP graph capture remain.
Lean verify list now 6 files (prefix_cache.lean). Includes the two 2026-12-02 peer
audits in review/.
This commit is contained in:
adm committed 2026-12-02 05:22:07 +01:00
1 parent ee8ac8f5df
commit a4752953fb
4 files changed
+341 -16

No files matched your search

+36 -14
View File
@@ -87,9 +87,9 @@ Five ideas explain almost everything that will surprise you:
- prompt *"Ciao, sono Federico"* → *"Ciao Federico! Piacere di conoscerti.
Come posso aiutarti oggi?"*
- **2650 prompt + 53 completion tokens · 4.2 tok/s decode · first token 618 s.**
- The 618 s time-to-first-token is the **sequential prefill** of the GUI's
~2650-token agent prompt (~140 ms/token); decode itself is ~4.2 tok/s. This
is the honest current performance frontier, not a hang.
- That 618 s was the *sequential* prefill of the day (2026-12-01). It is now
historical: batched prefill + WMMA (below) cut prefill to ~6.3 ms/token, so
the same prompt is seconds and a 16 k-token agent prompt ~105 s (was ~7 min).
- **Host CPU during inference is no longer a busy-wait.** ROCm's default spin
host-wait schedule pinned the process at ~100% CPU; setting
`hipDeviceScheduleBlockingSync` before context creation (as the reference does)
@@ -113,11 +113,31 @@ Five ideas explain almost everything that will surprise you:
eviction (restore probes 2.4 s vs ~77/154 s cold), and parity stays EXACT at 1024
(warm 2.41 s vs cold 230.4 s). The speedup materialises whenever the next prompt
extends the previous token prefix (standard chat reconstruction).
- **What is NOT done yet (the frontier):** HIP graph capture (collapse the
per-token launches → near-zero host CPU), batched/chunked prefill (M>1 attention
+ grouped MoE, make the *first* large-prompt time-to-first-token seconds, not
minutes), and the expert-GEMV math speedup (WMMA). These are the M2 performance
work — correctness is already there; speed is the next axis.
- **Prefill is batched + tensor-core (2026-12-02, measured).** Chunked batched
forward (M=B, `VETTA_PREFILL_CHUNK`), FP16 WMMA grouped MoE, BF16 WMMA dense
projections, and FlashAttention-2 WMMA prefill (P staged in LDS, no global
scores scratch). Synthetic 2048-token prefill on `gfx1150`, FP16 KV, chunk 256:
**60 s → 12.9 s (-78%)** (MoE 41.6→36.9, BF16 36.2→27.8, flash 27.6→12.9),
~6.3 ms/token. Internal M=1-vs-M=B parity is relaxed to a global-scale numeric
tolerance per the approved P1 policy; greedy-vs-reference remains the EXACT
blocking gate (serve_gen 4/4).
- **VRAM is flat and bounded (2026-12-02).** Persistent per-layer KV/ShortConv
states reused across requests (no ±3.75 GB alloc/free sawtooth), SWA-window
checkpoints (only the last 1024 KV positions for the 40 SWA pools, full prefix
for the 8 full-attn pools), prefix cache cap 8 with grid protection +
LRU-on-restore, and a 512 MiB cap on the buffer pool. Long→short session
switches reuse the persistent KV instead of reallocating it.
- **Long agent prompts are no longer refused (2026-12-02).** strata-ctl always
sends max_new=16384; the budget is now clamped to the window (`clamp_max_new`)
instead of hard-erroring past 16382 prompt tokens, and the window is
configurable (`serve --max-context N` / `VETTA_MAX_CONTEXT`, advertised in
READY). Verified live: a 16504-token prompt generates (previously ERR 0 tokens).
- **What is NOT done yet (the frontier):** speculative **drafter integration**
(next), **layer streaming in DMA** (the hard one: `io_uring O_DIRECT` +
`hipHostRegister` SlabRing, Hot/Cold expert cache + lookahead prefetch), HIP
graph capture (collapse per-token launches → near-zero host CPU), and the INT8
`sf4_i8` fused MoE (the reference's further 2×/5-8× MoE axis). Correctness is
already there; speed and memory streaming are the next axes.
## The road to the goal
@@ -135,12 +155,14 @@ on 2026-12-01 (see *Current state*). The path, in order:
4. **Weights → device** — ✅ landed (resident `WeightCache`, lazy expert load).
5. **Serve wiring + first chat** — ✅ landed (`strata-ctl` link, EXACT parity,
first real GUI conversation 2026-12-01).
6. **M2 performance** — ⏳ the current frontier: prefix checkpoint cache ✅ landed
(multi-turn prefill reuse, EXACT parity, 57.8× measured); HIP graph capture
(host CPU), batched/chunked prefill (first-turn time-to-first-token), and
expert-GEMV WMMA (decode tok/s) still pending. Measured against the reference,
no unmeasured claims.
7. **M3 Lyra co-processor** — remote drafting, semantic domain routing,
6. **M2 performance** — ⏳ prefix checkpoint cache ✅ (multi-turn reuse, EXACT,
57.8× measured); batched/chunked prefill ✅; WMMA MoE + BF16 dense +
flash-FA2 prefill ✅ (prefill 60→12.9 s measured); flat VRAM ✅; budget clamp
✅. Remaining: INT8 fused MoE, HIP graph capture (host CPU).
7. **Drafter + DMA layer streaming** — ⏳ next: speculative drafter integration,
then layer streaming in DMA (`io_uring O_DIRECT` + `hipHostRegister` SlabRing,
Hot/Cold expert cache + lookahead prefetch) — the hard memory frontier.
8. **M3 Lyra co-processor** — remote drafting, semantic domain routing,
domain-aware expert prefetch.
## How to verify