Bw24 – from scratch rust+CUDA inference, every kernel tuned for sm_120a A developer known as Avifenesh released Bw24, a from-scratch LLM inference engine in Rust and CUDA tuned for NVIDIA's RTX 5090 Laptop GPU (Blackwell sm_120a, 24 GB), achieving up to 2.3x speedup over llama.cpp via MTP speculative decoding while guaranteeing token-identical outputs. The engine supports six models including Qwen and Gemma variants, ships with prebuilt Linux binaries, and is designed for single-user, single-GPU serving on RTX 50-series cards. From-scratch LLM inference engine in Rust + CUDA, built for one machine: an RTX 5090 Laptop Blackwell sm 120a, 24 GB . No frameworks, no ggml — every kernel written and tuned against measured hardware limits, with llama.cpp as the benchmark to beat on the same rig. The headline capability is MTP speculative decoding : up to 2.3x over llama.cpp's best spec config, leading on every supported Qwen model and prompt class 1.06-2.30x per cell , with trimmed drafter heads published ready-to-use huggingface.co/Avifenesh/bw24-bench https://huggingface.co/Avifenesh/bw24-bench — behind a drop-in OpenAI-compatible server. Exactness is the contract: speculative output is gated token-identical to plain decode, so the speedup never changes what the model says. Use bw24 when you serve one model to one user on an RTX 50-series card and want measured, exactness-gated speed. Use something else when you have any other GPU llama.cpp https://github.com/ggml-org/llama.cpp , mistral.rs https://github.com/EricLBuehler/mistral.rs or need multi-GPU / batched serving vLLM, SGLang . Running bw24 on your own rig — desktop 50-series, older NVIDIA, anything? A hardware validation report /avifenesh/bw24/blob/main/.github/ISSUE TEMPLATE/hardware-validation.md is the fastest way to help: 50-series reports bless the rest of the family, older-card reports map the compatibility floor. Current standing: six supported models, all fully gated. Qwen leads llama.cpp on every cell plain 1.06-1.08x, spec 1.06-2.30x . Gemma leads decisively where llama lacks the capability or the depth 31B spec 1.7k 1.16x, E4B spec ≥1.23x, E4B plain 1.10x and sits at 0.99-1.06x elsewhere under the strictest best-vs-best pairing 2026-07-15 re-audit . Every number below is a same-session, same-prompt, interleaved measurement against llama.cpp's best config; exactness is gated argmax match + speculative self-consistency on every kernel change, so speed never buys different outputs. | Tier | Models | State | |---|---|---| Supported | Qwen3.5-9B, Qwen3.6-27B, Qwen3.6-35B-A3B MoE NVFP4/IQ4 XS ; Gemma-4 26B-A4B MoE, 31B dense, E4B QAT Q4 0 + MTP drafters | Board-published, fully gated, exactness-first; margins per model in the tables below | Supported, under tuning | Hy3 Layer103.5 overlay VRAM→RAM→dual-NVMe spill | Runs end-to-end through bw24-native CPU/GPU serving, correctness-gated on the 5090 target; see | In progress Prebuilt Linux x86 64 binaries sm 120a ship with each release https://github.com/avifenesh/bw24/releases — or build from source: cargo build --release ./target/release/kernel-check every kernel vs CPU reference BW24 CHAT=1 ./target/release/run-gen /path/to/model.gguf --prompt "Explain KV caches." BW24 SPEC K=3 ./target/release/run-spec /path/to/qwen36-27b.gguf MTP speculative ./target/release/run-gen hf:owner/repo:Q4 K M --prompt "hi" auto-download from HF needs hf CLI ./target/release/frspec-owngen model.gguf trim.gguf --validate build + validate an FR-Spec draft trim from the model's OWN generations ./target/release/bw24-server OpenAI-compatible /v1 Expected output — kernel-check ends with: ALL GREEN: kernels match CPU reference. and run-gen prints its correctness gate before any generation: verify-prefill argmax=N decode argmax=N logit maxdiff=... MATCH Tuned paths are the defaults — no flags needed. Flags exist only for runtime parameters, machine config, and rollback seams docs/FLAGS.md . A MISMATCH line from the gate voids every number after it. Serving Hy3 a ~100 GB expert bank on this 24 GB card uses a frozen HBM resident set, a bounded host cache, and positioned dual-NVMe reads — runbook, ABI safety notes, and current gate results in docs/HY3-SPILL.md /avifenesh/bw24/blob/main/docs/HY3-SPILL.md . The paired native AVX-VNNI Q2 K path raises the local N=32 median from 4.37 to 4.60 tok/s across three interleaved, correctness-identical pairs +5.3% by arm medians; receipt /avifenesh/bw24/blob/main/research/per-expert-quant/evidence/local-5090-native-next-20260721/q2k-avxvnni-pair-win.md . Measured 2026-07-18 on the target rig RTX 5090 Laptop, N=2+ medians, both engines interleaved in the same thermal window on the same rig, same exact prompts, no flags tuned paths are defaults ; plain/depth rows from the 2026-07-09 validity-gated cold-start rebaseline, spec rows re-paired 2026-07-18, Gemma card rows from the 2026-07-15 best-vs-best re-audit. Full per-run logs: research/tune-data/ Qwen and research/gemma4-bringup/ Gemma — every win and every loss against llama.cpp built on the same machine, same exact prompts, both engines re-baselined the same day. Boards move with the tuning campaign — research/tune-data/rig5090.jsonl is the running record; the README is refreshed with every board-moving merge. Plain decode no speculation, tg128 at 512-token context : | Model | bw24 plain | llama.cpp plain | Ratio | |---|---|---|---| | Qwen3.5-9B NVFP4 GGUF | 135.7 | 126.7 | 1.07x | | Qwen3.6-27B NVFP4 GGUF | 48.4 | 44.9 | 1.08x | | Qwen3.6-35B-A3B MoE IQ4 XS | 178.2 | 167.8 | 1.06x | Depth is part of the contract: at 6.3k-token context every lead holds 1.02-1.07x . Speculative decoding MTP head, both engines at their measured best : | Model | bw24 spec | llama.cpp spec-best | Ratio | |---|---|---|---| | Qwen3.5-9B K=3 + own-gen trimmed draft | 281.0 / 211.7 / 187.1 | 122.2 / 121.5 / 117.7 | 2.30x / 1.74x / 1.59x | | Qwen3.6-27B K=3 + own-gen trimmed draft | 116.4 / 101.2 / 86.0 | 91.7 / 93.3 / 81.5 | 1.27x / 1.08x / 1.06x | | Qwen3.6-35B-A3B K=2 + own-gen trimmed draft | 280.6 / 259.6 / 258.0 | 236.5 / 174.6 / 173.5 | 1.19x / 1.49x / 1.49x | The three columns are three prompt classes: short code / medium code both greedy / long agentic, sampled at temp 0.7 with distribution-exact rejection sampling. One asterisk the log carries: the 35B short-code llama bar 236.5 rode an EOS-margin flip and is not a clean win basis — the other two 35B cells are. Every spec row uses one trimmed draft file built by the standard regime — the model's own-generation FR-Spec ranks, byte-verbatim MTP extraction, NVFP4 head + Q4 K M block docs/DRAFT-REGIME.md /avifenesh/bw24/blob/main/docs/DRAFT-REGIME.md . Drafts: use ours or build your own. Prebuilt per-model drafts exact pipeline, exact published bytes live at huggingface.co/Avifenesh/bw24-bench https://huggingface.co/Avifenesh/bw24-bench under drafts/