[ABI][LD][Proofs][Docs] M1 groundwork: arena-safety proof + .vbundle contract; embedder lane (M1.5) accepted
- proofs/arena_plan.lean: memory.vplan arena safety (8 theorems + 4 computational examples, 0 sorryAx): no overlap, checked index bounds, no use-before-write, overlap-rejection completeness. - abi::arena: validator mirroring the proof, checked offset arithmetic (invariant #2), explicit error per violation class; 8 tests. - abi::bundle: .vbundle manifest (ABI_VERSION=1, source+packer fingerprints, backend target; incompatible ABI rejected explicitly), checked memory.vplan/graph.vplan parsing, arena-validated compile(); 7 tests. - ld::bundle: read-only load_bundle_plans(dir) over manifest + plan/*.vplan; 3 tests (good bundle, missing file, ABI mismatch). - abi::vplan: encoder-lane opcodes (layer_norm, flash_full_attn, gelu_erf, mean_pool_l2norm) + wire name mapping for all 22 opcodes, roundtrip test. - Docs: utility-encoder scope carve-out (dense decoder LMs out, small fully-resident encoders in), embedder-lane wire proposal + characteristic parity vs vetta-semantics (cosine vs oracle, internal bit-exact goldens), 16-primitive kernel set, M1.5 milestone; README/AGENTS aligned (65 tests, 42 theorems across 4 proof files). - review/: tandem exchange with the strata-ctl coder (their request + observations, our formal reply: embedder accepted, M0 dir cleanup done). Verified live: RUSTFLAGS="-D warnings" cargo test --workspace = 65/65 PASS; lean proofs/{slab_ring_dma,bus_lifecycle,serve_session,arena_plan}.lean green, standard axioms only.
This commit is contained in:
1 parent
7b50f1c07c
commit
fb92662106
13 files changed
+1235
-16
No files matched your search
@@ -6,10 +6,10 @@ Built from the measured hardware physics and engineering lessons of our hardened
|
||||
|
||||
## Core Design Principles
|
||||
|
||||
1. **MoE-first on UMA (`gfx1150`):** designed vertically around sparse Mixture-of-Experts architectures (Transformer SWA/Full + Vision, Hybrid GDN+GQA, native MTP / Block-Diffusion).
|
||||
1. **MoE-first on UMA (`gfx1150`):** designed vertically around sparse Mixture-of-Experts architectures (Transformer SWA/Full + Vision, Hybrid GDN+GQA, native MTP / Block-Diffusion). Large dense *decoder* LMs are out of scope (bandwidth physics); small fully-resident utility **encoders** (BGE-M3 embedder lane, M1.5) are in.
|
||||
2. **Direct `.safetensors` + Write-Once `O_RDONLY` NVMe Cache:** zero GGUF conversion, zero SSD wear after initial atomic pack (`.tmp.<pid>` + `fsync` + `rename`), checked `u64` bounds everywhere.
|
||||
3. **Zero-Copy UMA + NVMe DMA Streaming (`SlabRing`):** `io_uring O_DIRECT` into page-aligned buffers mapped directly to GPU via `hipHostRegister` (zero CPU copy, zero `hipMemcpy`), with Hot/Cold expert caching + lookahead prefetch for 100B–300B+ MoE models.
|
||||
4. **Pure-Rust Control Plane + `<15` Reusable HIP Microkernels:** all scheduling, safetensors/cache I/O, wire protocol (`strata-ctl` compatible, including `GEN 0` pre-warm), deterministic zero-alloc sampling, speculative verification, and telemetry live in 100% CPU-testable Rust; GPU compute is isolated behind a thin C/HIP microkernel ABI.
|
||||
4. **Pure-Rust Control Plane + 16 Reusable HIP Microkernels:** all scheduling, safetensors/cache I/O, wire protocol (`strata-ctl` compatible, including `GEN 0` pre-warm), deterministic zero-alloc sampling, speculative verification, and telemetry live in 100% CPU-testable Rust; GPU compute is isolated behind a thin C/HIP microkernel ABI.
|
||||
5. **First-Class Inference Telemetry:** lock-free statistics capture (per-layer expert routing Zipf curves, `L -> L+1` co-activation transitions, domain profiles, speculative acceptance histograms, logit entropy, cache hit/miss, GPU phase timings) exported to JSONL with negligible runtime overhead.
|
||||
6. **Lean 4 Verified State Machines:** every critical concurrency/lifetime/prefix invariant is modeled and machine-checked in Lean 4 (`proofs/`, 0 `sorryAx`) before implementation.
|
||||
7. **LAN Control/Compute Split (Sogliola + Lyra):** pluggable `DraftProvider` and `PrefetchAdvisor` traits allow running remote speculative drafting, domain routing, or lightweight Vision/RAG on Lyra over 2.5 Gbps LAN (`< 1 KB/step`, `~0.3 ms` RTT).
|
||||
@@ -18,16 +18,16 @@ Built from the measured hardware physics and engineering lessons of our hardened
|
||||
|
||||
| Path | Responsibility |
|
||||
| --- | --- |
|
||||
| `crates/vetta-infer-abi` | Shared contracts: domain types, bus messages, `.vplan` opcodes, wire parsing, checked JSON/VTC1 parsers, zero-alloc sampler & Leviathan verifier, `DraftProvider`/`PrefetchAdvisor` traits (zero deps) |
|
||||
| `crates/vetta-infer-abi` | Shared contracts: domain types, bus messages, `.vplan` opcodes, wire parsing, checked JSON/VTC1 parsers, zero-alloc sampler & Leviathan verifier, `DraftProvider`/`PrefetchAdvisor` traits, arena-safety validator, `.vbundle` manifest/plan compile (zero deps) |
|
||||
| `crates/vetta-infer-kn` | Pure microkernel: control bus, service registry & lifecycle (Lean-verified), UMA/DMA broker (`SlabRing` + `UmaSlabPool`) |
|
||||
| `crates/vetta-infer-ld` | Loader & compiler: checked `.safetensors` reader, write-once `VTC1` atomic writer; dual-step → `.vbundle/` (M1) |
|
||||
| `crates/vetta-infer-ld` | Loader & compiler: checked `.safetensors` reader, write-once `VTC1` atomic writer, read-only `.vbundle` plan loading; dual-step packer → `.vbundle/` (M1) |
|
||||
| `crates/vetta-infer-cc` | Cache & storage: Hot/Cold MoE expert policy, `O_RDONLY` cache reload; `io_uring O_DIRECT` streaming (M2) |
|
||||
| `crates/vetta-infer-rt` | Operational runtime: `PrefixState` typestate + hybrid checkpoint pool; `CompiledPlan` executor + HIP FFI (M1) |
|
||||
| `crates/vetta-infer-lab` | Laboratory runtime: same executor core as `rt` + `probe.vplan` hooks |
|
||||
| `crates/vetta-infer-sp` | Speculative coordinator: faithful throughput-aware Adaptive-K (port of `clover_policy.h`) |
|
||||
| `crates/vetta-infer-nt` | Lyra LAN bridge: `LyraRpc` (remote drafting, domain hints) |
|
||||
| `crates/vetta-infer-tm` | Telemetry: lock-free routing/Zipf/domain/spec stats, async JSONL sink |
|
||||
| `crates/vetta-infer-gw` | Gateway & CLI: `strata-ctl`-compatible wire emitters, `vetta-infer` binary (`info`, `version`; `serve`/`bench`/`stats` with M1) |
|
||||
| `crates/vetta-infer-gw` | Gateway & CLI: `strata-ctl`-compatible wire emitters, Lean-verified serve-session FSM, `vetta-infer` binary (`info`, `version`; `serve`/`bench`/`stats` with M1) |
|
||||
| `kernels/hip` | Minimal reusable RDNA 3.5 HIP microkernels (`Q8_G64_T16`, `Q4_G64_T16` SWAR, Chunkwise GDN, FlashAttn/GQA, MoE route/WMMA, GPU top-64 sampling) |
|
||||
| `proofs/` | Lean 4 formal contracts (`0 sorryAx`, audited axioms) |
|
||||
|
||||
@@ -35,16 +35,20 @@ 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`):** `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).
|
||||
- **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.5 (Embedder lane — BGE-M3):** native encoder forward-pass (LayerNorm, bidirectional full-attn, GELU-erf, mean-pool + L2), XLM-R importer, SPM tokenizer, `vetta-infer embed` wire; acceptance cosine ≥ 0.999 vs the live `vetta-semantics` oracle (`:8091`). 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.
|
||||
|
||||
## Quick Verification
|
||||
|
||||
```sh
|
||||
# Lean 4 formal proofs (0 sorryAx)
|
||||
# Lean 4 formal proofs (0 sorryAx, 42 theorems across 4 files)
|
||||
lean proofs/slab_ring_dma.lean
|
||||
lean proofs/bus_lifecycle.lean
|
||||
lean proofs/serve_session.lean
|
||||
lean proofs/arena_plan.lean
|
||||
|
||||
# Pure-Rust workspace tests (no GPU required)
|
||||
# Pure-Rust workspace tests (no GPU required, 65 tests)
|
||||
cargo test --workspace
|
||||
```
|
||||
Reference in new issue
Block a user