@@ -98,7 +98,7 @@ patterns — see [`docs/quickstart.md`](docs/quickstart.md).
9898| ** Restored verifier** | Gemma-4 26B-A4B (AR) + DFlash dLLM proposer + trained ** f_θ** ; ** S5** keeps 5 full-attention layers exact, restores sliding layers → bounded resident KV, recall preserved. | ` inference_engine.v04 ` (CUDA), ` inference_engine.backends.mlx ` (Apple Silicon) |
9999| ` SinkWindowVerifier ` | Lightweight path: Qwen3 (0.6B / 1.7B / 4-bit MLX), sink+window K/V trim (ADR 0001 / 0002). | ` kv_cache_proposer.verifier ` (CPU), ` inference_engine.backends.mlx.verifier ` |
100100| ** Per-session binding** | ` PerSessionVerifierRegistry ` + coordinator resolver: each session owns isolated KV (shared weights) — true multi-tenant serving (PR-A3c, ` --multi-tenant ` ). | ` inference_engine.session.verifier_registry ` |
101- | ** Batched scheduler** | Fuses a cohort's decode steps into one batched forward — ** 8.45× served throughput** at 8 sessions, recall 1.0. | ` inference_engine.session.batch_scheduler ` |
101+ | ** Batched scheduler** | Fuses a cohort's decode steps into one batched forward — ** 8.45× served throughput** at 8 sessions, recall 1.0. ** CUDA-only ** : on Apple-Silicon MLX, ` v0.4-mac ` multi-tenant is ** serial-only ** (batched ` B>1 ` decode is unsupported — upstream MLX ` B>1, L=1 ` quantized-kernel bug, [ ADR 0014 ] ( docs/adr/0014-agent-connection-capacity-and-cross-host-topology-tests.md ) ). | ` inference_engine.session.batch_scheduler ` |
102102| ` AppendTokens ` / ` Generation ` coordinators | Drive prefill / incremental forward / greedy decode; route per-session (multi-tenant) or single. | ` inference_engine.session.{coordinator,generator} ` |
103103| Python / TypeScript SDKs | ` kakeya.Client ` / ` Session ` (sync gRPC); ` @kakeya/runtime ` (Node 20+). | [ ` sdks/ ` ] ( sdks/ ) |
104104| HTTP shim (deprecated) | OpenAI-compatible ` /v1/chat/completions ` ; ` Deprecation ` + ` Sunset ` headers. | ` inference_engine.server.app ` |
@@ -147,29 +147,57 @@ KV restoration buys *bounded memory at full fidelity*. See
147147the ** memory axis** all-platform + ** throughput** on CUDA) and
148148[ ADR 0013] ( docs/adr/0013-distributed-inference-topology.md ) .
149149
150- ### How this differs — Kakeya Attention vs PagedAttention / RadixAttention
150+ ### Kakeya Attention — the attention algorithm
151151
152- Other engines optimise * how* the KV cache is ** stored/laid out** ; they still
153- store the ** whole** history, so memory ** grows with the conversation** and the
154- node must provision for the * total* footprint. Kakeya optimises * how much* is
155- stored: a sliding-window bound + a global-attention ** restoration** mechanism,
156- so the resident footprint is ** bounded** and the node provisions only for the
157- ** peak window** — not the whole history.
152+ ** Kakeya Attention** is an LLM attention compute + KV-management algorithm:
153+ ** sliding-window bound (sink + window) + f_θ KV-projection + dLLM-proposer
154+ restoration, taken as one primitive.** It is a peer of — and drop-in replacement
155+ for — the attention layer in today's engines: eager attention, ** FlashAttention** ,
156+ vLLM ** PagedAttention** , and SGLang ** RadixAttention** . Where those keep the
157+ ** whole** KV history (memory grows with the conversation) and differ only in
158+ * how* the full cache is computed or laid out, Kakeya Attention bounds * how much*
159+ is resident: evicted context is ** reconstructed on demand** by the proposer+f_θ,
160+ so the resident footprint does not grow with the session.
158161
159- | Engine | Mechanism | What it manages | Memory vs conversation length |
162+ | Algorithm | Layer it replaces | Mechanism | Memory vs conversation length |
160163| --- | --- | --- | --- |
161- | ** vLLM** — PagedAttention | OS-style ** paged** KV blocks (virtual→physical page tables) | layout: non-contiguous block allocation; great for whole-block access | ** grows** — still stores full KV; needs large-capacity store |
162- | ** SGLang** — RadixAttention | ** radix-tree** over KV, dynamic insert/evict | layout + ** prefix reuse** : fast, precise prefix lookup/sharing | ** grows** — still stores full KV; needs large-capacity store |
163- | ** Kakeya** — Kakeya Attention | sliding-window bound + ** global-attention restoration** (dLLM proposer + f_θ/S5) | * length* : dynamically bounds resident KV; evicted context ** reconstructed on demand** | ** bounded** — footprint does ** not** grow with the session; provision only for the ** peak window** |
164- | ** CXL / Ollama** | reuse PagedAttention | layout (offload tier / local serving) | ** grows** — inherits PagedAttention's full-KV storage |
165-
166- The orthogonality matters: PagedAttention and RadixAttention make the * same
167- total* KV cheaper to allocate or share; ** Kakeya Attention makes the total
168- itself bounded** (and is composable — a paged/radix store could hold Kakeya's
169- bounded window). The cost is the restoration compute (a proposer forward), which
170- the rest of this section quantifies (recall 1.0; ~ AR-parity / 1.79–2.06× on
171- CUDA; ~ 4× more concurrent agents per GB, §3.4 of
172- [ ADR 0014] ( docs/adr/0014-agent-connection-capacity-and-cross-host-topology-tests.md ) ).
164+ | eager attention | compute | materialise full ` QKᵀ ` scores | grows (O(T²) compute, full KV) |
165+ | ** FlashAttention** | compute | tiled/online-softmax, no score materialisation | grows — still full KV |
166+ | ** vLLM** PagedAttention | storage | OS-style ** paged** KV blocks | grows — still full KV |
167+ | ** SGLang** RadixAttention | storage | ** radix-tree** KV, prefix reuse | grows — still full KV |
168+ | ** Kakeya Attention** | ** compute + storage** | sink+window bound + ** f_θ + dLLM-proposer restoration** | ** bounded** — provision for the ** peak window** , not the history |
169+
170+ The orthogonality matters: FlashAttention makes the compute cheaper, Paged/Radix
171+ make the * same total* KV cheaper to allocate or share — ** Kakeya Attention makes
172+ the total itself bounded** , and is ** composable** with all of them (a flash
173+ kernel computes a Kakeya window; a paged/radix store holds it). The cost is the
174+ restoration compute (a proposer forward), quantified below (recall 1.0;
175+ ~ AR-parity / 1.79–2.06× on CUDA; ~ 4× more concurrent agents per GB,
176+ [ ADR 0014 §3.4] ( docs/adr/0014-agent-connection-capacity-and-cross-host-topology-tests.md ) ).
177+
178+ ** North star — a product-grade engine that replaces vLLM.** Kakeya Attention is
179+ the native algorithm of a ** product-grade inference engine whose goal is to
180+ replace vLLM** — not a technique bolted onto HuggingFace transformers, and not
181+ "vLLM with a different cache". The engine is designed ** bounded-KV-native** : the
182+ full history is never resident, admission/scheduling sizes sessions by their
183+ ** peak window** (not total tokens), and restoration is fused into prefill/decode.
184+ Graph-captured decode, fused-MoE and efficient masking are table stakes built * in
185+ service of* that design, not a port of vLLM's full-KV pipeline
186+ ([ ADR 0015] ( docs/adr/0015-kakeya-attention-and-engine-substrate.md ) ). The
187+ eager-transformers numbers in the comparison reports are ** feasibility probes** ,
188+ not "Kakeya performance"; the vLLM-beating demonstration runs on a
189+ ** full-attention** verifier, where restoration is load-bearing (on gemma-4 its
190+ native sliding window already bounds 25/30 layers, so it is not the showcase).
191+
192+ ** Where the bounded-KV win is large (and where it isn't).** The advantage scales
193+ with the model's ** full-attention fraction** . On ** gemma-4-26B-A4B** only 5 of 30
194+ layers are full-attention (25 are natively sliding-window) — so vLLM already
195+ bounds 25/30 layers, the 5 full layers dominate long-context KV in ** both**
196+ engines, and Kakeya's resident-KV edge is only ** ~ 7 % at 62k** . On a
197+ ** full-attention** model (no native sliding, e.g. Qwen/Llama) vLLM keeps all
198+ layers full while Kakeya bounds all-but-exact → a ** ~ 6×** resident-KV edge. The
199+ long-context concurrency "sweet spot" is therefore ** architecture-dependent** —
200+ see [ the long-context report] ( docs/reports/kakeya-vs-vllm-longcontext-h200.md ) .
173201
174202### Beta scorecards — Kakeya vs the standalone model (` main ` @ ` 9d5e6b4 ` )
175203
@@ -289,6 +317,13 @@ owns isolated KV (shared weights) — making serving truly multi-tenant, and a
289317at 8 sessions with ** per-session recall 1.0** (see the multi-tenant results
290318below / [ ADR 0014 §3.4–3.7] ( docs/adr/0014-agent-connection-capacity-and-cross-host-topology-tests.md )
291319and the [ detailed report] ( docs/reports/pr-a3c-multitenant-serving-test-report.md ) ).
320+ ** Platform scope:** the batched/parallel cohort path is ** CUDA-only** . On
321+ Apple-Silicon ** MLX, ` v0.4-mac ` multi-tenant is serial-only** — per-session
322+ binding still gives isolated, recall-preserving sessions, but they are served
323+ ** one at a time** ; batched ` B>1 ` decode is blocked by an upstream MLX
324+ quantized-kernel bug (` B>1, L=1 ` → per-session recall collapses to 0.125, while
325+ serialized stays 1.0; confirmed on the latest published `mlx 0.31.2 / mlx-lm
326+ 0.31.3` — [ ADR 0014 §3.4] ( docs/adr/0014-agent-connection-capacity-and-cross-host-topology-tests.md ) ).
292327Pushing the connection sweep further (preset ` agent-capacity-stress ` , the
293328open-file-descriptor limit ` RLIMIT_NOFILE ` raised to 100k / hard unlimited on
294329the Mac — each connection uses one descriptor) shows the true ceilings: ** the
@@ -584,9 +619,9 @@ scripts/
584619| Milestone | Status | Description |
585620| --- | --- | --- |
586621| Session-bound gRPC runtime | ✅ shipped | Long-running gRPC ` RuntimeService ` , Python + TS SDKs, bounded memory + prefill (4-h Mac M4 evidence), Mac M4 self-hosted integration gate |
587- | ** v0.4 for Mac (` v0.4-mac ` )** | ✅ shipped | MLX restored Gemma-4 26B engine: bounded KV (~ 90% saved), recall 1.0, ≈AR-parity spec-decode |
622+ | ** v0.4 for Mac (` v0.4-mac ` )** | ✅ shipped | MLX restored Gemma-4 26B engine: bounded KV (~ 90% saved), recall 1.0, ≈AR-parity spec-decode. Multi-tenant is ** serial-only ** (no batched ` B>1 ` decode — upstream MLX kernel bug, [ ADR 0014 ] ( docs/adr/0014-agent-connection-capacity-and-cross-host-topology-tests.md ) ) |
588623| ** v0.4 for CUDA (` v0.4-cuda ` )** | ✅ shipped | Restored Gemma-4 26B engine on NVIDIA: fused DFlash spec-decode ** 1.79–2.06× AR** , 44–87× KV saving, recall 1.0 |
589- | ** v0.4 multi-tenant (PR-A3c)** | ✅ shipped | Per-session binding (isolated KV, shared weights) + batched scheduler — ** 8.45× served throughput** , per-session recall 1.0 |
624+ | ** v0.4 multi-tenant (PR-A3c)** | ✅ shipped | Per-session binding (isolated KV, shared weights) on both platforms. ** CUDA ** : batched scheduler → ** 8.45× served throughput** , per-session recall 1.0. ** MLX (Mac): serial-only ** (sessions served one at a time; batched parallel decode unsupported upstream) |
590625| Async continuous batching | designing | Dynamic mid-flight arrival + ragged-length cohorts under the async gRPC ` Generate ` handlers (current batcher is fixed-cohort) |
591626| Deployment polish | queued | PyPI + npm publishing, GHCR Docker image, ` kakeya prewarm ` CLI, ` kakeya chat ` REPL |
592627| Cross-request KV reuse | designing | Sessions survive across requests on gRPC; turns intra-session drift into 0 ms inter-request drift |
0 commit comments