Optimizing Qwen3.8-27B: From 9.5 to 153 Tokens/Second
TrifleHopeful5418 · reddit · 2026-08-21
Through 159 experiments, the author optimized Qwen3.8-27B on a heterogeneous setup (AMD Strix Halo + RTX 3090 Ti), boosting generation speed from 9.5 to 153 tok/s (32K code context) and outperforming a dual-3090 vLLM cluster on HumanEval.
Key Optimizations:
- Chat Template Swap: Switching to the terser Qwen-Sharp template reduced wall time by 44% and output tokens by 51% by stopping model narration.
- KV Cache Format: Downgrading K and V to q40 freed 2GB VRAM, allowing all full-attention layers to sit on the fast GPU.
- Speculative Decoding: The flag --spec-type draft-mtp,ngram-mod delivered +72% to +140% speedup on code-shaped output at no VRAM cost.
- llama.cpp Patch: Adjusting --spec-draft-ubatch freed 1GB VRAM for better layer placement.
- Vision Encoder Offload: Using MTMDBACKENDDEVICE=Vulkan1 moved the vision encoder to the idle iGPU to prevent OOM on the 3090 Ti.
Failed Approaches:
- External draft models were slower due to PCIe latency.
- Q6K quantification increased wall time and slightly reduced accuracy.
Benchmarks:
- HumanEval: Local 159/164 (29.7 min) vs Remote vLLM 157/164 (42.4 min).
- Long Context Retrieval: 15/15 passed locally with faster execution.
More from Infra
- Which free local AI model to download for your GPU, from 6GB to 24GB VRAM — alex_verem · 2026-11-30
- tqLLM 1.9.0: C++ LLM engine claims 4.6x Strata on 16GB, adds AMD RX 580 support — pmttyji · 2026-11-30
- oMLX 0.8.4 doubles Inkling 2 Mini decode speed on Mac, adds concurrent MTP — pcuenq · 2026-11-30
- Tencent issues $5.4B notes as AI costs turn cash flow negative; AMD closes World Labs deal with Fei-Fei Li — YvesMulkers · 2026-11-30
- Banks in Europe and Asia plan higher spending on local data storage to cut US cloud reliance — AIFlow_ML · 2026-11-30
- Air New Zealand to offer free Starlink Wi-Fi across entire fleet by end of 2028 — elonmusk · 2026-11-30