diff --git a/README.md b/README.md index 1b040b7..230588d 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,8 @@ Built from the measured hardware physics and engineering lessons of our hardened - **M0 (Foundation โ€” done):** Workspace skeleton, Lean contracts (`slab_ring_dma.lean`), checked IO, serve parsing, telemetry, HIP ABI, full CPU test suite. - **M0.5 (Architecture realignment โ€” done):** approved microkernel design fixed in `docs/ARCHITECTURE.md`; crates realigned to `vetta-infer-*` (abi/kn/ld/cc/rt/lab/sp/nt/tm/gw); bus lifecycle Lean-verified (`bus_lifecycle.lean`); faithful Adaptive-K port; `strata-ctl` wire emitters + `image=` key. -- **M1 (Resident MoE End-to-End โ€” Target 1: `Inkling-2-Mini`, in progress):** `rt` HIP RDNA 3.5 microkernels, NVFP4/MXFP8 + `Q8_G64_T16` trunk, Vision WMMA, write-once `.vbundle`, `strata-ctl` drop-in `--serve` parity & speed vs C++ baseline (`>= 18 tok/s`, `< 4 s` reload). Landed so far: serve-session FSM (`serve_session.lean`), `memory.vplan` arena safety (`arena_plan.lean` + `abi::arena`), `.vbundle` manifest/plan contract (`abi::bundle` + `ld::bundle`). +- **M1 (Resident MoE End-to-End โ€” Target 1: `Inkling-2-Mini`, inference landed):** full 48-visit forward on real `gfx1150` weights, **EXACT multi-token greedy parity** vs the `strata` reference (per-pass KV pools + unpadded vocab 200058), `strata-ctl` drop-in `--serve` link (OpenAI-compatible API, field-for-field wire). Serve-session FSM (`serve_session.lean`), arena safety (`arena_plan.lean` + `abi::arena`), `.vbundle` contract (`abi::bundle` + `ld::bundle`), loop proof (`inkling_loop.lean`). Speed vs C++ baseline (`>= 18 tok/s`, `< 4 s` reload) is the remaining M2 work. + - **๐ŸŽ‰ First real interactive GUI conversation โ€” 2026-12-01 (measured):** via the `strata-ctl` web GUI on Sogliola, *"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 is sequential prefill of the ~2650-token agent prompt, ~140 ms/token; decode ~4.2 tok/s). Host-CPU busy-wait eliminated via `hipDeviceScheduleBlockingSync` (measured A/B 101.2% โ†’ 54.2%); the residual ~54% is kernel-launch cost, removed by HIP graph capture (M2). - **M1.5 (Embedder lane โ€” BGE-M3):** native encoder forward-pass (LayerNorm, bidirectional full-attn, GELU-erf, CLS pooling + L2 โ€” recipe declared in the manifest), XLM-R importer, SPM tokenizer, `vetta-infer embed` wire; acceptance cosine โ‰ฅ 0.999 vs the live `vetta-semantics` oracle (`:8091`) + publisher fixture + anisotropy canary. Optional reranker head. May double as the HIP kernel bring-up bench. - **M2 (Hybrid GDN + NVMe Zero-Copy DMA Streaming):** Chunkwise Parallel GDN (WY-representation, target `250โ€“350+ ppts`), `Clover-35B-A3B` & MTP MoE support, `io_uring O_DIRECT` + `hipHostRegister` `SlabRing`, Hot/Cold expert cache + lookahead prefetch. - **M3 (Distributed Control Plane โ€” Lyra + Sogliola):** Remote `DraftProvider` + domain `PrefetchAdvisor` over 2.5 Gbps LAN + live telemetry-driven domain expert pre-warming. @@ -45,12 +46,13 @@ Built from the measured hardware physics and engineering lessons of our hardened ## Quick Verification ```sh -# Lean 4 formal proofs (0 sorryAx, 42 theorems across 4 files) +# Lean 4 formal proofs (0 sorryAx, 5 files) 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 -# Pure-Rust workspace tests (no GPU required, 65 tests) +# Pure-Rust workspace tests (no GPU required) cargo test --workspace ``` diff --git a/docs/ORIENTATION.md b/docs/ORIENTATION.md index 3f3d93a..16cb4d5 100644 --- a/docs/ORIENTATION.md +++ b/docs/ORIENTATION.md @@ -71,38 +71,56 @@ Five ideas explain almost everything that will surprise you: ## Current state (honest) -- **CPU planning pipeline: complete and live-verified.** Inkling config โ†’ - total tensor classification (1244/1244) โ†’ canonical IR โ†’ physical schedule - (looped core unrolled to 48 steps) โ†’ a full base decode graph (675 ops) that - passes the Lean-proven arena validator. -- **GPU execution: begun.** Three kernels verified on the real `gfx1150` - (embed_bf16 exact, gemm_bf16 exact, rms_norm ~1e-6 relative error). The - hipcc โ†’ static-lib โ†’ FFI โ†’ launch โ†’ parity pipeline works end-to-end. -- **No token generated yet.** The engine does not currently run inference. The - GPU execution half (remaining kernels + executor + packer + serve wiring) is - the work in progress. Do not mistake the validated *plan* for a running - *engine*. +- **The engine runs real inference, end-to-end, and it is correct.** The full + 48-visit Inkling-2-Mini forward (prelude + looped core ร—3 passes with bank + rollback + coda + final depth-mix/softcap) runs on the real `gfx1150` weights. + Greedy decoding is **EXACT multi-token parity** against the hardened `strata` + reference (16 and 40 tokens, F32 and FP16 KV). The two root causes of the old + token-2+ gap were structural, not precision: per-pass KV pools and the + unpadded logit vocab (200058). +- **Linked to the agent framework.** `strata-ctl --serve` spawns `vetta-infer` + and serves its OpenAI-compatible API; the wire protocol (READY/INFO/T/PP/ + RESUME/DONE/ERR) is field-for-field compatible. Verified live: capital queries, + Italian multi-turn, EOS/stop handling. +- **First real interactive GUI conversation (2026-12-01, measured).** Through the + `strata-ctl` web GUI on Sogliola (`http://sogliola:1234`), engine `vetta-infer`: + - 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. +- **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) + dropped it to ~54% (measured A/B 101.2% โ†’ 54.2%). The residual ~54% is genuine + kernel-launch submission cost (~1300 launches/token), removed only by HIP graph + capture. +- **What is NOT done yet (the frontier):** HIP graph capture (collapse the + per-token launches โ†’ near-zero host CPU), batched prefill / prefix cache (make + 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. ## The road to the goal The destination: a working, measured inference engine that the agent framework can talk to over the wire, replacing the old `strata` engine for a real -conversation. The path, in order: +conversation. **Steps 1โ€“5 are landed** โ€” the first real GUI conversation happened +on 2026-12-01 (see *Current state*). The path, in order: -1. **Inkling graph parity** โ€” layer the model-specific refinements onto the base - graph: the learned attention-residual block-mix, loop controllers, ShortConv4, - relative-position bias, sliding-window attention, paged KV. (Blueprint: - `docs/inkling-forward-design.md`.) -2. **Remaining kernels** โ€” flash attention (GQA, SWA, split-KV), MoE NVFP4 - routing + experts + reduce, RoPE/KV-write, penalties/top-k. Each - parity-verified before use. -3. **Executor (`rt`)** โ€” lower the `CompiledPlan` to kernel launches, UMA arena - broker, KV-cache management. -4. **BackendPacker + `.vbundle`** โ€” weights โ†’ device, the real bundle build. -5. **Serve wiring** โ€” connect the (already proven) serve-session FSM to real - generation and to `vetta-agents` over the line protocol. **First chat.** -6. **M2 performance** โ€” WMMA tiling, expert residency/streaming, measured - tok/s against the reference. +1. **Inkling graph parity** โ€” โœ… landed (attention-residual block-mix, loop + controllers, ShortConv4, relative-position bias, sliding-window attention, + per-pass KV). Blueprint: `docs/inkling-forward-design.md`. +2. **Remaining kernels** โ€” โœ… landed (flash GQA/SWA, MoE NVFP4/MXFP8 routing + + experts + reduce, KV-write, L2-clip, relpos). Each parity-verified. +3. **Executor** โ€” โœ… landed (full 48-visit forward on real weights). +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: HIP graph capture (host CPU), + batched prefill / prefix cache (time-to-first-token), expert-GEMV WMMA + (decode tok/s). Measured against the reference, no unmeasured claims. 7. **M3 Lyra co-processor** โ€” remote drafting, semantic domain routing, domain-aware expert prefetch.