<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Raphael Pizzo on Medium]]></title>
        <description><![CDATA[Stories by Raphael Pizzo on Medium]]></description>
        <link>https://medium.com/@raphaelpizzo?source=rss-d45c09dd8484------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*Z6nbeDEKBQRPh0Ub</url>
            <title>Stories by Raphael Pizzo on Medium</title>
            <link>https://medium.com/@raphaelpizzo?source=rss-d45c09dd8484------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 10:53:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@raphaelpizzo/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[One GPU, Every AI Workload: Benchmarking the Intel Arc Pro B60 24GB for a Real Production Stack]]></title>
            <link>https://medium.com/@raphaelpizzo/one-gpu-every-ai-workload-benchmarking-the-intel-arc-pro-b60-24gb-for-a-real-production-stack-fe09afc6f15c?source=rss-d45c09dd8484------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe09afc6f15c</guid>
            <dc:creator><![CDATA[Raphael Pizzo]]></dc:creator>
            <pubDate>Mon, 12 Oct 2026 11:51:21 GMT</pubDate>
            <atom:updated>2026-10-12T11:51:21.012Z</atom:updated>
            <content:encoded><![CDATA[<p>Can a single $500-class open-ecosystem GPU run guardrails, transcription, RAG, a 27B chat model, medical OCR, typed decision-making, and image generation — all locally, all open-source? I measured everything. Here are the real numbers.</p><p><em>Published version — benchmark campaign, September–October 2026. All measurements reproducible; raw JSON for every request is archived. Portuguese full report available on request.</em></p><h3>The premise</h3><p>Every startup that adds “AI features” faces the same slippery slope: a guardrail API here, a transcription API there, an LLM subscription, an image-generation meter… until the invoice looks like enterprise software from 2010 and your users’ data lives in five different clouds.</p><p>We wanted to answer a different question: <strong>what if one dedicated GPU in the office ran the entire stack?</strong> No CUDA license, no per-token fees, no data leaving the building. The candidate: <strong>Intel’s Arc Pro B60 with 24 GB of VRAM</strong> — a single-slot, ~133 W card that idles at 15 W.</p><p>This article is the consolidated result of a multi-week benchmark campaign running <strong>real production workloads</strong> (clinical-nutrition platform traffic: Portuguese audio, real lab reports, real support tickets), measured in the units that matter for operations: classifications per second, minutes of audio per hour, decisions per second, images per minute.</p><p><strong>The stack, 100% open</strong>: vLLM (XPU backend), llama.cpp (Vulkan), OpenVINO, diffusers, and open-weight models.</p><h3>The rig</h3><ul><li>1× Intel Arc Pro B60 24 GB (Battlemage, XPU)</li><li>Ryzen 7 5700G host, 14 GB RAM, headless (frees all VRAM)</li><li>Power draw measured: <strong>133 W full load, 15 W idle</strong></li></ul><p>Method notes: medians of 3–5 repetitions, warmup discarded, p95 always recorded. Burst tests run for 10 sustained seconds. Every number below has a JSON with all individual requests behind it.</p><h3>Workload 1 — Guardrails: 39 classifications/second</h3><p>Content moderation is the first thing production stacks bolt on. Using Mistral’s Shieldstral-3B on vLLM with XPU graphs:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0tOYE5EkU776i-z-5XSl7A.png" /></figure><p>Prefill is a non-issue: <strong>174,000 tokens/second</strong>. An entire 8k-token document is processed in 46 ms. The bottleneck is decode — and it still rounds to ~19 fully-guardrailed conversations per second, per card.</p><h3>The challenger: Qwen3Guard-Stream-4B</h3><p>We also benchmarked Qwen’s newer Guard-Stream-4B — a fundamentally different design: instead of <em>generating</em> a verdict (~32 tokens), it’s a pure classifier that returns a calibrated risk level plus one of 9 categories in a <strong>single forward pass</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*niZ_c1Na-YE-SlSe7mdtmQ.png" /></figure><p>Honest read: on raw throughput it loses to Shieldstral <strong>because of the runtime, not the model</strong> — Shieldstral runs on vLLM with XPU graphs; Guard-Stream ran on plain transformers/eager (~6k tok/s prefill vs 174k). Once vLLM support lands (the model card says it’s coming), this architecture should leap ahead: no tokens generated, richer output (9 categories vs Shieldstral’s text verdict). For now: 30/s already guards 30 offices of 100 people.</p><h3>Workload 2 — Transcription: 15 hours of audio per hour</h3><p>VibeVoice-ASR on real clinical-consultation audio (Portuguese), concurrent chunking:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H1VMY6I3sLPFB38GbJmuog.png" /></figure><p>A clinic that records 6 hours of consultations per day burns ~25 minutes of GPU time on transcription. The queue never accumulates.</p><h3>Workload 3 — RAG: 3444 documents per minute</h3><p>Embedding (Qwen3-Embedding-4B) and reranking (Qwen3-Reranker-4B) as two vLLM instances on the same GPU:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/1*rmOJhSKszbkZHCZ73Mu40A.png" /></figure><p>Indexing a 100k-document knowledge base: ~8 minutes. Reranking 100 candidates per query: half a second.</p><h3>Workload 4 — The chat model: a 27B at conversation speed</h3><p>Qwen3.8–27B GPTQ-Int4 with native MTP speculative decoding on vLLM XPU:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*t9B5taQfWu1gGGxu32ju_w.png" /></figure><p>A 300-token reply completes in ~8.8 s; the card sustains ~4 simultaneous conversations at reading speed. For assisted writing (drafts, summaries), that’s comfortable throughput for a whole office.</p><h3>Workload 5 — The OCR case study: four architectures, one GPU</h3><p>This is the most instructive experiment of the campaign. We took 23 pages of real blood-test reports (ground-truth transcribed item by item — every analyte name, value, and unit) and ran the <em>same</em> benchmark through four radically different architectures.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aocZR7cf7Sa9Q7ra034p0Q.png" /></figure><p>Three findings worth the whole benchmark:</p><ol><li><strong>Failure modes are complementary and honest.</strong> The 9B nails dense 25-item hemograms at 100% but drops items on 5 oddly-laid-out pages; the ternary 27B is perfect on 18 simple pages and collapses to ~70% on the dense ones. In both, errors are <strong>omissions, never invented values</strong> — the property you actually need before letting an LLM near medical data.</li><li><strong>A 27B model in a 7.2 GB file</strong> (smaller than most 8B fp16 models) transcribes simple lab pages literally as well as a 17 GB Int4. Ternary quantization is real.</li><li><strong>The classical pipeline reads perfectly and understands nothing.</strong> PP-OCRv6 reads text at 0.74 s/page with 100% determinism — but structuring the report (name→result association, hemogram columns, relative vs absolute) is where generic rules die: 0% exact pages. That structural understanding is exactly what the VLM buys, and exactly what you pay 15 seconds for.</li></ol><p>Bonus: the 9B in single-stream mode (no competing requests) runs at <strong>3.0 s/page</strong> — currently capped by a batching bug in vLLM 0.21’s XPU graph path (documented below), not by the silicon.</p><h3>Workload 6 — Typed decisions: 4 answers per second, zero generated tokens</h3><p>A newer class of model: <strong>Cloudflare’s clef-flash</strong>, a 9B fine-tune of Qwen3.5–9B with a “joint schema head.” You hand it a state (a support ticket, a document, an image) plus typed questions — multiple-choice, true/false, or scored — and it returns <strong>a probability for every option of every question in a single forward pass</strong>. No generation. No output parsing. No JSON schema violations, ever.</p><p>Our test: real-world-shaped support tickets (billing disputes, in Portuguese) with 3 typed questions each (payment status classification, priority boolean, urgency score):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*H3eSVpxc-bfxyKloC4f_aA.png" /></figure><p>That’s <strong>14,000 typed decisions per hour, 340,000 per day, on one card</strong> — with every answer being a calibrated probability distribution over your schema. Triage queues, content routing, claim classification: this is the boring, bulletproof inference layer production systems actually need. (Caveat: the vendor’s fast-path kernels are CUDA-only; on XPU it runs through the generic torch fallback. The H200 reference latency of 38.8 ms suggests big headroom once fast paths arrive.)</p><h3>Workload 7 — Images: two very different generators</h3><p><strong>Stable Diffusion 3.5 Medium</strong> (2B, diffusers on XPU):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/838/1*5ql6oQhw4skT6VHSx_LGqQ.png" /></figure><p><strong>Qwen-Image-2.1-Turbo</strong> (7.1B DiT, 8-step distillation, native ~4.2 MP presets) — the heavyweight:</p><p><strong>Qwen-Image-2.1-Turbo</strong> (7.1B DiT, 8-step distillation, native ~4.2 MP presets) — the heavyweight, measured at 2048×2048:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*2iVv_p6lk-md3ysV2lIwWw.png" /></figure><p>That’s 13 images per hour at print-grade 4.2 MP on a single card — overnight-catalog territory. Fitting it in 24 GB (with a 14 GB-RAM host, no less) required real engineering: sequential staging (text encoder loads alone, produces embeddings, gets evicted), streaming the transformer in tensor-by-tensor (RAM peak ≈ one tensor), and tiled VAE decoding. The full recipe is in the repo.</p><p>The Qwen model runs at <strong>4.2 megapixels native</strong> (2048×2048) — 7× the pixel count of SD3.5’s 76⁸² — in 8 fixed steps. Fitting it in 24 GB required sequential staging (text encoder loads alone, produces embeddings, gets evicted; then transformer + VAE), and the VAE needs tiled decoding to fit its memory-hungry fp32 normalizations.</p><h3>So how many cards is an office?</h3><p>For a 100-person office (30 concurrent peak users):</p><ul><li>Guardrails: ~2 class/s peak needed → <strong>20× headroom</strong> on one card</li><li>LLM chat: human typing speed dominates → ~15–30% utilization of one card</li><li>Transcription: 6 h audio/day → 25 min of GPU/day</li><li>Images: occasional catalog regeneration — an overnight job</li></ul><p><strong>Two cards minimum (one active, one failover). Three for comfort.</strong> Power: 3× 133 W = 399 W worst-case simultaneous everything — in practice under 2 kWh/day, less than an electric shower. And the software bill is zero: vLLM, llama.cpp, OpenVINO, diffusers, open weights. No datacenter GPU license. No per-token tax.</p><h3>The honest part: XPU software in 2026</h3><p>This campaign wouldn’t be honest without the rough edges, because they’re real:</p><ol><li><strong>vLLM 0.21’s XPU graph path crashes under batched multimodal load</strong> (an attention-kernel assertion with mixed prefill+decode). We ran the OCR rounds with --enforce-eager — stable, ~5× slower single-stream. The bug is filed and the fix will unlock the 3 s/page tier.</li><li><strong>Docker + Intel GPU needs three flags together</strong> (bind-mount /dev/dri, --device renderD128, --device card0, plus the render group). Miss one and you get an invisible GPU or a dead oneCCL. Nobody documents the combination; now this article does.</li><li><strong>Custom-code models need version pinning</strong> (transformers 4.55 vs 5.10 vs 5.17 — different eras, different APIs). The lesson: pin per-model, not per-project.</li><li><strong>The fast paths are CUDA-first.</strong> Flash-linear-attention, clef-flash’s kernels, vLLM graph capture maturity — XPU gets there via fallbacks, which is exactly why “it runs” rarely means “it’s fast yet.”</li></ol><p>None of these stopped any workload from running. All of them are one-fix-away from more speed.</p><h3>The takeaway</h3><p>A single Arc Pro B60 24 GB runs: guardrails for 30 offices, 15 hours of audio per hour, a 100k-document RAG index in 8 minutes, a 27B chat model at conversation speed, medical OCR at 95%+ accuracy, 14k typed decisions per hour, and studio-grade 4.2 MP images — <strong>with open software, on-prem, for the power draw of an incandescent bulb and a half.</strong></p><p>The GPU isn’t the bottleneck anymore. The runtime is — and it’s improving monthly, in the open.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe09afc6f15c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From 5.7 to 51.5 tok/s — and beyond LLMs with ROCm 10]]></title>
            <link>https://medium.com/@raphaelpizzo/from-5-7-to-51-5-tok-s-and-beyond-llms-with-rocm-10-cd4066638415?source=rss-d45c09dd8484------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd4066638415</guid>
            <dc:creator><![CDATA[Raphael Pizzo]]></dc:creator>
            <pubDate>Mon, 31 Aug 2026 17:10:14 GMT</pubDate>
            <atom:updated>2026-08-31T17:10:14.684Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How kernel tuning, MTP3, native model paths, memory budgeting, and workload-specific profiling pushed two RX 7900 XTX cards to 845 tok/s — then carried the investigation into vision, image generation, and speech.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0GPR9qLJYEBbSqbs-V9ktQ.png" /><figcaption><em>Cover: consumer GPU AI systems lab</em></figcaption></figure><p>In June, I published a controlled study showing that a tuned MoE kernel raised Qwen3.6–35B-A3B throughput by 91% on two Radeon RX 7900 XTX cards — and that the gain survived a real production workload.</p><p>This is the sequel.</p><p>But this new campaign did not begin at 845 tok/s. It began with a dense 27B model generating only <strong>5.7 tok/s</strong>.</p><p>That disappointing Qwen3.8–27B INT8 result became the thread connecting the entire investigation. Kernel tuning raised it to 8.8. Combining the tuned path with MTP3 reached 25.1. A newer upstream vLLM build reached 42.1 with MTP3. The final ROCm 10 profile delivered <strong>51.55 tok/s — nine times the original baseline</strong>.</p><p>Only then did the campaign expand into Qwen3.6 MoE, Muse-Glimmer, Gemma 4, and Ling-3.0. I eventually carried the same investigation beyond text: technical-image understanding, a 597-image Stable Diffusion project, and a Whisper transcription API. The new question became harder: <strong>once the kernel is no longer the only variable, what actually determines whether an AI workload is fast, slow, or unable to start on consumer hardware?</strong></p><p>I tested five language-model families across vLLM, llama.cpp, ROCm 7.2.3, and the official ROCm 10 container, then used the same Radeon generation for diffusion and a separate 20 GB RX 7900 XT for speech. The answer was not “the newest stack always wins.” It was more useful:</p><p>The model implementation, speculative-decoding regime, memory accounting, and physical topology can matter more than another round of kernel tuning.</p><h3>TL;DR</h3><ul><li>Qwen3.8–27B W8A8 evolved from <strong>5.72 to 51.55 tok/s at concurrency 1: 9.0× faster</strong>. Energy fell from approximately 115.1 to 10.62 J/output token, a <strong>10.8× improvement in energy per generated token</strong>.</li><li>The final 51.55 tok/s result falls in the same published single-request performance band as one RTX PRO 6000 running the same model in FP8: approximately <strong>44.84 tok/s without MTP and 62.2 tok/s with the best reported MTP2 profile</strong>. This is a performance-class comparison, not a strict A/B.</li><li>At reference US prices, two RX 7900 XTX cards total <strong>USD 1,998</strong> at AMD’s original SEP. That is about <strong>23% of the RTX PRO 6000’s original USD 8,565 listing</strong> and 12.5% of the <strong>USD 16,000 currently shown by NVIDIA Marketplace</strong>. The professional card still offers 96 GB on one device, ECC, support, and a much larger context/concurrency envelope.</li><li><strong>845.2 output tok/s at concurrency 64</strong> with Qwen3.6–35B-A3B AWQ and the same MoE tuning strategy from the previous article. That is <strong>+61% over the untuned ROCm 10 run</strong> under the same 512-in/256-out protocol, at <strong>0.58 J/output token</strong>.</li><li><strong>161.9 tok/s at concurrency 1</strong> and <strong>565.1 tok/s at concurrency 16</strong> when the tuned MoE configuration is combined with MTP3.</li><li>Qwen3.8–27B INT8 + MTP3 reached <strong>353.2 tok/s at c64</strong> on ROCm 10, versus 153.6 on the older complete stack. This is a stack-to-stack result, not proof that ROCm alone caused the entire gain.</li><li>Muse-Glimmer 30B exposed a <strong>backend trap</strong>: the generic Transformers path reached 358.1 tok/s at c64; a backport of vLLM’s native implementation reached <strong>430.6 tok/s</strong>, a <strong>20.3% gain</strong>, while also using less memory.</li><li>Gemma 4 26B-A4B W8A8 + MTP3 reached <strong>530.2 tok/s at c64</strong>. MTP3 added <strong>+113% at c1</strong> and <strong>+52% at c64</strong>, but only about +4% at c16.</li><li>Ling-3.0-tiny BF16 reached <strong>618.2 tok/s at c64 on one RX 7900 XTX</strong> with the older stack. ROCm 10 was 15.4% slower in that cell. Newer did not mean faster.</li><li>Technical-image understanding reached <strong>46.76 tok/s with external MTP3</strong>, 139% above the non-speculative decode rate, while still identifying all six diagrams in the 1,920×1,079 test image.</li><li>Stable Diffusion 3.5 Medium denoise fell from roughly <strong>80–90 seconds on ROCm 7.2.3 to 13.5 seconds on ROCm 10</strong>, a 6–7× GPU-stage gain. ROCm 10 also made the T5-XXL text encoder fit, improving difficult food-prompt fidelity.</li><li>Whisper large-v3 did <strong>not</strong> benefit from the upgrade: after controlling a one-core busy-spin in the ROCm 10 runtime, it remained 6.1% slower for 11 seconds of audio, 2.4% slower for 29.7 seconds, and only 0.8% slower for a batched 237.9-second file. Every transcript matched exactly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YX-dpUVDOGqJoJLF5oqbHQ.png" /><figcaption><em>Best measured c64 throughput</em></figcaption></figure><p><em>Output throughput with the shared 512-input/256-output protocol. Ling uses one GPU; the other entries use tensor parallelism across two GPUs. Different models are not quality-equivalent — this chart describes serving capacity, not model quality.</em></p><h3>The machine and the test</h3><p>The hardware is deliberately ordinary by AI-lab standards:</p><ul><li>2× Radeon RX 7900 XTX, 24 GB each, gfx1100</li><li>Threadripper 2970WX, 24 cores / 48 threads</li><li>PCIe 3.0 x16, with the cards attached to different NUMA domains</li><li>one of the GPUs also driving the Wayland desktop</li></ul><p>The main text-serving protocol was fixed:</p><ul><li>random prompts with <strong>512 input tokens and 256 output tokens</strong></li><li>temperature 0, ignore-eos, fixed seed</li><li>simultaneous arrivals at concurrency 1, 16, and 64</li><li>16 requests at c1, 32 at c16, and 128 at c64</li><li>tensor parallelism 2, except Ling-3.0-tiny, which fits on one card</li><li>eager execution where required for comparability and stability</li></ul><p>There are two important boundaries around the conclusions.</p><p>First, ROCm 10 was tested through AMD’s official vLLM container, while the older environment used locally built vLLM 0.28 on ROCm 7.2.3. Therefore, those comparisons are between <strong>complete software stacks</strong>. They do not isolate one library.</p><p>Second, output tok/s is not a quality score. Qwen3.6-A3B, Gemma 4 26B-A4B, Muse-Glimmer, and Ling tiny activate very different amounts of compute per token. The throughput comparison answers a deployment question — how much traffic can this machine serve? — not which model is smarter.</p><p>The diffusion and speech extensions use different protocols and, in the Whisper case, a different machine. They are not entries in the LLM throughput ranking. Their purpose is to test a broader claim: whether the newer stack consistently improves real workloads on RDNA3. It does not.</p><h3>Result 1: the Qwen3.8 optimization journey — 5.7 to 51.5 tok/s</h3><p>The most useful way to read this campaign is chronologically. No single optimization created the final result.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O2fUWRwZ53EDLAkDegUb2g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2PvyhPeXqLFAtieFCFIyQg.png" /><figcaption><em>Qwen3.8 optimization timeline</em></figcaption></figure><p>The table also shows why optimization cannot be reduced to one winner. The best c1 profile was not always the best c16 or c64 profile. MTP3 transformed interactive decode but hurt batch throughput in the older stack. ROCm 10 later reversed that sign.</p><h3>Technique 1: shape-aware INT8 kernel tuning</h3><p>The original W8A8 path used a generic triton_scaled_mm heuristic. Qwen3.8 repeatedly calls a small set of matrix shapes, but each shape appears across a wide range of token-batch sizes. A tile that works for a large prefill matrix can waste compute units during skinny decode, and the reverse is also true.</p><p>I swept 108 combinations of BLOCK_M, BLOCK_N, BLOCK_K, and num_warps across seven effective GEMM shapes and 14 batch sizes — 98 operating points in total. The selected configurations were embedded directly into the kernel path and validated with an end-to-end A/B.</p><p>On vLLM 0.27.1, tuning alone produced:</p><ul><li>c1: 5.7 → <strong>8.8 tok/s</strong>, +54%</li><li>c16: 72.7 → <strong>105.6 tok/s</strong>, +45%</li><li>c64: 102.0 → <strong>145.4 tok/s</strong>, +43%</li><li>energy: approximately <strong>32–35% less per output token</strong></li></ul><p>That was the first lesson: microkernel tuning was not merely a high-concurrency trick. The generic INT8 path was leaving performance unused across the entire curve.</p><h3>Technique 2: MTP3 as a multiplier — but only in the right regime</h3><p>The model ships with a native Multi-Token Prediction head. Instead of producing exactly one token per target-model step, it drafts several future tokens and verifies them together.</p><p>On top of the old tuned kernel, MTP3 raised c1 to <strong>25.1 tok/s</strong>, 4.4× the original 5.7. But c16 fell from 105.6 to 75.0 tok/s. The additional draft and verification work did not pay for itself once enough requests were already available for batching.</p><p>That result prevented a common deployment mistake: treating speculative decoding as a global server setting. I began maintaining separate interactive and batch profiles.</p><h3>Technique 3: knowing when upstream has already won</h3><p>vLLM 0.28 changed the result more than another local tuning pass. Its vanilla INT8 path reached <strong>15.9 tok/s at c1</strong>, versus 5.7 on the original stack, while MTP3 reached <strong>42.1</strong>.</p><p>I reran the tuner for the new kernel layout. The first generated table actually regressed by 21%. A placebo patch proved that the patch mechanism was innocent; the tuner had explicitly fixed num_warps=4, while the production Triton path used its own default. After recalibrating against the real production path and validating 30 repetitions per shape bucket, the final tuned result was statistically identical to vanilla.</p><p>That apparent failure was a successful diagnosis: <strong>upstream had absorbed the old optimization</strong>. Keeping a local patch would add maintenance without adding throughput.</p><h3>Technique 4: ROCm 10 changed both the kernels and the economics of MTP</h3><p>The official ROCm 10 container raised vanilla to <strong>17.9/203.4/313.3 tok/s</strong> at c1/c16/c64. With MTP3, it reached <strong>51.55/295.97/353.17 tok/s</strong>.</p><p>Relative to the same ROCm 10 profile without MTP3, that is approximately +188%, +46%, and +13%. Unlike the older stack, speculation remained useful even at c64.</p><p>Memory accounting was part of the optimization. vLLM conservatively reserved 6.74 GiB per GPU for CUDA graphs in some MTP3 profiles, leaving too little KV cache and creating extreme queueing. In eager mode, disabling that estimate with VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0, then verifying actual free VRAM under load, restored the intended cache budget. This was not a faster kernel; it removed a false memory bottleneck.</p><p>From the first to the final c1 result:</p><ul><li>throughput: <strong>5.72 → 51.55 tok/s, 9.0×</strong></li><li>energy: <strong>115.1 → 10.62 J/token, 10.8× better</strong></li><li>TPOT: roughly <strong>173 ms → 18–19 ms per generated token</strong></li></ul><p>The final speedup came from layers of work: a better kernel, speculative decoding, upstream implementation improvements, a newer runtime, and correct memory provisioning.</p><h3>Why 51.5 tok/s matters: the RTX PRO 6000 performance class</h3><p>Published measurements for the same Qwen3.8–27B model put a single RTX PRO 6000 in the same interactive performance range:</p><ul><li>A production-oriented benchmark of Qwen3.8–27B FP8 on one RTX PRO 6000 Server Edition measured <strong>44.84 output tok/s at c1</strong> with 1,024 input and 256 output tokens, without MTP.</li><li>A separate RTX PRO 6000 Blackwell Max-Q report measured <strong>46.8 tok/s without speculation</strong> and <strong>62.2 tok/s with its best MTP2 setting</strong> for a single 400-token generation.</li><li>This two-card RX 7900 XTX system measured <strong>51.55 tok/s</strong> with Qwen3.8–27B W8A8, MTP3, and the fixed 512/256 protocol.</li></ul><p>The precise claim is therefore not “two 7900 XTX cards beat every RTX PRO 6000 setup.” Prompt lengths, FP8 versus INT8, MTP depth, GPU edition, context allocation, and software differ. The defensible conclusion is more interesting: <strong>the optimized consumer system reached the same published 45–62 tok/s single-request performance class for this model.</strong></p><p>The acquisition-cost contrast is large. AMD launched the RX 7900 XTX at a USD 999 US SEP, so the pair represents USD 1,998 in reference GPU cost. The RTX PRO 6000 <a href="https://www.tomshardware.com/pc-components/gpus/nvidia-rtx-pro-6000-blackwell-gpu-is-listed-for-usd8-565-at-us-retailer-26-percent-more-expensive-than-the-last-gen-rtx-6000-ada">originally appeared around USD 8,565</a>; NVIDIA Marketplace currently lists the Workstation Edition at USD 16,000. The pair is therefore about <strong>23% of the original professional-card listing — roughly one quarter — and 12.5% of today’s NVIDIA list price</strong>.</p><p>This is not a claim that the cards are interchangeable. The RTX PRO 6000 provides 96 GB of ECC memory on one device, 1.792 TB/s of bandwidth, professional support, no tensor-parallel communication for a 27B 8-bit model, and far more room for long context and concurrent sequences. The comparison isolates one outcome: interactive generation speed on Qwen3.8–27B.</p><h3>Result 2: the old MoE tuning survived a new stack</h3><p>The strongest result was also a useful replication.</p><p>The Qwen3.6–35B-A3B tuning artifact from the previous study was mounted inside the ROCm 10 container. vLLM confirmed that it loaded the custom W4A16 MoE configuration.</p><p>At c64:</p><ul><li>vanilla: <strong>524.5 tok/s</strong></li><li>MoE tuned: <strong>845.2 tok/s</strong></li><li>gain: <strong>+61.1%</strong></li><li>energy: <strong>0.58 J/output token</strong></li></ul><p>That is a clean within-stack A/B: same model, runtime, prompts, request count, and concurrency; only the MoE configuration changed.</p><p>The tuned + MTP3 combination was the better all-round serving profile:</p><ul><li>c1: <strong>161.9 tok/s</strong></li><li>c16: <strong>565.1 tok/s</strong></li><li>c64: <strong>772.2 tok/s</strong></li></ul><p>Pure tuning still won at c64, but MTP3 made the system dramatically faster at low and medium load.</p><p>The old campaign peaked at 658.7 tok/s under a different 1024-input/256-output protocol. The new 845.2 number is 28% higher, but that cross-campaign percentage is context, <strong>not</strong> a strict A/B. The defensible headline is +61% versus vanilla inside ROCm 10.</p><p>This is the result I wanted from a sequel: the tuning did not merely survive the original benchmark. It transferred across a major stack change and retained the same high-concurrency signature.</p><h3>Result 3: speculative decoding is a workload decision, not a checkbox</h3><p>MTP uses a model’s prediction head or assistant checkpoint to draft future tokens, then verifies them with the target model. It can reduce decode work, but the draft and verification steps consume compute and memory. Whether it wins depends on acceptance rate, batch size, and the target architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G-7rdQI75Y9Ij5LaPRnuuw.png" /><figcaption><em>MTP3 effect by model and load</em></figcaption></figure><p>Three models produced three different curves:</p><ul><li><strong>Qwen3.8–27B INT8:</strong> MTP3 was strongly positive throughout ROCm 10 — about +188% at c1, +46% at c16, and +13% at c64 versus the same-stack non-MTP run.</li><li><strong>Gemma 4 26B-A4B:</strong> +113% at c1, almost neutral at c16, then +52% at c64.</li><li><strong>Tuned Qwen3.6-A3B:</strong> +88% at c1 and +36% at c16, but <strong>-9% at c64</strong>.</li></ul><p>One launch flag cannot represent those three operating regimes.</p><p>The production rule is simple: benchmark speculative decoding at the concurrency you will actually serve. A single-stream win does not guarantee a batch win, and a c64 loss does not make MTP useless for an interactive endpoint.</p><p>There was also a memory-accounting trap. On ROCm 10, vLLM estimated 6.74 GiB per GPU for CUDA graphs in some MTP3 profiles. That conservative estimate reduced the KV cache so severely that queueing looked like a kernel regression. Setting VLLM_MEMORY_PROFILER_ESTIMATE_CUDAGRAPHS=0 restored the intended KV budget for these eager-mode measurements. The flag changes accounting, not model math; it must still be used only after verifying real free memory under load.</p><h3>Result 4: Muse-Glimmer was not a ROCm regression — it was the wrong backend</h3><p>Muse-Glimmer 30B initially looked worse on ROCm 10:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/955/1*KdZ4tX33JjCvSjMFJKRz8A.png" /></figure><p>The logs explained why. The old stack resolved the model as MuseGlimmerForConditionalGeneration, vLLM’s native implementation. The ROCm 10 image resolved it as TransformersMultiModalForCausalLM, a generic fallback.</p><p>That fallback passed 3D tensors into an INT8 kernel expecting a 2D shape, needed a reshape workaround, and loaded <strong>17.67 GiB per tensor-parallel rank</strong>. The native path used <strong>14.4 GiB per rank</strong>.</p><p>I backported the isolated Muse implementation from vLLM 0.28 into the container. No weights, quantization settings, or benchmark parameters changed.</p><p>The result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*ncIKjXkY1zWwoEKwVT1ZMQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dgih1Td46E-8EfmnzSrcdQ.png" /><figcaption><em>Muse backend recovery</em></figcaption></figure><p>At c64, the native ROCm 10 path also beat the older native stack by 9.4% and improved energy from 1.25 to <strong>1.02 J/token</strong>.</p><p>Then I tuned the INT8 shapes manually. It did not help: 10.07 tok/s in the probe, within noise and below the best native vanilla result of 10.13.</p><p>This changed the optimization order for the rest of the campaign:</p><p>Before tuning a kernel, verify that the runtime selected the intended model implementation.</p><p>A perfect microkernel cannot compensate for the wrong execution path.</p><h3>Result 5: Gemma 4 26B reached 530 tok/s — and MTP still depended on load</h3><p>Gemma 4 26B-A4B is a MoE model with roughly 26B total parameters and about 4B active. The W8A8 checkpoint occupied about 25 GB in the local cache and ran with a fixed 4 GiB KV budget.</p><p>With MTP3 at gpu-memory-utilization=0.90, it delivered:</p><ul><li>c1: <strong>27.44 tok/s</strong></li><li>c16: <strong>155.97 tok/s</strong></li><li>c64: <strong>530.24 tok/s</strong></li></ul><p>The corresponding non-MTP results were 12.89, 149.16, and 349.85 tok/s.</p><p>At c64, MTP3 accepted about 38% of drafted tokens and improved throughput by 52%. At c16, the gain was only about 4%. Again, architecture and load decided the outcome.</p><p>This result reinforces the central MTP lesson better than a simple fit/no-fit test could: speculative decoding must be evaluated at the concurrency you actually intend to serve. On this model it transformed interactive throughput and substantially improved the batch endpoint, yet contributed almost nothing in the middle.</p><h3>Result 6: Ling tiny delivered 618 tok/s on one card — and preferred the older stack</h3><p>Ling-3.0-tiny contains 7.9B total parameters but activates only 1.3B per token. Its BF16 checkpoint is about 15.8 GB, so it fits on one 24 GB card without tensor parallelism.</p><p>At c64:</p><ul><li>vLLM 0.28 / ROCm 7.2.3: <strong>618.23 tok/s</strong></li><li>ROCm 10 stack: <strong>522.86 tok/s</strong></li><li>delta: <strong>-15.4%</strong></li></ul><p>The older stack also won at c1 and c16 by 7.7% and 10.0%.</p><p>There is an important limitation. MLA prefill kernels failed on gfx1100 in both stacks, so I used the same mathematical PyTorch/FP32 fallback for prefill while leaving KDA, MoE, and decode on their native paths. This makes the stack comparison fair, but the TTFT numbers are not the model’s theoretical ceiling. A native RDNA3 MLA-prefill kernel should do better.</p><p>Even with that caveat, 618 tok/s on one consumer card is a striking illustration of what low active-parameter count can do for serving density.</p><h3>The hidden hardware variable: one card was also a display adapter</h3><p>During low-concurrency Muse runs, one GPU often reported near 100% utilization while the other hovered around 60–70%.</p><p>I reversed HIP_VISIBLE_DEVICES. The imbalance stayed with the physical card, not the tensor-parallel rank. That ruled out the obvious rank-assignment explanation.</p><p>Continuous telemetry made the difference visible:</p><ul><li>non-display card: roughly <strong>170–175 W</strong></li><li>display card: roughly <strong>91 W</strong></li></ul><p>The display card remained in a conservative automatic power profile while Wayland was active. Without root access to force a high-performance state, the asymmetry persisted. At c64, the larger matrix work kept both cards busier and the utilization gap narrowed.</p><p>NUMA binding removed a per-GPU microbenchmark difference, but did not improve end-to-end vLLM throughput. The final Muse profile therefore uses physical order 0,1, no forced NUMA binding, native vLLM implementation, eager mode, and standard INT8 kernels.</p><p>This is a useful consumer-hardware lesson: <strong>the operating system is part of the topology</strong>. A benchmark machine and a workstation are not the same environment, even with identical GPU model names.</p><h3>Beyond text: vision, diffusion, and speech</h3><p>The LLM campaign exposed a recurring pattern: the fastest kernel matters, but only after the correct model path, memory plan, and workload shape are in place. Three non-text workloads made that pattern even clearer.</p><h3>Technical vision and OCR: MTP accelerated the answer, not the encoder</h3><p>The llama.cpp Qwen3.8 profile was also tested with the official F16 multimodal projector on a 1,920×1,079 technical image containing six diagrams and formulas. All three modes — no MTP, internal MTP3, and an external draft model — identified the six diagrams. The two speculative paths produced identical byte-level reasoning. This was a functional vision/OCR check, not an academic visual benchmark, but it confirmed that the speedup did not destroy the answer on the known sample.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*YEn5J--3c_sO5dOT3VzxFA.png" /></figure><p>External MTP3 raised decode by <strong>139%</strong> while leaving visual prefill essentially unchanged. That distinction matters: the projector and image encoder dominate prefill, while speculation accelerates the language-model answer that follows.</p><p>Memory produced another three-way tradeoff. With the projector on the GPU, the fast non-MTP profile supported a safe 235,520-token context; external MTP3 reduced the daily safe profile to 176,128 tokens because the draft model also consumes memory. Moving the projector to the CPU restored a safe 262,144-token context, but visual prefill fell from roughly 432 to 42 tok/s even with 32 CPU threads.</p><p>The optimization was therefore not one flag. It was a choice among <strong>fast vision, speculative decode, and maximum context</strong>.</p><h3>Stable Diffusion 3.5: ROCm 10 changed both speed and feasibility</h3><p>The image-generation study came from a real task: producing 597 food photographs from the TACO nutrition taxonomy at 1,024×1,024. I tested a 24 GB MacBook M4 Pro, one RX 7900 XTX on ROCm 7.2.3, and the same Radeon on ROCm 10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*CAQ0IqXYZ7LuBb526FOq8g.png" /></figure><p>Roughly <strong>13.5 s of denoise at 40 steps</strong> after warm-up: about <strong>6–7× faster</strong> for the directly comparable GPU stage.</p><p>The vLLM image was only a convenient ROCm 10/PyTorch distribution; vLLM did not run the diffusion pipeline.</p><p>The improvement was not purely numerical. On the older stack, T5-XXL could not remain on the GPU, leaving a 77-token CLIP path and weaker Portuguese prompts. Brown rice became cooked rice, rolled oats became legumes, and rice-cream powder became a prepared dish. ROCm 10 allowed T5-XXL to coexist with the MMDiT at about 16.3 GB allocated and made structured English prompts practical. Those difficult cases recovered.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kG0DzUIBvKnWM224mSNvOA.png" /><figcaption><em>Stable Diffusion 3.5 food samples: recovered cases and remaining identity failures</em></figcaption></figure><p><em>Top row: difficult food states recovered with ROCm 10, T5-XXL, and structured English prompts. Bottom row: remaining fine-grained identity failures involving beef cut, lettuce variety, and cake mix.</em></p><p>The bottleneck then moved to the CPU VAE. A one-GPU probe measured 84–96 seconds wall time at 28 steps; 90–100 seconds at 40 steps is a projection, not a direct A/B cell. Running two full pipelines in parallel made each CPU decode take roughly 180–220 seconds. For the 597-image target, one uncontended GPU projected to about <strong>15 hours</strong>, while two competing VAE processes projected to about <strong>17 hours</strong>.</p><p>That counterintuitive result is a useful systems lesson: two GPUs can lose to one when the new bottleneck is a shared CPU stage. The next optimization is a serialized VAE queue, not another denoise kernel.</p><p>The Mac comparison also needs a boundary. R$11,000 for a discrete XTX versus R$22,000 for a complete notebook is not a component-level cost A/B, and the roughly 300× per-step gap reflects pathological swapping in this specific 24 GB configuration. It is not a universal Apple-versus-AMD compute ratio.</p><h3>Whisper large-v3: near parity under batching, but an idle CPU regression</h3><p>For speech, I moved the test to a separate Ryzen 7 5700G machine with an RX 7900 XT 20 GB so image generation could not interfere. Both stacks used the same openai/whisper-large-v3 model, Transformers 4.57.6, FP16, batch size 16, fixed language, temperature 0, one warm-up per case, and ten measured repetitions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*WyB3EaR5Rq7PCEv0cYDYqg.png" /></figure><p>The long case processed almost four minutes of audio in about 18.5 seconds, or <strong>12.86× real time on ROCm 7.2.3 and 12.77× on ROCm 10</strong>. The newer stack approached parity as eight 30-second windows began to use the batch effectively. All ten outputs for every case were stable, and normalized transcript hashes matched across stacks.</p><p>The surprising result was idle behavior. Immediately after warm-up, ROCm 10 kept one native thread at approximately 100% of a CPU core even though the API reported no busy engine and the GPU was idle. ROCm 7.2.3 fell to 0.04–0.05% container CPU.</p><p>I isolated the spinning thread on CPU 15 and limited the useful API workers in both stacks to CPUs 0–14. That improved ROCm 10 by 1.6–2.4% on the short cases, proving that the spin had contaminated the preliminary result, but ROCm 7.2.3 still won all three controlled cells. Disabling HSA_NO_SCRATCH_RECLAIM did not remove the spin.</p><p>The signature — one native thread continuously runnable with wchan=0 while the GPU is idle — is consistent with recent reports of an HSA async-event loop busy-spinning. I did not capture a symbolized native backtrace for this exact build, so that is an evidence-based inference rather than a proven root cause.</p><p>For this transcription API, the production recommendation remains <strong>ROCm 7.2.3</strong>. ROCm 10 is nearly tied under sustained batching, but it does not provide a speed win and its permanent one-core idle cost is unacceptable for an always-on service.</p><h3>What I would optimize first now</h3><p>After this campaign, my order of operations is:</p><ol><li><strong>Confirm the native model backend.</strong> Read the resolved architecture in the server log.</li><li><strong>Prove the memory profile under real load.</strong> KV cache, graph reservations, draft model, display usage, and safety margin all count.</li><li><strong>Test MTP at the target concurrency.</strong> Keep separate interactive and batch profiles when the curves disagree.</li><li><strong>Inspect physical GPU behavior.</strong> Swap logical ranks, record power and utilization, and distinguish topology from software imbalance.</li><li><strong>Profile the entire pipeline.</strong> Denoise can become fast enough that CPU VAE serialization determines total image throughput.</li><li><strong>Check idle behavior, not only request latency.</strong> A runtime can look healthy at the API layer while a native worker burns a CPU core.</li><li><strong>Tune kernels last.</strong> Tuning is valuable when the runtime still lacks a good configuration — as Qwen3.6 proved again — but newer upstream code may already contain the win.</li></ol><p>That final point is not anti-tuning. It is a better definition of tuning: change the bottleneck that exists today, not the bottleneck that existed three releases ago.</p><h3>Reproducibility and sources</h3><p>The raw campaign is retained as per-run JSON, server logs, power telemetry, launch scripts, patch files, deterministic image panels, and the full report. Key public references:</p><ul><li><a href="https://medium.com/@raphaelpizzo/tuning-moe-kernels-in-vllm-on-consumer-gpus-2-rx-7900-xtx-91-throughput-and-proof-that-the-cbca01c879d9">My previous MoE tuning and production-validation study</a></li><li><a href="https://rocm.docs.amd.com/projects/ai-ecosystem/en/latest/inference/vllm.html">AMD’s vLLM-on-ROCm documentation</a></li><li><a href="https://docs.vllm.ai/en/stable/features/speculative_decoding/mtp/">vLLM MTP documentation</a></li><li><a href="https://www.growthsystemes.com/blog/qwen3-8-27b/">Qwen3.8–27B FP8 benchmark on an RTX PRO 6000 Server Edition</a></li><li><a href="https://huggingface.co/Qwen/Qwen3.8-27B-FP8/discussions/9">RTX PRO 6000 Max-Q MTP depth measurements for Qwen3.8–27B</a></li><li><a href="https://ir.amd.com/news-events/press-releases/detail/1099/amd-unveils-worlds-most-advanced-gaming-graphics-cards-built-on-groundbreaking-amd-rdna-3-architecture-with-chiplet-design">AMD’s USD 999 RX 7900 XTX launch SEP</a></li><li><a href="https://marketplace.nvidia.com/en-us/enterprise/laptops-workstations/nvidia-rtx-pro-6000-blackwell-workstation-edition/">Current RTX PRO 6000 Workstation Edition listing on NVIDIA Marketplace</a></li><li><a href="https://huggingface.co/AlexanderKyng/Muse-Glimmer-30B-W8A8-INT8">Muse-Glimmer 30B W8A8 INT8 model card</a></li><li><a href="https://huggingface.co/inclusionAI/Ling-3.0-tiny">Ling-3.0-tiny model card</a></li><li><a href="https://huggingface.co/kevinbayes/gemma-4-26b-a4b-it-W8A8">Gemma 4 26B-A4B W8A8 checkpoint</a></li><li><a href="https://huggingface.co/stabilityai/stable-diffusion-3.5-medium">Stable Diffusion 3.5 Medium model card</a></li><li><a href="https://huggingface.co/openai/whisper-large-v3">Whisper large-v3 model card</a></li><li><a href="https://rocm.docs.amd.com/en/develop/reference/env-variables.html">ROCm environment-variable reference</a></li><li><a href="https://github.com/ROCm/rocm-systems/issues/7860">ROCm HSA async-event busy-spin report</a></li><li><a href="https://github.com/ROCm/ROCm/issues/6522">ROCm HSA livelock report with an idle GPU</a></li></ul><p>Every headline number in this article maps to a named raw result or dedicated study in the publication package. The main limitations are equally explicit: some comparisons are complete-stack comparisons, the vision check is functional rather than a benchmark suite, the image wall-time cells are not all protocol-identical, Ling uses a compatibility prefill fallback, and a display-connected GPU reduces the usable envelope.</p><h3>Final takeaway</h3><p>The previous study ended with a single JSON file nearly doubling MoE throughput. This campaign began elsewhere: with Qwen3.8 producing only 5.7 tok/s and no certainty that consumer RDNA3 hardware could make its W8A8 path competitive.</p><p>This larger campaign — now spanning text generation, technical vision/OCR, image generation, and transcription — ends with a broader conclusion:</p><p>On consumer GPUs, performance is not a property of the model or the kernel alone. It emerges from the exact path through the whole system.</p><p>The final 51.5 tok/s result shows what cumulative optimization looks like: no miracle flag, but a 9× climb through kernels, MTP, upstream evolution, runtime changes, and memory accounting. It landed in the same published single-request performance class as an RTX PRO 6000 on this model, using a GPU pair whose reference acquisition cost was roughly one quarter of the professional card’s original listing.</p><p>The fastest result — 845 tok/s — still came from kernel tuning. But the most instructive results came from the boundaries between components. Restoring Muse-Glimmer’s native backend recovered up to 27%. Making T5 fit changed both diffusion speed and semantic fidelity. Accelerating denoise exposed the CPU VAE as the new bottleneck. Isolating an idle HSA spin recovered part of Whisper’s apparent regression, but not enough to make ROCm 10 the winner.</p><p>Those results belong together. Tune what is actually slow, measure at the load you actually serve, and treat software selection, memory headroom, pipeline boundaries, and idle efficiency as first-class performance variables. <strong>ROCm 10 was transformative for Qwen3.8 INT8 and Stable Diffusion, nearly neutral for batched Whisper, and slower for Ling and short-form transcription. Upgrade decisions belong to workloads, not version numbers.</strong></p><p><em>Stack: vLLM · llama.cpp · Transformers · Diffusers · Whisper · ROCm 10 · AMD RDNA3 · Triton · speculative decoding · MoE</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd4066638415" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tuning MoE kernels in vLLM on consumer GPUs (2× RX 7900 XTX): +91% throughput — and proof that the…]]></title>
            <link>https://medium.com/@raphaelpizzo/tuning-moe-kernels-in-vllm-on-consumer-gpus-2-rx-7900-xtx-91-throughput-and-proof-that-the-cbca01c879d9?source=rss-d45c09dd8484------2</link>
            <guid isPermaLink="false">https://medium.com/p/cbca01c879d9</guid>
            <category><![CDATA[vllm]]></category>
            <category><![CDATA[benchmark]]></category>
            <category><![CDATA[tuning]]></category>
            <dc:creator><![CDATA[Raphael Pizzo]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 17:12:11 GMT</pubDate>
            <atom:updated>2026-06-09T18:07:09.869Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tuning MoE kernels in vLLM on consumer GPUs (2× RX 7900 XTX): +91% throughput — and proof that the gain survives production</h3><blockquote><em>A case study in three layers. First, a controlled synthetic A/B shows </em><strong><em>+91% throughput</em></strong><em> at 64 simultaneous requests after tuning the MoE kernels of a Qwen3.6‑35B‑A3B (AWQ int4) served on two Radeon RX 7900 XTX. Then two </em><strong><em>real production agents</em></strong><em> — a diagram generator and a ticket analyzer are used to answer the question every synthetic benchmark must face: </em><strong><em>does this hold up in real life?</em></strong><em> The answer is yes. And the most beautiful detail: the synthetic benchmark </em>predicted<em> a scaling collapse of the default, and production </em>confirmed it blind<em>.</em></blockquote><blockquote><em>Counterintuitive bonus: the biggest performance jump came from </em><strong><em>removing</em></strong><em> a tuning point — not from adding one.</em></blockquote><h3>TL;DR</h3><p>Running a 35B MoE (≈3B active) on <strong>2× AMD Radeon RX 7900 XTX</strong> — consumer cards, RDNA3, 24 GB each — vLLM’s kernel tuning delivered three levels of evidence:</p><p><strong>Layer 1 — Synthetic benchmark (controlled A/B, 10 reps/point, 180 measurements):</strong></p><ul><li><strong>+91% throughput at 64 simultaneous requests</strong> (344 → 659 tok/s)</li><li><strong>+24% at 32 concurrent</strong> (411 → 511 tok/s)</li><li><strong>−28% to −36% on TTFT</strong> (time to first token) across the whole range</li><li><strong>TPOT (per‑token latency) cut in half at 64 concurrent</strong> (170 ms → 86 ms)</li><li>The default <strong>regresses</strong> from 32 → 64 concurrent (411 → 345 tok/s): it simply <strong>does not scale</strong> on this GPU</li></ul><p><strong>Layer 2 — Real single‑request agent (diagram generator, 14 types, 58 runs):</strong></p><ul><li><strong>+5.8% mean throughput</strong> at concurrency ≈ 1 — modest, and <strong>exactly what theory predicts</strong> for low load. Full honesty: some diagram types tied or went slightly negative. Low concurrency is <strong>not</strong> where MoE tuning shines — and the real data proves it.</li></ul><p><strong>Layer 3 — Real high‑concurrency agent (491 tickets analyzed in parallel):</strong></p><ul><li><strong>+47.8% throughput and −32% wall‑clock time</strong> (718 s → 488 s; <strong>230 seconds saved</strong>) at 64 concurrent</li><li>And the crown jewel: the agent reproduced <strong>blind</strong> the scaling collapse seen in the synthetic test. <strong>Untuned</strong>, doubling concurrency from 32 → 64 changes nothing (721 s → 718 s, +0%). <strong>Tuned</strong>, the same tickets finish 14.5% faster.</li></ul><p>The cross‑cutting lesson: <strong>the MoE tuning gain grows with concurrency</strong> — low load ~+6 to +10%, high load <strong>+48 to +91%</strong>. That is exactly the scenario of serving many agents in parallel. And the counterintuitive engineering lesson: <strong>fewer tuning points, but well chosen, won</strong> — removing a single mis‑generalized config (bs=32) unlocked the biggest gain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VgS9bJ7ew0y-UodD1EDfA.png" /></figure><h3>Why this matters</h3><p><strong>Mixture‑of‑Experts (MoE)</strong> models are the dominant way to scale capacity without paying the full inference cost: Qwen3.6‑35B‑A3B has 35B total parameters but activates only <strong>~3B per token</strong> (top‑8 of 256 experts). This makes them ideal for serving <strong>agent</strong> workloads, where you fire dozens or hundreds of concurrent requests (every reasoning turn, every tool call, every item in a batch).</p><p>But there is a detail almost nobody measures: the heart of an MoE is the <strong>fused MoE kernel, </strong>a grouped GEMM that routes tokens to experts and multiplies matrices. That kernel’s efficiency depends on a <strong>tiling configuration</strong> (block sizes, number of <em>warps</em>, pipeline stages) that is <strong>GPU‑specific</strong>. And all the tuning that ships in vLLM is calibrated for <strong>datacenter</strong> cards (MI300X, H100…). For a <strong>consumer GPU</strong> like the 7900 XTX, that config simply does not exist and vLLM falls back to a generic one, warning that “performance might be sub‑optimal”.</p><p>The question of this work: <strong>how much does that “sub‑optimal” cost? And does fixing it survive a real load, or is it a benchmark artifact?</strong></p><h3>The setup</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2f5HUVUtecU9wHI7LRMSsQ.png" /></figure><p>These are <strong>two gamer cards</strong> running a model that, without MoE, would be prohibitive. Tuning was done with vLLM’s benchmark_moe.py (Triton kernel autotuner) for dtype=int4_w4a16, E=256, N=256 (intermediate 512 ÷ TP 2), block_shape=[0,128]. The generated artifact is a single JSON:</p><pre>E=256,N=256,device_name=AMD_Radeon_RX7900XTX,dtype=int4_w4a16.json</pre><p>The file vLLM was looking for and couldn’t find.</p><h3>The problem: the missing config</h3><p>Without the JSON above, the vLLM log leaves the note:</p><pre>WARNING fused_moe.py: Using default MoE config. Performance might be sub-optimal!<br>Config file not found at .../E=256,N=256,device_name=AMD_Radeon_RX7900XTX,dtype=int4_w4a16.json</pre><p>That “default” is a generic tiling heuristic. It works, but it leaves performance on the table, and (as we’ll see) <strong>stops scaling</strong> exactly in the high‑concurrency regime. Generating the right config is the object of study.</p><h3>Methodology</h3><p>Rigor matters: if the difference between “tuned” and “untuned” is smaller than measurement noise, the result is worthless. So the <strong>only variable</strong> between the two sides was the presence of the tuned config. Everything else, identical.</p><ul><li><strong>Tool:</strong> own bench tool, random dataset, <strong>input 1024 / output 256 tokens</strong>, --ignore-eos (fixed output length), greedy (temperature 0), seed 0.</li><li><strong>Concurrency sweep:</strong> 1, 2, 4, 8, 12, 16, 24, 32, 64.</li><li><strong>10 repetitions per configuration</strong>, with 3 s rest between levels.</li><li><strong>Prefix caching OFF on both sides.</strong> With random prompts and a fixed seed, enabling it would create spurious <em>cache hits</em> and contaminate the measurement.</li><li>No concurrent real traffic during measurements.</li></ul><p>Total: <strong>9 levels × 10 reps × 2 configs = 180 controlled measurements</strong> in the synthetic layer alone.</p><p>Then, two <strong>real production</strong> workloads (agents already running in service) were measured with the same model, before and after tuning — not to redo the A/B in a lab, but to answer the generalization question.</p><h3>Part I — Synthetic results</h3><h3>Generation throughput (tokens/s) — mean of 10 reps</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2P5VyGpmzCygNald3M6q2w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*MlNrUZGZCNfXCgVW224V6A.png" /></figure><p>Notice the standard deviations: almost all <strong>below 1–4 tok/s</strong> across 10 runs. Highly reproducible, the gain is <strong>orders of magnitude above the noise</strong>.</p><h3>The gain grows with load</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8G0Bz65uG4OdsVYRzrpuIw.png" /></figure><p>This is the signature of MoE tuning: <strong>+10%</strong> at low load, <strong>+91%</strong> at peak load. It’s not a flat improvement, it’s an improvement that <strong>accelerates</strong> as you stack requests. And there’s a critical point: <strong>untuned, throughput regresses from 32 → 64 concurrent</strong> (411 → 345). The generic kernel isn’t just slower, it <strong>hits a ceiling and falls off</strong> beyond ~32 requests on this GPU. Tuned, the curve keeps climbing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6t_cUqAp_7tmPJdk-hf0Kg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g-jNbvhVegUURj23SnT7eg.png" /></figure><p>At 64 concurrent, each individual user went from <strong>~5.9 tok/s</strong> (untuned) to <strong>~11.6 tok/s</strong> (tuned), <strong>double the perceived speed per person</strong>, at the highest load point. In other words: tuning not only serves more people at once, it serves each of them faster.</p><h3>Why the gain grows with load (the kernel physics)</h3><p>Why does MoE tuning yield +10% at concurrency 1 and +91% at 64? The answer lies in the nature of the <strong>grouped GEMM</strong> at the heart of the MoE.</p><p>The fused MoE kernel takes all the tokens in the batch, groups them by destination expert, and runs one matrix multiply per group. The relevant size is <strong>M = number of tokens</strong> reaching the kernel:</p><ul><li><strong>Low concurrency / decode (small M).</strong> Each expert sees very few tokens. The GEMM is “skinny” (few rows) and the bottleneck is <strong>memory bandwidth</strong> — you spend more time moving the quantized weights than computing. There isn’t much a better tiling can do: the roofline is on the memory side. That&#39;s why the gain at conc=1 is modest.</li><li><strong>High concurrency / prefill (large M).</strong> Many tokens are batched together; each expert receives a fat lot. The GEMM becomes <strong>compute‑bound</strong>, and now the tiling config (BLOCK_M/N/K sizes, num_warps, num_stages, GROUP_M) decides the <strong>occupancy of the compute units (CUs)</strong> and the overlap between compute and data movement. A bad tiling under‑utilizes the GPU and <strong>chokes, </strong>exactly what we see in the default&#39;s 32 → 64 collapse. A good tiling keeps the CUs full and the curve rising.</li></ul><p>That’s the mechanism. And it has a subtle consequence that becomes the next chapter: because vLLM picks the config by <strong>nearest neighbor on M</strong>, a single mis‑tuned point can contaminate an entire regime.</p><h3>Part II — From the bench to production</h3><p>Every synthetic benchmark carries a suspicion: <em>is this real, or a pretty number that evaporates when a real load hits?</em> To answer, we measured two agents <strong>already running in production</strong> with this model, no artificial prompts, no --ignore-eos, no fixed length. Real work.</p><h3>2a. The single‑request agent: the diagram generator (honesty time)</h3><p>The first agent generates <strong>documentation diagrams</strong> from a specification — 14 different types (sequence, class, c4-context, archimate, mindmap, wbs, …), one request at a time (concurrency ≈ 1). It is the <strong>least favorable</strong> scenario for MoE tuning, and it was chosen on purpose: if tuning were snake oil, this is where it would show.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DWL0XTL68QL2N7MFEgQPGw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*huFVEei7yNi9Z9vs1K28nw.png" /></figure><p>And here is the scientific honesty that lends credibility to the rest: <strong>not every type improved</strong>. wbs jumped +28.8% and sequence +11.5%, but mindmap came in at −5.5% and object at −3.2%. Concurrency 1 is a regime of <strong>high noise and low headroom, </strong>decode is bounded by memory bandwidth, not by the MoE kernel, so tiling has little to contribute and natural run‑to‑run variation dominates.</p><p>This is <strong>not</strong> a disappointment, it’s a <strong>confirmation</strong>. Theory says: <em>MoE tuning helps little at low concurrency</em>. The synthetic test at conc=1 gave <strong>+10.6%,</strong> the real agent at conc≈1 gave <strong>+5.8%</strong>. Both modest, both in the right direction. If the real agent had given +90% at concurrency 1, <em>that</em> would be reason to distrust the experiment.</p><h3>2b. The high‑concurrency agent: ticket analysis (impact time)</h3><p>The second agent performs <strong>ticket analysis</strong> and parallelizes the work across 16, 32, or 64 concurrent calls. This is the regime MoE tuning was made for and where theory predicts the biggest gain. Two batches were measured: a small one (31 tickets) and a large one (<strong>491 tickets</strong>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V8UWVHLV7c2KQKjZ8VF9gw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*otFFx1FdLSFFRsF_SkQSuw.png" /></figure><p>At 64 concurrent, on the real batch of 491 tickets, tuning <strong>cut 230 seconds, </strong>almost 4 minutes, off a ~12‑minute job, and raised throughput by <strong>nearly 50%</strong>. This isn’t a benchmark: it’s wall‑clock time a team waited less, on work it was already doing.</p><h3>The cross‑validation: the predicted collapse is confirmed</h3><p>Here is the result I’m proudest of, because it wasn’t planned, it emerged from the data.</p><p>Back in Part I, the <strong>synthetic</strong> benchmark revealed that the default <strong>does not scale</strong>: doubling concurrency from 32 → 64, throughput <strong>regresses</strong> (−16.1%). That was a lab prediction. The natural question: <em>would this happen with a real load?</em></p><p>The ticket agent answered, <strong>without knowing it was being asked</strong>. Look at what happens when you double concurrency from 32 → 64 on the 491‑ticket batch:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*R75YQq9gkQeTCrLGkqUcAQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0IcpOO7pB9mDy40udeGjsA.png" /></figure><p>The reading is unambiguous:</p><ul><li><strong>Untuned, doubling concurrency bought absolutely nothing.</strong> In the synthetic test throughput even regressed; in production it was pinned at zero gain (718 s with 64 calls is statistically equal to 721 s with 32). The generic kernel <strong>saturated, </strong>you’re paying for double the concurrency to get the same result.</li><li><strong>Tuned, concurrency turned into real speed</strong> in both worlds: +28.8% synthetic, +17.6% production.</li></ul><p>A synthetic micro‑benchmark <strong>predicted</strong> a scaling behavior, and a fully independent production job <strong>confirmed it</strong>. This is the strongest validation a performance study can have: the lab number didn’t evaporate, it showed up in the end‑of‑month bill.</p><h3>One tuning, three workloads</h3><p>Bringing the three layers of evidence into a single image, the <strong>same</strong> tuned config, measured across three workloads with increasing concurrency:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2VgS9bJ7ew0y-UodD1EDfA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2E7a7NX5udBwFl4p9pR6PA.png" /></figure><p>The message is single and consistent: <strong>the value of MoE tuning is an increasing function of concurrency.</strong> If you serve one request at a time, you gain little. If you serve a fleet of agents in parallel, which is where the world is heading, the gain is transformative.</p><h3>Business translation</h3><p>Throughput is abstract; let’s convert it into units that pay bills. On the <strong>491‑ticket batch at 64 concurrent</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QxfHn8vYLv-EbCFLNbLoBg.png" /></figure><p>In other words: <strong>the same two consumer cards process ~1,160 more tickets per hour</strong> after tuning, without changing a line of the model, without buying a new GPU, without changing the prompt. It’s pure efficiency unlocked by a single kernel‑config JSON file.</p><p>And because the gain <strong>grows with load</strong>, it translates directly into <strong>serving density</strong>: more simultaneous agents per GPU before you need to scale horizontally. For anyone running self‑hosted inference, that’s the difference between buying the next machine now or a year from now.</p><h3>Statistical rigor</h3><ul><li><strong>180 controlled measurements</strong> in the synthetic layer (10 reps × 9 levels × 2 configs).</li><li>Typical standard deviation <strong>&lt; 1% of the mean</strong> → the gain sits far above the noise. At 64 concurrent, σ = 0.75–0.80 tok/s over means of 345 and 659 — the distributions don’t come close to touching.</li><li>One contaminated repetition (accidental GPU use during measurement) was <strong>detected and redone individually</strong>, without discarding the other 9, preserving the sample size.</li><li>For the production workloads, the comparison is <em>paired</em>: same agent, same model, same inputs, same ticket count; the only variable is the kernel config.</li></ul><p>Honesty about the real workloads: they have a <strong>smaller n</strong> than the synthetic test (one to four runs per point, not ten) and were <strong>not instrumented for a lab A/B, </strong>they are production measurements. So they serve as <strong>generalization validation</strong>, not as the primary source of the gain numbers. The strength of the argument comes from the <strong>convergence of the three layers</strong>, not from any one in isolation.</p><h3>Reproducibility</h3><p>It’s my work! Call me and i can help you!</p><h3>Limitations and scientific honesty</h3><p>A performance study is only trustworthy if it also says where it proves <strong>nothing</strong>:</p><ol><li><strong>One model, one GPU, one quantization.</strong> The numbers hold for Qwen3.6‑35B‑A3B AWQ int4 on 2× RX 7900 XTX. The <em>direction</em> (tuning helps more under load) should generalize; the <em>magnitudes</em> don’t transfer to other hardware/models without re‑measuring.</li><li><strong>Production workloads have small n.</strong> They are generalization validation, not a lab A/B. They confirm the synthetic signal; they don’t replace it.</li><li><strong>64 concurrent is the tested limit.</strong> We don’t know where the tuned build also saturates, probably higher, but it wasn’t measured.</li><li><strong>Single‑stream decode isn’t the strong suit.</strong> At low concurrency the bottleneck is memory bandwidth + attention, not the MoE, hence the modest gain, and hence speculative decoding on the next‑steps list.</li><li><strong>Per‑task variability.</strong> In the diagram agent, some types regressed at conc=1. We report this openly rather than hide it, it’s the lowest‑headroom regime.</li><li><strong>This test was designed for individual users, micro, small, and at most medium-sized businesses. This is the target audience for whom the tested competitor makes sense and can handle numerous case studies!</strong></li></ol><h3>Next steps</h3><ul><li><strong>Prefix caching</strong> for agent workloads (context that grows each turn), potential to drastically cut TTFT in multi‑turn conversations.</li><li><strong>Speculative decoding</strong> to speed up the latency of a <strong>single</strong> request (single‑stream decode is bound by memory bandwidth + attention, not by the MoE, exactly what explains the diagram agent’s modest gain).</li><li><strong>A dedicated prefill config</strong> (large batch) to squeeze TTFT even further.</li><li><strong>Extend the sweep beyond 64 concurrent</strong> to find where the tuned build also saturates.</li><li><strong>Repeat the controlled A/B inside production</strong> (n=10) to promote the real workloads from “validation” to “primary source”.</li></ul><h3>Appendix: full data tables</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u9ePqByfkePWmtGEW_G6fA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XjvpF6P-tp2l-yoPcjqaKg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CnHHKJy4hkCW2ZF3DBP2lQ.png" /></figure><h3>Stack: vLLM · ROCm · AMD RDNA3 · Triton · Qwen3 MoE · AWQ</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cbca01c879d9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>