Repository navigation
Gemma 4 26B-A4B BITCOS Mixed-Ternary on OpenVINO GPU (64k Lossless FP16 KV): 69.2 tok/s Short, 55.9 tok/s at 32k, 50.7 tok/s at 64k on One Intel Arc A770 #40404
TheSanchezian
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The first truly accurate flagship BITCOS mixed-ternary MoE on #IntelOpenVINO — without the dense slowdown.
Gemma 4 26B MoE: near-lossless parity, 64k verified recall, zero draft heads.
69.2 tok/spure base decode ·55.9 tok/sat 32k ·50.7 tok/sat 64k ·11.04 GBflat VRAM · one consumer Intel Arc A770.Let's keep this 100% real — no cherry-picked eval harnesses, no hidden draft heads inflating base speeds, and no pretending a low-bit quant is magically "identical to FP16." Here is the full story: what broke, what failed, how I directed a multi-AI engineering team past its own defaults, and every raw benchmark receipt.
The Truth About Low-Bit & Ternary Benchmarks
If you watched Unbiased Bob's timed coding review of Ternary Bonsai 2.5 27B, you saw the exact gap between ultra-low-bit marketing and real-world agentic behavior: run-on zero loops, constraint drift, bloated reasoning tokens, and a uniform dense ternary quant that couldn't match clean 4-bit baselines despite bundling an MTP draft head.
That's why we built Gemma 4 26B-A4B as a mixed-precision BITCOS MoE instead of uniform dense ternary:
OSV32custom OpenCL kernels)u8KV against bank-conflict-freehalf4FP16Split-K=128on realPERF=NOwall time and lossless FP16 beatu8outright (2.08 msvs3.00–3.63 msper 5 global layers)!The Engineering Story: Why Managing AI Beats Putting AI on Autopilot
This project was built by directing frontier models like a specialized systems team — Gemini Neon writing the custom OpenCL kernels, OpenVINO IR rewrites, and server, with Claude Opus acting as the independent adversarial reviewer.
And honestly? The funniest and most important lesson was seeing what happens when you don't challenge your AI agents vs. when you do:
Act 1 — The Original Custom Kernels Hit a Brick Wall (
25.9 tok/s):Gemini Neon wrote our first custom Gemma 4 BITCOS kernels from scratch, and we brought in Carbon for architectural review. Look — credit where it's due, Carbon helped catch an early
head_dim=512SDPA NaN, but ugh, Carbon did not perform on speed. Both Neon and Opus outperformed him individually 😂. We stayed stuck at25.9–29.4 tok/s(1,143compiled ops,540Reorders,ScatterUpdateKV,DQ=64), collapsing all the way to17.6 tok/sat32k.Act 2 — Challenging the "
50 tok/sCeiling" & Forcing the Nemotron Kernel Baseline Pivot:Here's the best part: Gemini Neon, Carbon, and Claude Opus all originally said this model couldn't go past
50 tok/son a single Arc A770. I didn't buy it — I already knew my Nemotron 3.5 Lightning 30B-A3B ternary OpenVINO kernels (standard ternary, not BITCOS) ran96–103 tok/son this exact consumer card. So I brought in Claude Opus to review, challenged Opus after his initial review, and forced the team to go my way: stop tweaking slow stock paths, take my proven Nemotron custom-kernel architecture as the speed baseline (DQ=0, mask-free in-place KV,0Reorders,OSV32layouts, fused OpenCL dispatches), and modify it to run lossless BITCOS v5 +100% INT8QKV/O on Gemma 4's hybrid sliding+global MoE graph.50 tok/sceiling estimate — we hit69.2 tok/sshort (greedy500,2.67×over baseline;p10 71.8 tok/s),55.9 tok/sat32k(3.18×over Step 6A's17.6 tok/s!), and still stayed above50 tok/s(50.7 tok/s) all the way out at64,000tokens (1,143 → 350ops,540 → 0Reorders), plus eliminated host waits in OpenVINO GPU'sReadValue/Assignpath — opened Oct 31 and merged upstream in openvinotoolkit/openvino#39378!Act 3 — Out-of-the-Box Human Calls That Unlocked Every Last Gain:
--pld: When lossless Prompt Lookup Decoding hit78.3 tok/son code refactoring but slowed down thinking/prose (0.77–0.81×) from false-positive 2-gram matches, I told Neon to gate--pldstrictly to fenced code blocks after<channel|>closes. Thinking/prose went back to1.00×(0%overhead), and code refactoring jumped to93.3 tok/s(up to 1.43×on code editing,100%bit-exact,0 MBdraft head)! (Fresh code from scratch accepts less — keeping it honest!)12k → 32k → 64k): Our first LiveCodeBench run clipped4/5hard problems mid-code at a12ktoken cap (1/5 = 20%). I challenged the artificial cap — "why cut it off at 12k? If it finishes earlier, it finishes earlier!" We restarted with the full32kwindow and immediately watched it rip4/4(100%:1easy,1medium at25,620tok @55.4 tok/s,2/2hard) and finish IFEval-50 at48/50(96.0%strict /98.0%loose,0cutoffs)! Then we went all the way to64klocked lossless FP16 KV (+25 MBon disk,+0.69 GBVRAM) and reran every32kcutoff honestly.Full Speed & Live Flat VRAM Telemetry (Single Consumer Intel Arc A770 16 GB)
No VRAM creep while thinking or writing — completely flat across
500to64,000tokens (0.000 GBshared spill,~5.0 GBfree VRAM headroom left on a 16 GB card!):tok/s)tok/s)p10greedy500)69.18 tok/s13.93 ms11.040 GB0.000 GB0500tok248.4 tok/s67.36 tok/s14.52 ms11.040 GB0.000 GB08,000tok238.8 tok/s60.36 tok/s16.11 ms11.040 GB0.000 GB032,000tok210.1 tok/s55.86 tok/s17.47 ms11.040 GB0.000 GB048,000tok193.7 tok/s53.30 tok/s18.36 ms11.040 GB0.000 GB064,000tok179.8 tok/s50.72 tok/s19.32 ms11.040 GB0.000 GB00–32k,10/10PASS):live_8k_qaKL=0.1814/85.5%top-1,live_28k_qaKL=0.1825/87.2%top-1,8/84kbands ofmodel_32kPASS, zero wrap spike at1016..1056.56k3-Needle Recall (55,092prompt tok, thinking ON):3 / 3exact passcodes (Start + Middle + End) at187.4 tok/sread ·52.17 tok/swrite ·11.040 GBflat VRAM ·0NaNs.Straight Raw Benchmarks — Zero Harness, Full Transparency
Official Gemma 4 sampling (
think=on,--think-budget 0= unlimited,temp=1.0,top_p=0.95,top_k=64), unmodifiedgoogle-researchIFEval+ WSL sandboxedLiveCodeBenchscorers (50-problem subsets atpass@1, so expect±several pointsvariance):pass@150/50)96.0%strict /98.0%loose48/492/1052.3 tok/s3,348/193032kcap)62.0%(31 / 50)3111856.1 tok/s10,212/5,556264kcap)62.0%(31 / 50)3118152.4–56.2 tok/s177.1%full LCB v6 mix; Google does not publish IFEval):easy 6/6 (100%)·medium 16/19 (84.2%)·hard 9/25 (36.0%).64k& EAGLE-3:32k → 64kcut LCB truncations from8 → 1(running up to64,927generated tokens at52.4 tok/s!) and dropped loops to1 / 100across both suites — while honestly showing that the 8 ultra-hard problems burning>32ktokens still missedpass@1.economize-eagle3):100%exact KV rollback verified, but with our currentM=1-optimized verify kernels (31.4 msatM=4) +12.7 msdraft/sync, pure base decode beats EAGLE-3 outright (62.6–69.2vs34.2–42.5 tok/s). Future small-Mgrouped kernels + lighter sync could flip that — until then, we ship clean with zero draft heads!Download & Run on Try #1 (Self-Contained on Hugging Face)
Hugging Face: https://huggingface.co/TheSanchezian/Gemma-4-26B-A4B-BITCOS-Ternary-OpenVINO-A770
Everything is bundled in one download:
9.48 GBOpenVINO IR + custom OpenCL ops + stdlib OpenAI-compatible server + matching Apache-2.0 OpenVINO2026.4.1-63022Windows Python 3.12 wheel + patchedopenvino_intel_gpu_plugin.dll(also mirrored onTheSanchezian/Nemotron-3.5-Lightning-30B-A3B-Ternary-OpenVINO-A770) + full SHA-256MANIFEST.mdandREADME_run.md.The Bigger Picture: Efficiency Beats Raw Power
This flagship mixed-ternary MoE was built to prove one thing: Ternary Hybrid Architectures actually work — at near-lossless accuracy, real 64k context, and sustained
50–69 tok/sspeeds on a single consumer Intel Arc A770. That alone shows how far smart quantization and custom kernel architecture can go toward bringing AI inference costs down from massive data centers to everyday hardware. I genuinely believe efficiency can beat raw brute-force power — it's all about architecture.Next up: dropping my MustacheOS wrapper on top of this exact server for an honest Raw vs. MustacheOS comparison — and wiring live multimodal Vision (our INT8 vision encoder is already exported & verified at
0.9993cosine similarity in the repo!) intov1.1!All reactions