[HIP][Core] DSpark GPU drafter + verify perf & correctness fixes (13.93 tok/s, strata parity)
Fix all DSpark speculative bottlenecks and long-context/multi-turn bugs: - Single-pass base-unembed Top-512 screen + on-GPU Markov loop & argmax (reads 922 MB unembed once per round, <=32 B D2H). - On-GPU batched verify argmax + forward_batch_taps_no_logits (eliminates double unembed and 4.8 MB D2H per round). - Wave32 online-softmax dspark_block_attn (0 bytes LDS, fixes >16.2k token crash on Global layer 1; regression-tested at c_len=17000). - Vectorized M-tiled Wave32 router_gemv_batched, zero-scratch small-M SWA GQA, WMMA gemm_bf16 for m>=1, fdot2 MoE for b<=12. - Persistent DsparkContext + PrefixCache DsparkSnapshot save/restore (multi-turn RESUME parity tested). - Accepted-count EMA governor starting at n_draft=5 (adapts 2..7). - Docs (README.md, docs/ORIENTATION.md) + changelog in review/2026-12-02-fix-drafter-e-ottimizzazioni.md. Measured on gfx1150 (Inkling-2-Mini, temperature=0, 100% greedy EXACT): - Rust coding (RingBuffer<T>, 128 tok): OFF 6.83 -> VETTA_SPEC=1 13.93 tok/s (2.04x, n_draft=5; strata-inkling 13.66 tok/s). - Short prose (capital, 96 tok): nd=5 4.58 -> 9.09 tok/s (+98.5%); adaptive EMA 8.93 tok/s decode. Validated: cargo test --workspace (-D warnings), all 7 Lean 4 proofs (0 sorryAx), HIP/LD/GW GPU parity gates.
This commit is contained in:
1 parent
91c1baaf27
commit
c1c5221642
9 files changed
+1433
-186
No files matched your search
+25
-8
@@ -132,12 +132,26 @@ Five ideas explain almost everything that will surprise you:
|
||||
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.
|
||||
- **DSpark speculative drafter landed at `strata` parity (2026-12-02, measured).**
|
||||
Opt-in via `VETTA_SPEC=1` (lossless contract proven in `proofs/speculative_draft.lean`,
|
||||
200-token `spec_lossless_gate` EXACT, multi-turn `PrefixCache` + `DsparkSnapshot`
|
||||
restore EXACT). All drafting runs 100% on GPU: single-pass base-unembed Top-512
|
||||
screen (reads 922 MB `unembed` once per round), on-GPU Markov loop + candidate
|
||||
argmax (`<=32 B` D2H), 0-LDS Wave32 online-softmax block attention (regression-tested
|
||||
at `c_len = 17_000`), M-tiled Wave32 router GEMV, zero-scratch small-M SWA GQA,
|
||||
`fdot2` MoE for `b <= 12`, and an accepted-count EMA governor starting at `n_draft = 5`.
|
||||
Measured on `gfx1150` (`Inkling-2-Mini`, `temperature=0`):
|
||||
- **Rust coding prompt (`RingBuffer<T>`, 128 tok):** OFF **`6.83 tok/s`** →
|
||||
`VETTA_SPEC=1` **`13.93 tok/s`** (**2.04×**, `n_draft=5`, 100% EXACT) vs
|
||||
`strata-inkling --draft dspark` **`13.66 tok/s`** on the exact same prompt.
|
||||
- **Short prose prompt (`"The capital of France is"`, 96 tok):** `nd=5` jumped from
|
||||
**`4.58` → `9.09 tok/s`** (**+98.5%**); default adaptive EMA **`8.93 tok/s`** decode.
|
||||
Full changelog & root-cause breakdown: `review/2026-12-02-fix-drafter-e-ottimizzazioni.md`.
|
||||
- **What is NOT done yet (the frontier):** **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 and speculative drafting are landed; DMA memory streaming is next.
|
||||
|
||||
## The road to the goal
|
||||
|
||||
@@ -159,8 +173,9 @@ on 2026-12-01 (see *Current state*). The path, in order:
|
||||
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,
|
||||
7. **Drafter + DMA layer streaming** — ⏳ DSpark speculative drafter ✅ landed
|
||||
(`13.93 tok/s` on Rust coding, 2.04× vs OFF, matching `strata-inkling`); next is
|
||||
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.
|
||||
@@ -176,7 +191,9 @@ lean proofs/slab_ring_dma.lean
|
||||
lean proofs/bus_lifecycle.lean
|
||||
lean proofs/serve_session.lean
|
||||
lean proofs/arena_plan.lean
|
||||
lean proofs/inkling_loop.lean
|
||||
lean proofs/prefix_cache.lean
|
||||
lean proofs/speculative_draft.lean
|
||||
|
||||
# Opt-in live tests against the real Inkling artifact:
|
||||
cargo test -p vetta-infer-ld -- --ignored inkling
|
||||
|
||||
Reference in new issue
Block a user