63b1668a92ebb1ad3e0df6fda606fff3059f5948
vetta-infer
MoE-first microkernel inference engine in Rust + minimal AMD ROCm HIP kernels.
Built from the measured hardware physics and engineering lessons of our hardened C++/HIP baseline (strata), targeting unified-memory AMD RDNA 3.5 APUs (Sogliola: Ryzen AI 9 HX 370 / Radeon 890M gfx1150, 48 GiB VRAM carveout + 96 GiB UMA, 81.7 GB/s DRAM, 44 TFLOP/s INT8 WMMA, dual Gen4 NVMe) with optional LAN co-processing on Lyra (2.5 Gbps Ethernet).
Core Design Principles
- MoE-first on UMA (
gfx1150): designed vertically around sparse Mixture-of-Experts architectures (Transformer SWA/Full + Vision, Hybrid GDN+GQA, native MTP / Block-Diffusion). - Direct
.safetensors+ Write-OnceO_RDONLYNVMe Cache: zero GGUF conversion, zero SSD wear after initial atomic pack (.tmp.<pid>+fsync+rename), checkedu64bounds everywhere. - Zero-Copy UMA + NVMe DMA Streaming (
SlabRing):io_uring O_DIRECTinto page-aligned buffers mapped directly to GPU viahipHostRegister(zero CPU copy, zerohipMemcpy), with Hot/Cold expert caching + lookahead prefetch for 100B–300B+ MoE models. - Pure-Rust Control Plane +
<15Reusable HIP Microkernels: all scheduling, safetensors/cache I/O, wire protocol (strata-ctlcompatible, includingGEN 0pre-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. - First-Class Inference Telemetry: lock-free statistics capture (per-layer expert routing Zipf curves,
L -> L+1co-activation transitions, domain profiles, speculative acceptance histograms, logit entropy, cache hit/miss, GPU phase timings) exported to JSONL with negligible runtime overhead. - Lean 4 Verified State Machines: every critical concurrency/lifetime/prefix invariant is modeled and machine-checked in Lean 4 (
proofs/, 0sorryAx) before implementation. - LAN Control/Compute Split (Sogliola + Lyra): pluggable
DraftProviderandPrefetchAdvisortraits allow running remote speculative drafting, domain routing, or lightweight Vision/RAG on Lyra over 2.5 Gbps LAN (< 1 KB/step,~0.3 msRTT).
Workspace Layout
| Path | Responsibility |
|---|---|
crates/vetta-core |
Domain types, WeightStore / DraftProvider / PrefetchAdvisor traits, SlabRing DMA state machine, PrefixState typestate, zero-alloc sampler & Leviathan verifier, Hot/Cold MoE cache policy |
crates/vetta-io |
Overflow-safe .safetensors reader (index.json, pread, strict bounds) and unified write-once O_RDONLY NVMe disk cache |
crates/vetta-proto |
Wire protocol (--serve, compatible with strata-ctl: INFO/READY/GEN/RESUME/PP/T/DONE/ERR/STOP/QUIT, GEN 0 pre-warm) + Lyra RPC message schemas |
crates/vetta-telemetry |
Lock-free inference telemetry collector (MoE routing histograms, L -> L+1 transition matrix, speculative stats, JSONL sink) |
crates/vetta-hip |
Thin HIP FFI + PinnedUmaBuf fence-guarded ownership + CPU mock backend for headless unit tests |
crates/vetta-cli |
vetta-infer CLI binary (info, serve, bench, stats) |
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) |
Milestones
- M0 (Foundation — current): Workspace, Lean 4 contracts (
slab_ring_dma.lean),vetta-core,vetta-io,vetta-proto,vetta-telemetry, HIP ABI skeleton, full CPU test suite. - M1 (Resident MoE End-to-End — Target 1:
Inkling-2-Mini):vetta-hipRDNA 3.5 microkernels, NVFP4/MXFP8 +Q8_G64_T16trunk, Vision WMMA, write-once NVMe cache,strata-ctldrop-in--serveparity & speed vs C++ baseline (>= 18 tok/s,< 4 sreload). - 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+hipHostRegisterSlabRing, Hot/Cold expert cache + lookahead prefetch. - M3 (Distributed Control Plane — Lyra + Sogliola): Remote
DraftProvider+ domainPrefetchAdvisorover 2.5 Gbps LAN + live telemetry-driven domain expert pre-warming.
Quick Verification
# Lean 4 formal proofs (0 sorryAx)
lean proofs/slab_ring_dma.lean
# Pure-Rust workspace tests (no GPU required)
cargo test --workspace
Languages
Rust
76.2%
HIP
17.3%
Lean
5.4%
C
1.1%