<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Roy Mu</title>
    <description>The latest articles on DEV Community by Roy Mu (@nalaginrut).</description>
    <link>https://dev.to/nalaginrut</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F470655%2F030aa535-cdce-40a8-b090-00fb6b1ce6d2.jpeg</url>
      <title>DEV Community: Roy Mu</title>
      <link>https://dev.to/nalaginrut</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/nalaginrut"/>
    <language>en</language>
    <item>
      <title>Squeezing an RTX 3050: fast and exact LLM inference with SonicBoom</title>
      <dc:creator>Roy Mu</dc:creator>
      <pubDate>Wed, 11 Nov 2026 08:22:21 +0000</pubDate>
      <link>https://dev.to/nalaginrut/squeezing-an-rtx-3050-fast-and-exact-llm-inference-with-sonicboom-mgl</link>
      <guid>https://dev.to/nalaginrut/squeezing-an-rtx-3050-fast-and-exact-llm-inference-with-sonicboom-mgl</guid>
      <description>&lt;p&gt;Recently I released SonicBoom v0.0.6. SonicBoom is a PyTorch alternative, and I chose my favorite GNU Guile as its first-class language. I feel comfortable that I can finally do AI things with Scheme. There is no Python anywhere at runtime. The Python ecosystem caused me a lot of pain in product deployment, and now it's gone. The SBOM is reduced to a minimum, and we know what we deploy.&lt;/p&gt;

&lt;p&gt;These days most people prefer not to type code by themselves (I still write the compiler and key infra myself), so the meaning of a programming language is the safety and optimization that come from the nature of its features. I'll have another post about programming languages in the AI era.&lt;/p&gt;

&lt;h2&gt;
  
  
  My idea is a bit old school hacker
&lt;/h2&gt;

&lt;p&gt;I only have an RTX 3050. I once considered buying a 4090 or 5090 for my AI research, that's the mainstream. But I suddenly remembered John Carmack once said in 2013:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"There's so much you can still do on the previous console generation."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Besides, the mainstream autonomous driving chip has a similar config, say, NVIDIA DRIVE Orin-X / Jetson AGX Orin. And on AWS, A10G has the same architecture as 3050 (sm_86) with bigger VRAM. It's good bang for the buck.&lt;/p&gt;

&lt;p&gt;So that's it, 3050 is good enough for a start.&lt;/p&gt;

&lt;p&gt;However, I'm not going to optimize specifically for the 3050. The optimizations must be general, so you get higher performance on a better GPU.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what did we get in v0.0.6?
&lt;/h2&gt;

&lt;p&gt;Speculative decoding is on by default, and it is exact. The tokens you get with speculation on are the tokens you get with it off, bit for bit, on every run.&lt;/p&gt;

&lt;p&gt;Qwen2.5-7B edits code at up to 523 tok/s on an RTX 3050 (8GB).&lt;/p&gt;

&lt;p&gt;Of course you may not want to use Qwen2.5-7B for code editing, it's too weak. But it shows the power of SonicBoom. Next, we're working on MoE, e.g. Qwen3.6-35B-A3B, with flexible memory management to run big MoE models on 8GB VRAM. It seems popular today to do so.&lt;/p&gt;

&lt;p&gt;The machine is a desktop RTX 3050 8 GB (sm_86, 20 SMs, roughly 200 GB/s of memory bandwidth) with a Ryzen 5 5500. The model is Qwen2.5-7B-Instruct Q4_K_M.&lt;/p&gt;

&lt;p&gt;The workload is code editing: ten requests, each pasting a 100–300-line source file and asking for an edit. Decoding is greedy, and the generation length is the file's length.&lt;/p&gt;

&lt;p&gt;The result is 471–523 tok/s for code editing. But when writing brand-new code, the speed drops back to about 41 tok/s. It's reasonable since code editing spends most of the time on copying rather than generation. But I would say code editing is one of the most common needs, so it's worth optimizing for it. The full benchmark is in the README.&lt;/p&gt;

&lt;p&gt;But speed is not the point; quality is. Speculative decoding is a double-edged sword: it raises the speed, but in most engines it also changes the output, because the drafted tokens are checked with different kernels than plain decoding uses.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why speculation usually changes the output
&lt;/h2&gt;

&lt;p&gt;Speculative decoding drafts several tokens cheaply, then checks them in one forward pass of the real model. The pass scores k+1 positions at once, and a drafted token is kept when it matches what the model would have produced. With greedy decoding this is lossless in exact arithmetic: you can only ever accept tokens the model would have picked anyway.&lt;/p&gt;

&lt;p&gt;GPUs don't do exact arithmetic. A verify pass is a batch of k+1 rows, while a plain decode step is a batch of one, and engines are built to pick kernels by batch shape. A matrix-vector kernel serves one row, a tiled matrix-matrix kernel serves sixteen, and the attention kernel splits its keys differently for different query counts. Each choice changes the order in which floating-point numbers are added up. That changes the last bits of the logits, and whenever two candidate tokens are close, the last bits decide which one wins. After one flipped token, the rest of the text goes its own way.&lt;/p&gt;

&lt;p&gt;That is why, in many engines, turning speculation on can change the output. It is also why a speedup claimed with speculation on is hard to judge. You are no longer comparing the same text.&lt;/p&gt;

&lt;h2&gt;
  
  
  How SonicBoom keeps every row exact
&lt;/h2&gt;

&lt;p&gt;However, this is just a simple case. In actual engineering, there are more things that make it complex:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3mcoa2w304upow3ljvw9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3mcoa2w304upow3ljvw9.png" alt=" " width="800" height="512"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;kernel selection by batch shape&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;split-K and stream-K&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;fused vs. unfused epilogues&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;split-KV attention partitions&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;online softmax rescaling&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;KV cache write paths&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;rollback of rejected drafts&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;sliding-window ring reuse&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;stopping inside a verify batch&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;timing-based autotuning&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;......&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;BTW, each of them has its own test in SonicBoom's test suite.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making verification cheap enough to matter
&lt;/h2&gt;

&lt;p&gt;Exactness only pays if verification is cheap. On this card, a plain Qwen2.5-7B step is about 24.6 ms, essentially the time to stream the weights once. A 16-row verify costs about 1.25× that. A 64-row verify costs about 2.9×, and when a 63-token draft is accepted, that one step emits 64 tokens.&lt;/p&gt;

&lt;p&gt;SonicBoom verifies up to 64 rows per step. Every row bucket (2 to 16, 24, 32, 48 and 64) is built, warmed and captured as a CUDA Graph when the model loads, so a verify step costs one graph replay.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reproducible, with stated limits
&lt;/h2&gt;

&lt;p&gt;SonicBoom's claim is: same version, same GPU model and same warm-up table give the same output. That includes seeded sampling: draws are keyed by seed, position and token id, so they don't depend on how the tokens were batched.&lt;/p&gt;

&lt;p&gt;The warm-up table is measured on your own GPU when a model loads. With the table imported, a second machine with the same GPU model skips measuring entirely and should produce the same tokens. We have checked this on one machine: export, import into an empty cache, zero re-measurements, identical hashes on all ten turns. We would like to see it across machines; see the benchmark issue at the end.&lt;/p&gt;

&lt;p&gt;What is not covered yet is batched serving: several requests sharing one batch.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why reproducibility matters
&lt;/h2&gt;

&lt;p&gt;SonicBoom is an official project of HardenedLinux, an old-school hacker community. We care about security and individual sovereignty. Our philosophy is "for fun and for profit". SonicBoom is one of our choices to help individuals get affordable AI power, and we also use it for serious products that require security. Reproducibility is critical in security and auditing.&lt;/p&gt;

&lt;p&gt;When the same input gives the same output, you can replay any answer, explain it, and prove it hasn't changed. That is trustworthy AI.&lt;/p&gt;

&lt;p&gt;Run it yourself&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/hardenedlinux/SonicBoom" rel="noopener noreferrer"&gt;https://github.com/hardenedlinux/SonicBoom&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And please help us benchmark v0.0.6 publicly:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/hardenedlinux/SonicBoom/issues/5" rel="noopener noreferrer"&gt;https://github.com/hardenedlinux/SonicBoom/issues/5&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
    </item>
    <item>
      <title>489.8 tok/s, QWen2.5 7B on RTX3050 for code edit, reproducible decoding</title>
      <dc:creator>Roy Mu</dc:creator>
      <pubDate>Mon, 09 Nov 2026 13:49:52 +0000</pubDate>
      <link>https://dev.to/nalaginrut/4898-toks-qwen25-7b-on-rtx3050-for-code-edit-reproducible-decoding-a0a</link>
      <guid>https://dev.to/nalaginrut/4898-toks-qwen25-7b-on-rtx3050-for-code-edit-reproducible-decoding-a0a</guid>
      <description>&lt;p&gt;This is the v0.0.5 update. It's about one thing: speculative decoding that's fast and doesn't change the output.&lt;/p&gt;

&lt;p&gt;Same RTX 3050 8 GB, Qwen2.5-7B-Instruct Q4_K_M, same GGUF for both runtimes. llama.cpp 43fe9c64281 with -ngl 99 -fa on, using the fastest of llama-server's eight speculative modes (ngram-mod). The workload is 10 turns, each editing a 100–300-line source file, greedy.&lt;/p&gt;

&lt;p&gt;SonicBoom   llama.cpp&lt;br&gt;
Code editing, speculative   489.8 tok/s&lt;br&gt;
Turns identical, spec on vs off 10 / 10&lt;br&gt;
Decode, spec off, ctx 512 / 4K  40.6 / 38.2&lt;br&gt;
Prefill 512 / 8K tokens (wall)  1557 / 1200&lt;br&gt;
Plain decode and prefill are still slightly behind. The speculative row is 12.7× our own plain decode, and every verified token is exactly what a plain decode step would have produced.&lt;/p&gt;

&lt;p&gt;How the outputs stay identical:&lt;/p&gt;

&lt;p&gt;the quantized matmul is column-invariant;&lt;/p&gt;

&lt;p&gt;verify attention partitions keys by absolute position and reduces rows in a fixed order;&lt;/p&gt;

&lt;p&gt;any kernel choice that affects numerics is made once at load and sealed.&lt;/p&gt;

&lt;p&gt;So row i of a 64-row verify batch carries the same bits as decode step i. That's why speculation is on by default.&lt;/p&gt;

&lt;p&gt;The drafter is a long-match n-gram one (up to 63 tokens per proposal). It wins wherever the output copies the input: edits, revisions, refactors. Coding chat gets 4.4×.&lt;/p&gt;

&lt;p&gt;We only have sm_86. If you have another NVIDIA card with 8 GB or more, the benchmark issue has copy-paste commands that run all of the above against llama.cpp. There's also an optional check that two machines with the same GPU produce the same token hash:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/hardenedlinux/SonicBoom/issues/4" rel="noopener noreferrer"&gt;https://github.com/hardenedlinux/SonicBoom/issues/4&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/hardenedlinux/SonicBoom" rel="noopener noreferrer"&gt;https://github.com/hardenedlinux/SonicBoom&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
    </item>
    <item>
      <title>Calling all GPUs: help us benchmark SonicBoom v0.0.3 — a compiler-first AI runtime that beats llama.cpp on decode</title>
      <dc:creator>Roy Mu</dc:creator>
      <pubDate>Mon, 19 Oct 2026 10:42:39 +0000</pubDate>
      <link>https://dev.to/nalaginrut/calling-all-gpus-help-us-benchmark-sonicboom-v003-a-compiler-first-ai-runtime-that-beats-4kia</link>
      <guid>https://dev.to/nalaginrut/calling-all-gpus-help-us-benchmark-sonicboom-v003-a-compiler-first-ai-runtime-that-beats-4kia</guid>
      <description>&lt;p&gt;Hi folks!&lt;/p&gt;

&lt;p&gt;We are HardenedLinux, an old-school free software community. SonicBoom is our open-source (GPLv3) inference runtime: a compiler-first alternative to the usual Python stack. No Python at build or run time — one shared library, a C ABI, and Guile Scheme as the first-class language.&lt;/p&gt;

&lt;p&gt;What v0.0.3 does on a desktop RTX 3050 8 GB (same session, same GGUF, vs llama.cpp -ngl 99):&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdraxieelqskl1iummtfp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fdraxieelqskl1iummtfp.png" alt=" " width="753" height="140"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On real multi-turn agent workloads, time-to-first-token dropped several-fold since v0.0.2 (prefix reuse + plan caching). Output tokens are bit-identical to our golden runs, and prefix reuse is bitwise identical to a full prefill.&lt;/p&gt;

&lt;p&gt;How: all graph optimization and kernel generation happen on Boom IR, an MLIR dialect; hot quantized matmuls run as attributed ggml-derived kernels. Every optimization has a switch and an ablation number, so you can see what each one buys.&lt;/p&gt;

&lt;p&gt;Where we are honest about gaps: Qwen decode at depth 512 is 0.98×, and we have only one GPU. That is exactly why we need you.&lt;/p&gt;

&lt;p&gt;The invitation: every release gets one benchmark issue. If you have an NVIDIA GPU (any generation — Ada, Hopper, Blackwell especially welcome), one command produces a report you can paste. Everyone whose results we publish is credited in the README.&lt;/p&gt;

&lt;p&gt;→ v0.0.3 benchmark issue: &lt;a href="https://github.com/hardenedlinux/SonicBoom/issues/2" rel="noopener noreferrer"&gt;https://github.com/hardenedlinux/SonicBoom/issues/2&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Please post results and problems in the issue rather than here, so everything stays in one place.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>gpu</category>
      <category>llm</category>
    </item>
    <item>
      <title>SonicBoom: 52 tok/s decode on a laptop RTX 3050 (llama.cpp: 45) with the same quantized kernels, the difference is a graph compiler. No Python.</title>
      <dc:creator>Roy Mu</dc:creator>
      <pubDate>Tue, 13 Oct 2026 18:16:49 +0000</pubDate>
      <link>https://dev.to/nalaginrut/sonicboom-52-toks-decode-on-a-laptop-rtx-3050-llamacpp-45-with-the-same-quantized-kernels-24kj</link>
      <guid>https://dev.to/nalaginrut/sonicboom-52-toks-decode-on-a-laptop-rtx-3050-llamacpp-45-with-the-same-quantized-kernels-24kj</guid>
      <description>&lt;p&gt;I’ve been building SonicBoom, a native tensor runtime written in C++/CUDA with a C ABI and no Python anywhere in the stack. I just tagged v0.0.1, and the first target is local LLM inference on consumer GPUs.&lt;/p&gt;

&lt;p&gt;Numbers (Gemma 4 E4B-it Q3_K_M on a laptop RTX 3050 8 GB, both runtimes using the same GGUF on the same machine, llama.cpp at commit 43fe9c64281):&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       SonicBoom                    llama.cpp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Decode (tg64)           51.65 tok/s         45.20 tok/s&lt;br&gt;
Decode @ depth 2048 47.13 tok/s         45.21 tok/s&lt;br&gt;
Prefill 4100 tokens 1051 tok/s          ~1944 tok/s&lt;br&gt;
TTFT, 4000-token prefix + 100 new   503 ms (prefix reuse)   &lt;/p&gt;

&lt;p&gt;Why it matters: the quantized matmul kernels (MMVQ/MMQ) are ported from ggml, so the kernels are the same ones llama.cpp uses. The 14% decode lead comes entirely from the layer above them. A graph planner rewrites the model before it runs: activations are quantized once and reused, norm and activation are fused with quantization, dead computation is removed, and each decode step is captured and replayed as a single CUDA Graph. Code derived from ggml is about 8% of the core. The rest is the runtime.&lt;/p&gt;

&lt;p&gt;Prefix reuse is exact: a continuation is token-for-token identical to a full prefill, which makes multi-turn chat and coding-assistant workloads cheap.&lt;/p&gt;

&lt;p&gt;What it can’t do yet:&lt;/p&gt;

&lt;p&gt;Prefill is about half of llama.cpp. It is a real batched path (int8 tensor-core plus cuBLAS), but there’s more to close.&lt;br&gt;
One verified model: Gemma 4 E4B. The quant formats are Q3_K, Q4_K and Q5_K only, so most Q4_K_M files from Hugging Face won’t load yet because they mix in Q6_K and Q8_0. Those formats are next, along with Qwen.&lt;br&gt;
It has only been tested on sm_86 (RTX 30-series), and sampling is greedy only.&lt;/p&gt;

&lt;p&gt;It’s not a drop-in llama.cpp replacement yet. The point of v0.0.1 is to show that the architecture works: once a graph compiler sits on top of the same kernels, the remaining gains come from the compiler instead of more hand-written kernels. Next on the roadmap are MLIR GPU codegen, speculative decoding, and more formats.&lt;/p&gt;

&lt;p&gt;GPL-3.0. Benchmark conditions, reproduce commands and the model sha256 are in the README:&lt;br&gt;
&lt;a href="https://github.com/hardenedlinux/SonicBoom" rel="noopener noreferrer"&gt;https://github.com/hardenedlinux/SonicBoom&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>computerscience</category>
      <category>sonicboom</category>
      <category>compiler</category>
    </item>
  </channel>
</rss>
