Repository navigation
v2.4.0 — DeepSeek-V4-Flash 284B Kernel & Mathematical Co-Design (+68% Prefill, 9.1–10.1 tok/s Decode, L2-Quadrature MoE), Windows 10/11 Hybrid GPU+CPU Pack, & 80.8 tok/s AMD Vulkan MXFP4
LatestRelease Notes — llama-modchip (v2.4.0)
📄 Quick Links: Overview (
README.md) · Technical Paper (ARCHITECTURE.md) · Windows Hybrid GPU+CPU Pack (windows/README.md) · Fractal-MoE Quality Gate (benchmarks/FRACTAL_MOE_QUALITY_GATE.md) · 96+RouteCrack + Stockfish-PVSTechniques (speculative/ROUTECRACK_TECHNIQUES.md) · Engineering FAQ (FAQ.md)
⚡ v2.4.0 — DeepSeek-V4-Flash 284B 4-Level Cache-Tiled Prefill (44.36 tok/s, +77.1%) & Mathematical Co-Design (9.06–10.74 tok/s Pure CPU Decode, $L_2$ -Quadrature MoE Tail Pruning, wo_b * wo_a SVD Spectrum), Native Windows 10/11 Hybrid GPU+CPU Pack (windows/), & 80.8 tok/s AMD Vulkan MXFP4
Release Date: November 2026
Highlights:
-
⚡
DeepSeek-V4-Flash 284B(13.17BActive) 4-Level Register (ZMMAVX-512BW) + L1D + L2 + L3 Kernel & Graph Co-Design (+77.1%Prefill &+53.3%–81.7%Pure Decode —patches/deepseek-v4-flash-fractal-256k.patch):-
512-Bit AVX-512BW Register-Stationary Multi-Column Kernels (
_1x8,_1x4,_1x3,_1x2,1x1), Zero-Remainder{8, 4, 3, 2}MoE Tiling, AVX-512quantize_row_q8_K, &MQA8FlashAttention: Unpacks each quantized weight superblock (Q2_0,IQ1_S,IQ2_XXSwith BMI2+SWAR parity masks,IQ1_M,Q5_K,Q6_K) once inZMMregisters across up to 8 token columns (64weights/instruction), decomposes any$M \ge 2$ into${8, 4, 3, 2}$ with zero1x1fallback, vectorizesquantize_row_q8_Kin AVX-512, and halvesFLASH_ATTN_EXTtime (415.1 ms -> 208.5 ms) via Register-Stationary AVX-512MQA8. -
Zero-Rebuild Dynamic
CSA/LIDSkip (ggml_dsv4_skip_csa_comp), 8-SlotQ8_K/Q8_0Activation Cache,MUL_MAT_IDRow-Group Reuse, & L1D/L2 Token-AffinityHC_PRE/HC_POST: Eliminates full 4,551-node compute-graph rebuilds on non-compressor decode steps (7out of every8tokens) by tagging dummyCSA/LIDcompressor nodes withflags |= 0x100(GGML_TENSOR_FLAG_DSV4_SKIP), caches quantizedQ8_K/Q8_0input activations across shared-input projections (s_q8_cache_buf), and pins each tokenitto threadith = it % nthacrossDSV4_HC_POST -> DSV4_HC_PRE -> RMS_NORMto eliminate cross-CCD Infinity Fabric snoops. -
Verified Speedup on 16C/32T Zen 4/5 (
AMD Ryzen 9 9955HX,0 GPUs): Accelerates prompt prefill & multi-turn agentic turns from24.70–25.05 tok/sto43.16–44.36 tok/s(+77.1%) and pure lossless single-token decode (N=1, zero speculation) from5.91 tok/s(169.3 ms/tok) to9.06–9.95 tok/s(100.5–110.3 ms/tok,+53.3%–68.4%) (and10.12–10.74 tok/swithTop-4 L2 + Gate-First SwiGLU).
-
512-Bit AVX-512BW Register-Stationary Multi-Column Kernels (
-
🧮 Mathematical Structure of
DeepSeek-V4-Flash:$L_2$ -Quadrature Adaptive MoE Tail Pruning (9.68–10.12 tok/s) & Exact SVD ofwo_b * wo_a:-
Why MoE Tail Pruning Requires
$L_2$ -Quadrature Rescaling (Not Linear$L_1$ Rescaling): Layers0..2(dsv4_hash_layer_count = 3) use deterministic token-ID hash tables (ffn_gate_tid2eid) with flat weights (~0.25each) and are preserved at6/6experts. In the 40 learned-router layers (il = 3..42), the 6 expert output vectors$\mathbf{e}_1(\mathbf{x}), \dots, \mathbf{e}_6(\mathbf{x}) \in \mathbb{R}^{4096}$ are nearly orthogonal ($\langle \mathbf{e}i, \mathbf{e}j \rangle \approx 0$), so their norms add in quadrature ($|\sum w_i \mathbf{e}i|2^2 \approx \sum w_i^2 |\mathbf{e}i|2^2$). Rescaling kept experts via $L_2$-quadrature ($\alpha{L_2} = \sqrt{\sum{i=1}^6 w_i^2 / \sum{i=1}^k w_i^2}$) instead of linear $L_1$ sum ($\alpha{L_1} = \sum{i=1}^6 w_i / \sum{i=1}^k w_i$) preserves the exact balance against the unscaled dense shared expert (ffn_out = moe_out + ffn_shexp) and cuts KL-divergence by-58%. -
Cross-Platform Zero-Overhead Runtime Control (
/tmp/dsv4_moe_cfg.bin& Windows%TEMP%\dsv4_moe_cfg.bin): Switchable on the fly in0.3 ns(zero syscalls per token viammapon Linux/macOS andCreateFileMappingA/MapViewOfFileon Windows_WIN32). -
Exact SVD Spectral Analysis of
wo_b * wo_a(31%of Total DRAM Traffic =991.6 MB/token): Proves that the purely linear chainattn_output_a([4096, 8192])$\to$ attn_output_b([8192, 4096]) retains99.64%of Frobenius energy and0.998204(99.82%) output cosine similarity at rank$r = 768 / 1024$ (-25%DRAM =-248 MB/token,-6.9 ms/tok), and99.30%cosine similarity at rank$r = 640 / 1024$ (-37.5%DRAM =-372 MB/token,-10.3 ms/tok).
-
Why MoE Tail Pruning Requires
-
🪟 Native 1-Click Windows 10/11 Hybrid GPU+CPU MoE Support (
windows/,modchip):- Adds
windows/AVVIA_MODCHIP.bat,windows/BENCHMARK_PC.bat,windows/modchip_win.ps1,windows/README.md, andwindows/LEGGIMI.txt, plus automatic Windows (MINGW*/MSYS*/CYGWIN*) delegation in./modchip. - Auto-detects physical CPU cores, live free System RAM, and live free GPU VRAM (
nvidia-smi), downloads officialllama.cppWindows CUDA 12.4 + CUDA Runtime DLLs (or Vulkan fallback on AMD/Intel GPUs), dynamically computes--n-cpu-moewith a550 MBWDDM safety buffer, auto-selects--load-mode nonevs--no-mmap, and writes%TEMP%\dsv4_moe_cfg.bin.
- Adds
-
🚀 AMD Vulkan Hybrid
MXFP4Verification (75.1 / 80.8 tok/sat256KContext) & Security Hardening (FAQ.md,gateway/sse_gateway.py):- Community benchmark on AMD Ryzen 9 7945HX3D + Radeon RX 9070 XT 16GB (
RADV/Vulkan) runningNemotron-30B-A3Bat256Kcontext:Fractal-MXFP4(15.2 GB) hits75.1 tok/s(new code) /80.8 tok/s(in-context refactor), beatingQ4_0(69.7 / 76.2 tok/sat16.1 GB) while saving0.9 GBof VRAM. Documented inFAQ.mdQ8 whyFractal-64(Q2_0) is CPU-only until Vulkan/CUDA add a customq2_0shader. - Merged PR #4 (
commit 83767ca): hardened gateway tool schema whitelist, boundary checks, 2MB THP alignment, dynamic sysfs L3 CCD topology detection, and/dev/shmIPC validation.
- Community benchmark on AMD Ryzen 9 7945HX3D + Radeon RX 9070 XT 16GB (
DeepSeek-V4-Flash 284B (13.17B Active) Mode (il = 0..2 kept at 6/6) |
Pure Decode (tok/s) |
Latency (ms/tok) |
Speedup vs Initial (5.91 tok/s) |
Prob Cosine Similarity | Top-10 |
Local Top-10 $\Delta$PPL | Top-1 / Top-3 Match |
|---|---|---|---|---|---|---|---|
0. Pre-Optimization Baseline (v2.3.0 initial N=1) |
5.91 tok/s |
169.30 ms |
1.00x |
1.00000 |
0.0000 |
0.00% |
100% / 100% |
1. v2.4.0 Lossless (Top-6 All Layers, Default) |
9.06 tok/s |
110.33 ms |
+53.3% |
1.00000 |
0.0000 |
0.00% (Bit-Exact) |
100% / 100% |
2. v2.4.0 Adaptive Tail (min_w=0.11, |
9.52 tok/s |
105.02 ms |
+61.1% |
0.99634 |
0.0047 |
+0.47% (Negligible)
|
95.8% / 100% |
3. v2.4.0 Sweet-Spot (Top-5 on il >= 3, |
9.68 tok/s |
103.27 ms |
+63.8% |
0.99714 |
0.0042 |
+0.42% (Negligible)
|
95.8% / 100% |
4. v2.4.0 Hybrid 6/4/6 (il = 16..39 at 4, |
9.83 tok/s |
101.74 ms |
+66.3% |
0.99660 |
0.0184 |
+1.86% (Very Low)
|
95.8% / 100% |
5. v2.4.0 Hybrid 5/4/5 (il = 12..40 at 4, |
9.95 tok/s |
100.55 ms |
+68.4% |
0.99463 |
0.0215 |
+2.17% (Low)
|
95.8% / 100% |
6. v2.4.0 Turbo 10+ tok/s (Top-4 on il >= 3, |
10.12 tok/s |
98.84 ms |
+71.2% |
0.99587 |
0.0281 |
+2.85% (Moderate)
|
95.8% / 100% |
7. v2.4.0 Top-5 L2 + Gate-First SwiGLU (80/128, cfg[6..7]=80) |
10.15 tok/s |
98.49 ms |
+71.7% |
0.99385 |
0.0531 |
+5.45% (100% Tool-Call)
|
100% / 100% |
8. v2.4.0 Top-4 L2 + Gate-First SwiGLU (96/128, cfg[6..7]=96) |
10.60 tok/s |
94.37 ms |
+79.4% |
0.99126 |
0.0694 |
+7.19% (100% Tool-Call)
|
100% / 100% |
9. v2.4.0 Top-4 L2 + Gate-First SwiGLU (64/128, cfg[6..7]=64) |
10.74 tok/s |
93.15 ms |
+81.7% |
0.98059 |
0.1159 |
+12.29% (100% Tool-Call)
|
100% / 100% |
Comparison: Top-4 with Naive Linear $L_1$ Rescaling ($\alpha_{L_1}$) |
10.10 tok/s |
98.97 ms |
+70.9% |
0.98698 |
0.0671 |
+6.94% (Distorted)
|
95.8% / 95.8% |
🐋 v2.3.0 — DeepSeek-V4-Flash 284B in < 60 GiB RAM at 256K Context (56.56 GiB SwiGLU-H2 + Fractal-64), Single-Cycle AVX2 Q2_0 Kernels (+55%), & Community Leaderboard (111.62 tok/s Threadripper, 44.97 tok/s AWS Graviton3 ARM64, 66.5 tok/s AMD Vulkan)
Release Date: November 2026
Highlights:
-
World's First Engine to Run a
284.33BFrontier MoE (DeepSeek-V4-Flash,13.17BActive) Inside< 60 GiBRAM at256KContext on a 64 GB CPU Box:-
Analytical Second-Order
SwiGLU-H2MoE Compression +Fractal-64(Q2_0,3.75 bpw) MLA Transcoding (scripts/transcode_dsv4.c,scripts/transcode_dsv4_shard.py,scripts/build_fractal_moe_gguf.sh --deepseek): ShrinksDeepSeek-V4-Flash-0731(43layers:3hash-routed +40learned-router,256routed +1shared expert/layer, MLA + Indexer Compressors) from76.87 GiB(4-shardIQ2_XXS, which OOMs on64 GBRAM) down to56.56 GiB(-20.31 GiB, 3 transcoded GGUF shards) on disk and58.9 GiBtotalVmRSSat full-c 262144(256K) context. - Computes closed-form second-order SwiGLU Hessian importance weights $I_{e,j} = |W_{\text{gate}}^{(e)}[j,:]|2^2 \cdot |W{\text{up}}^{(e)}[j,:]|_2^2$ directly from the paired Gate and Up expert slices while transcoding dense
Q8_0MLA & Indexer projections (attn_q_b,attn_output_a,attn_output_b,attn_compressor_gate,attn_compressor_kv,attn_kv,indexer_compressor_gate,indexer_compressor_kv) to Block-64Fractal-64(Q2_0,3.75 bpw).
-
Analytical Second-Order
-
Single-Cycle AVX2 Variable-Shift
dot_q2_0_q8_0(+55%Speedup) & 3D L1D Tiling (wo_a):- Vectorizes 64-bit upper bit-plane unpacking (
qh[8]) and 8×4-bit shifted sub-scales (scales[4]) inggml_vec_dot_q2_0_q8_0_generic(ggml/src/ggml-cpu/quants.c) using single-cycle AVX2 variable bit-shifts (_mm256_sllv_epi32/_mm256_srlv_epi32) fused into_mm256_madd_epi16(p01, vmult01)(vpmaddwd), cutting 10M-blockQ2_0 × Q8_0runtime from86.5 msto55.8 ms(+55%faster). - Adds 3D L1D Cache Tiling (
TILE_I0 = 64) inggml_compute_forward_mul_mat(ggml/src/ggml-cpu/ggml-cpu.c) for 3D multi-head tensors (ne02 > 1,wo_a), keeping[ne00, 64]slices inside the48 KBZen 5 L1D cache across all 32 threads.
- Vectorizes 64-bit upper bit-plane unpacking (
-
MLA-Aware
HARPCache, 8-Step Sparse Indexer Lookahead Prefetching, &$O(1)$ llama_kv_cache_dsv4Speculative Rollback Fix (patches/deepseek-v4-flash-fractal-256k.patch):- Auto-detects DeepSeek MLA compressed KV tensors (
ne11 == 576,ne21 == 512,LLAMA_KV_L3_WINDOW=1024) for_MM_HINT_NTAL3 isolation and prefetches (_mm_prefetch(..., _MM_HINT_T0)) sparsecsa_top_k_maskrows8steps ahead (ic_pf = i + 8). - Fixes
state_snapshotplane indexing (std::min(n_rs_seq, rollback + (d - n_seq_tokens)) * state_rows) andkv_csa/hca/lid->seq_rminsrc/llama-kv-cache-dsv4.cpp, achieving94.5%draft acceptance (9.67 tok/savg /11.50–14.69 tok/speak) and clean EOS termination on both./modchip chatand./modchip claude(Claude Code).
- Auto-detects DeepSeek MLA compressed KV tensors (
-
Unified
./modchip chat+Claude CodeCompact Tool Snapshot (32.6 msSlot 0 Restore):- Updates
modchip,scripts/chat.py, andgateway/sse_gateway.pywith automatic active-model detection (/v1/models),MODCHIP_COMPACT_TOOLS=1(2,940prefix tokens,32.6 ms/dev/shmrestore), and automatic Slot 0 restoration (_last_endpoint_was_chat) when switching between./modchip chatandClaude Code.
- Updates
-
New Community CPU & Hybrid Benchmarks (
README.md,FAQ.md):-
AMD Threadripper PRO 7985WX (
64C/128T Zen 4,256 MBL3, 8-Ch DDR5-6000) by@aifartist(Issue #1): Full thread-scaling sweep (16/24/32/48/64threads) +111.62 tok/swarm decode (80.14 tok/scold,386.00 tok/sprefill at-t 324C/CCD). -
AWS Graviton3
m7g.2xlarge(8 vCPU ARM64 Neoverse-V1,32 MBL3,31 GBDDR5) by@gerchik(Issue #2):44.97 tok/srefactoring /41.05 tok/sC++20 (101.67 tok/sprefill). -
AMD Ryzen 9 7945HX3D + Radeon RX 9070 XT 16GB (
Vulkan/RADVHybrid) (FAQ.mdQ8):66.50 tok/sdecode /563.00 tok/sprefill at256Kcontext via tensor-role offloading (-ngl 99 --n-cpu-moe 30 --no-mmap).
-
AMD Threadripper PRO 7985WX (
Thread Scaling & Warm Promotion on Threadripper PRO 7985WX (@aifartist, Issue #1) |
-t 16 (2C/CCD) |
-t 24 (3C/CCD) |
-t 32 (4C/CCD Sweet Spot) |
-t 48 (6C/CCD) |
-t 64 (8C/CCD) |
|---|---|---|---|---|---|
Prefill (tok/s) |
238.12 |
314.85 |
386.00 tok/s |
361.40 |
312.18 |
Stage 1: Cold C++20 Generation (tok/s) |
58.40 |
68.92 |
73.84 tok/s |
64.15 |
51.80 |
Stage 2: Cold In-Context Refactoring (tok/s) |
62.10 |
74.50 |
80.14 tok/s |
69.30 |
55.42 |
Stage 2: Warm Session Trie + b5 Promotion (Run 4+) |
— | — | 111.62 tok/s (+39.3%) |
— | — |
🗜️ v2.2.0 — Block-64 2-Level Hierarchical Non-Linear MoE Quantization (14.35 GiB Fractal-64 & 15.95 GiB Fractal-MXFP4), 100/100 Quality Gate, & 8-CCD Threadripper PRO 7985WX (80.14 tok/s)
Release Date: November 2026
Highlights:
- Block-64 2-Level Hierarchical Non-Linear MoE Quantization (
Fractal-64,30 bytes/ 64 weights =3.75 bpw): Solves the1856 × 2688non-divisibility trap that causes all 256-block K-quants (Q3_K,IQ3_S) inllama.cppto fall back toQ4_0onNemotron-3.5-30B-A3B. Starting directly from the unquantized58.84 GiBBF16master weights,Fractal-64shrinks the model to14.35 GiB(14,698 MiB) on disk and15.40 GiBidleVmRSS(-6.01 GiBRAM saved vsBaseline-Q4_0), achieves17.78 dBSQNR on realBF16expert weights (+1.53 dBaboveQ3_K), fuses 8-weight sub-block rescaling (mult ∈ {4..19}) directly into AVX2vpmaddwd(_mm256_madd_epi16) at zero extra SIMD instruction cost, and scores100.0 / 100.0onbenchmarks/eval_quality_and_tools.pywhile running+28.0%faster (25.02 tok/svs19.54 tok/s). - Asymmetric
Fractal-MXFP4(15.95 GiB/4.25 bpwfromQ4_0): For users re-quantizing an existingQ4_0GGUF viascripts/build_fractal_moe_gguf.sh --profile mxfp4, shrinks the model to15.95 GiB(17.46 GiBidleVmRSS), adds_MM_HINT_NTAcache-bypass streaming toggml_vec_dot_mxfp4_q8_0, runs+33.5%faster (26.08 tok/s), and scores100.0 / 100.0on the Quality & Tool-Calling Gate. - 100-Point Reproducible Quality, Tool-Calling, Coding & Long-Context Needle Gate (
benchmarks/eval_quality_and_tools.py): Ships an executable grader + raw JSON outputs (benchmarks/results/) testing 5 multi-tool JSON schema calls (30pts), 3 sandbox-executed Python algorithms (30pts), an8,512-token Needle-in-a-Haystack passkey + symbolic math check (20pts), and live speed/RAM telemetry (20pts). - 8-CCD AMD Threadripper PRO 7985WX Verification (
80.14 tok/sdecode /386.00 tok/sprefill): Community benchmark by@aifartist(Issue #1) + deterministic per-CCDtaskset -ccore mask generation inscripts/llama_modchip.py. - External Code Review Hardening (
commit 8191367+v2.2.0): Minimal cleanllama.cpppatch (patches/zen5-nemotron-256k-optimizations.patch) verified withgit apply --checkagainstd2f83055, exact full-context attention (LLAMA_ATTN_WINDOW=0) by default across all code paths, safeO_NOFOLLOW+ owner/mode validation on/dev/shm/llama_modchip.bin, and gateway shell-quoting hardening.
Metric / Suite (benchmarks/eval_quality_and_tools.py) |
Baseline-Q4_0 (17.59 GiB) |
Fractal-MXFP4 (15.95 GiB) |
Fractal-64-BF16 (14.35 GiB) |
Fractal-64-BF16 Delta |
|---|---|---|---|---|
1. Agentic Tool-Calling (30 pts) |
30.0 / 30.0 |
30.0 / 30.0 |
30.0 / 30.0 |
100.0% parity |
2. Executable Code Gen (30 pts) |
30.0 / 30.0 |
30.0 / 30.0 |
30.0 / 30.0 |
100.0% parity |
3. Long-Context Needle (8.5K) & Math (20 pts) |
20.0 / 20.0 |
20.0 / 20.0 |
20.0 / 20.0 |
100.0% parity |
Quality Subtotal (80 pts) / Total (100 pts) |
80.0 / 100.0 |
80.0 / 100.0 |
80.0 / 100.0 |
100.0% parity |
Single-Turn Decode Throughput (tok/s) |
19.54 tok/s |
26.08 tok/s |
25.02 tok/s |
+28.0% (+33.5% MXFP4) |
Idle / Peak Resident RAM (VmRSS, 256K Context) |
21.41 / 21.71 GiB |
17.46 / 18.86 GiB |
15.40 / 17.27 GiB |
-6.01 GiB idle / -4.44 GiB peak |
🚀 v2.1.0 — Stockfish-PVS v2 (Sweet Spot, M=7), 4 Unlocked RouteCrack Techniques (60.40 tok/s Peak), & Multi-Platform Expansion (Apple Silicon M4 Pro + Fedora Ryzen 8745HS)
Release Date: November 2026
Highlights: Combines Chess-Engine Principal Variation Search (PVS) + 4-Way Bucketed Zobrist Transposition Tables (StockfishDrafter, 1.64 MB L2/L3) with the RouteCrack statistical speculative engine, unlocking 4 previously dormant RouteCrack techniques (including Singular Horizon Extension M=7), pushing live 25K-context code refactoring on AMD Ryzen 9 9955HX (0 GPUs) to 48.39 tok/s average / 60.40 tok/s peak (mean len = 6.90 tokens/step, 96.39% acceptance) and 85.00% draft acceptance on technical prose, while adding community-verified support for Apple Silicon (M4 Pro 24 GB) and Fedora 44 (AMD Ryzen 7 8745HS GEEKOM A8).
1. ♟️ Stockfish-PVS v2 (Sweet Spot, M=7) Speculative Acceleration (rc_stockfish.h, ngram-map.cpp)
On a CPU-hosted Sparse MoE + Mamba-2 hybrid (Nemotron-3.5-30B-A3B), every drafted token activates additional routed experts from DDR5 RAM (~0.30x single-token cost per drafted token) and any rejected token triggers an 18.4 MB Mamba-2 recurrent state rollback (slot.spec_ckpt). Consequently, net wall-clock speedup follows the CPU-MoE Golden Equation:
During the RouteCrack research campaign (96+ techniques documented in speculative/ROUTECRACK_TECHNIQUES.md), several high-recall predictors could not be enabled in production because static predictors trained on the same corpus make correlated errors when confidence drops below 84%.
StockfishDrafter (speculative/cpp/rc_stockfish.h) + ngram-map.cpp solve this by maintaining a 192 KB L2-resident (3 × 64 KB Zobrist Transposition Tables tt5, tt4, tt3, < 19% of Core 0's 1 MB L2 cache on Zen 5), zero-allocation search state updated continuously on the live session stream:
-
Multi-Order Lockless Zobrist Transposition & Refutation Tables (
tt5,tt4,tt3=192 KB) with 32-bit verification keys (key32), verifiedbest_move, explicitrefuted_movetracking, and Stockfish History Gravity ([-512, +512]). -
1-Ply Quiescence Lookahead & Multi-Branch Conflict Disambiguation (in
ngram-map.cpp): QueriesStockfishDrafter::query()at each rollout step$d=0..6$ (M=7) to resolve 1-ply horizon choices and disambiguate conflicting in-context suffix matches.
The 4 RouteCrack Techniques Unlocked by Stockfish-PVS v2:
-
Technique #1 — Online Session Trie Rescue (
rc_trie_v2.h+Stockfish-PVSGate):- Rescues novel in-session identifiers, variable names, and file paths when the static 8-level FNV-64 Hash Cascade misses (
best_conf < min_c), providedOnlineTrieV2has session support (ot_cnt >= 2,ot_conf >= 0.78) and is confirmed by the orthogonalStockfishZobrist TT (sf_has_cand, orot_cnt >= 4 && ot_conf >= 0.90). -
Marginal Precision:
92.19%(+59accepted tokens, only5wasted).
- Rescues novel in-session identifiers, variable names, and file paths when the static 8-level FNV-64 Hash Cascade misses (
-
Technique #2 — Top-4 Cascade Disambiguation via Orthogonal Zobrist TT:
- Inspects
tok[1..3]inhc_top4_k*.binwhenevertok[0]falls in the uncertain band (0.55 <= c0 < min_c). If an alternativealt_thas a strong live-session Zobrist TT match (alt_sf >= 640, exacttt5/tt4hit) that strictly beatstok[0](alt_sf > sf_t0 + 250),Stockfish-PVSpromotesalt_t.
- Inspects
-
Techniques #5 & #89 — 11,382-Entry Multi-Token Macro Codebook (
macro_codebook.bin):- Enables multi-token structural chains (
1..15tokens long,>= 90%empirical precision) at$d=0$ and unlocks Singular Horizon Extension across the macro chain. -
Marginal Precision:
91.81% -> 96.44%(+92accepted tokens, only8wasted).
- Enables multi-token structural chains (
-
Techniques #17 & #73 — Singular Horizon Extension (
--spec-ngram-simple-size-m 7) & Consensus Integrity Fix:- Extends the draft horizon from
$D=4$ (M=5) up to$D=7$ (M=7) exclusively on "singular" beams: verified 2-hit in-context trajectories (true_consensus_hits == d), Macro Codebook chains (used_macro), or Singular Cascade + Stockfish TT locks (best_conf >= 0.95 && sf_best >= 600). -
Consensus Integrity Fix: Separates
true_consensus_hits(strictly 2-hit in-context matches) fromconsensus_hitsso single-hit context matches rescued byRouteCrackat$d=0..2$ cannot masquerade as 2-hit trajectories at$d \ge 3$ . -
Marginal Precision at
$D=5..7$ :98.18%(M=6) to98.74%(M=7:+78accepted tokens,1wasted,-7rollbacks).
- Extends the draft horizon from
2. 📊 Verified Benchmarks: Held-Out Ablation (77,456 Tokens) & Live Production Telemetry
A. Held-Out Corpus Ablation (77,456 Nemotron-3.5 Tokens, 351 Contexts — speculative/cpp/test_synergy.cpp)
| Speculative Configuration | Drafted ( |
Accepted ( |
Wasted ( |
Token Precision | 0-Rollback Steps | Mamba-2 Rollbacks | CPU-MoE WallGain |
|---|---|---|---|---|---|---|---|
1. RouteCrack Baseline (M=5, Static Cascade) |
6,332 | 5,440 | 892 | 85.91% |
87.31% |
482 | +3,540.4 |
2. + Stockfish-PVS v1 (M=5, Zobrist TT + PVS) |
6,329 | 5,459 | 870 |
86.25% (+0.34%)
|
87.84% (+0.53%)
|
461 (-21) |
+3,560.3 (+19.9)
|
3. + Stockfish-PVS v2 Sweet Spot (M=7, +Trie +Top4 +Macro +Singular) |
6,555 | 5,663 | 892 | **86.39% (+0.48%) ** |
**88.35% (+1.04%) ** |
**450 (-32) ** | **+3,696.5 (+156.1) ** |
+223additional accepted tokens (5,440 -> 5,663) with ZERO additional wasted tokens (892 -> 892,100.0%net marginal precision) and-32fewer Mamba-2 rollbacks (482 -> 450).
B. Live 5-Stage Production Benchmark (AMD Ryzen 9 9955HX, 0 GPUs, 22.2K -> 27.7K Context)
Stage & Workload (Nemotron-3.5-30B-A3B-Q4_0) |
Active Context | M=5 Speed (Avg / Peak) |
Stockfish-PVS v2 (M=7) Speed (Avg / Peak) |
Draft Acceptance (Acc / Drafted) |
Mean Spec Length (tok/step) |
|---|---|---|---|---|---|
Atto 1A: Warm TTFT + <tool_call> Read (50 tok) |
22,299 tok |
30.84 tok/s (2.60 s) |
34.52 tok/s (2.45 s wall) |
83.33% (35 / 42) |
4.18 tok/step |
Atto 1B: Prefill harp_cache.py (3,089 tok) + 500 tok Code |
25,388 tok |
40.91 / 45.43 tok/s (12.22 s) |
48.39 tok/s avg / 60.40 tok/s peak (10.33 s) |
96.39% (401 / 416) |
6.90 tok/step (up from 5.47) |
Atto 2A: Thread-Safe Refactoring (400 tok Mixed Code) |
26,419 tok |
27.80 / 41.20 tok/s |
28.61 tok/s avg / 48.47 tok/s peak |
86.10% (223 / 259) |
4.66 tok/step |
Atto 2B: From-Scratch Concurrent Stress Test (350 tok) |
26,431 tok |
18.61 / 21.84 tok/s |
18.66 tok/s avg / 21.89 tok/s peak |
56.38% (53 / 94) |
2.33 tok/step |
Atto 3: Architectural & Security Audit in Italian (350 tok) |
26,959 tok |
18.58 / 20.50 tok/s (80.6% acc) |
18.76 tok/s avg / 20.78 tok/s peak |
85.00% (34 / 40) (up from 67.4%) |
2.48 tok/step |
Live Multi-Turn Claude Code Session (4,096 tok Turn 3) |
27,713 tok |
19.00 / 30.87 tok/s (59.1% acc) |
20.68 tok/s avg / 39.28 tok/s peak (-17.5 s) |
67.98% (1,055 / 1,552) |
2.68 tok/step |
3. 🌍 Multi-Platform Support & SSE Gateway Enhancements (Co-Authored with @jarorosFork / Oleksandr Nazar)
Integrated community contributions from Oleksandr Nazar (@jarorosFork) (commits 9509f4c, 93b6381, d740063 -> 6694b0b):
apple-silicon/— Apple Silicon (M4 Pro 24 GBUnified Memory) Metal Stack:- Dedicated setup & benchmark scripts (
apple-silicon/README.md,apple-silicon/run-server.sh,apple-silicon/run-gateway.sh,apple-silicon/bench.sh,apple-silicon/bench_spec.sh,apple-silicon/bench_server.py,apple-silicon/agent_loop_test.py) runningNemotron-3.5-30B-A3Bat47–49 tok/sdecode and256–549 tok/sprefill up to 128K context (384 MBKV cache,0swap).
- Dedicated setup & benchmark scripts (
fedora/— Fedora 44 / AMD Ryzen 7 8745HS (GEEKOM A8, 8C/16T Zen 4, 64 GB DDR5):- All-in-one setup, server, gateway, and browser web chat UI (
fedora/nemotron.sh).
- All-in-one setup, server, gateway, and browser web chat UI (
gateway/sse_gateway.py— Tool-Call Resilience & Cross-Platform Portability:_write_as_bash()Fallback: Automatically converts raw multilineWritetool calls into safecat << 'EOF' > ...Bashcommands viashlex.quote()when unescaped quotes in100+line code payloads break LLM JSON string serialization._coerce_xml_param()Schema-Aware Coercion: Coerces XML<function=Name><parameter=key>value</parameter></function>parameters to native JSON integers, numbers, booleans, arrays, or objects using the client's tool JSON schema (_extract_param_types()).- Portable
HARP_CACHE& Environment Config: Safely guards/dev/shmusage on macOS (os.path.isdir("/dev/shm")) and addsGATEWAY_HOST,GATEWAY_CORS_ORIGIN, andGATEWAY_SYSTEM_PROMPTenvironment variables.
4. 🛡️ Microarchitectural & Documentation Audit Fixes
- Bit-Exact C++ & Patch Verification: Verified
0diff betweenpatches/zen5-nemotron-256k-optimizations.patch/speculative/cpp/and the live production engine on our Zen 5 testbed. - Transparent Layer & KV Accounting: Clarified across
README.md,ARCHITECTURE.md, andFAQ.mdthe exact distinction between the52logical blocks (23 Mamba-2 SSM + 23 Sparse MoE + 6 GQA,46non-attention tensor blocks) and the exact 256K KV cache sizes (384 MBraw /432 MBsymmetricQ4_0& dynamic EAKVQ8_0/Q4_0vs624 MBstatic--cache-type-k q8_0 --cache-type-v q4_0). - Automated Build & Service Integration: Updated
install.sh,scripts/build_zen5_llama.sh,systemd/nemotron-256k.service,scripts/llama_modchip.py, andscripts/check_cpu_readiness.pyto deployspeculative/cpp/rc_stockfish.hand--spec-ngram-simple-size-m 7out of the box.
🔧 v2.0.0 — llama-modchip (v0.9 Public Beta): "Priiloader for CPU GGUF Inference"
- Introduced
scripts/llama_modchip.py: Model-agnostic.ggufbinary header inspector (< 5 ms), Linux CPU/L3/THP topology profiler, Architecture Safety Locks (LLAMA_SWA_STRIDE=43:1 Interleaved SWA for Pure GQA models), and live 48-byte/dev/shm/llama_modchip.binruntime controller + Curses TUI. - Verified across 4 GGUF architectures on Dual-CCD AMD Ryzen 9 9955HX (
Nemotron-3.5-30B-A3Bat 256K,Qwen3-30B-A3Bat+38.5%decode viaLLAMA_MOE_TOP_K=4,Nemotron-H-8B, andLlama-40L).