TL;DR: A single RTX 4090 running Qwen3.6-27B goes from 20 t/s (FP8 baseline) to 184 t/s peak through a pipeline of quantization (AWQ), MTP speculative decoding, DFlash diffusion-based acceleration with DDTree branching paths, and TurboQuant KV cache compression — without requiring multi-GPU setups for most workloads.
The host opens with a live benchmark: dual RTX 4090 vs single RTX 4090 running Qwen3.6-27B. The result defies intuition — the single card is competitive in many scenarios, and with proper optimization, it outperforms naive multi-GPU setups on latency-sensitive workloads.
The core thesis: optimization transforms your GPU from a toy into a nuclear-level productivity tool. The gap between “usable” and “production-grade” local inference is closing fast.
Baseline — FP8 on Single RTX 4090
A dense 27B model at FP8 precision on a single RTX 4090 outputs 20 tokens per second. That is not a misprint. At that speed, the model types out a function name before you lose patience and decide to write it yourself.
FP8 is nearly lossless in quality — but throughput matters more than marginal accuracy gains when the alternative is waiting.
Optimization 1 — Quantization (AWQ / GGUF)
The bottleneck on cards like the RTX 4090 is memory bandwidth, not compute. The GPU calculates too fast for the VRAM to feed it data. Less data means faster throughput.
Why quantization speeds things up
With FP8, weights occupy 2 bytes per parameter. At 4-bit, each weight is half a byte — 4× less memory traffic over the same bandwidth. Same compute, less waiting.
The host benchmarks two approaches:
| Method | Format | Framework | Speed | Notes |
|---|---|---|---|---|
| GGUF Q4_K_M | 4-bit | llama.cpp | ~45 t/s | Best size/quality balance for single-user |
| AWQ (int4) | 4-bit sparse | vLLM | ~48 t/s | High-concurrency, PagedAttention |
Both double throughput compared to FP8 (from 20 → 48 t/s). Quality loss is minimal — mostly occasional errors requiring retry tokens, which still cost less than the time saved.
Quantization quality assessment
The host tested against three datasets derived from ToolCall15 (tool-calling success rate), data extraction, and instruction following — 45 scenarios total. Most users cannot perceive the difference between FP8 and 4-bit quantized output. The extra token cost of correcting rare errors is far less than the time penalty of running unquantized.
GGUF vs AWQ — when to use which
| Factor | GGUF (llama.cpp) | AWQ (vLLM) |
|---|---|---|
| Concurrency | Single-user, sequential | Multi-request, PagedAttention |
| Flexibility | Q4–Q8, dynamic budget per VRAM | Fixed int4 sparse |
| Offloading | GPU + CPU RAM hybrid | GPU-only (requires sufficient VRAM) |
| Best for | Personal use, limited VRAM | Server/API, high throughput |
Optimization 2 — MTP (Multi-Token Prediction)
MTP is part of speculative decoding. The model generates multiple prediction heads that forecast several future tokens simultaneously, then validates them in one batch pass: correct predictions kept, wrong ones discarded.
How MTP works
| n value | Behavior | Effect |
|---|---|---|
| n=1 | Predict next token + verify | Baseline speculative step |
| n=5 | Predict 5 tokens ahead + verify | GPU fills idle cycles during data fetch |
During single-token generation, the GPU sits idle waiting for memory reads. MTP keeps it busy — speculating on future tokens while the current one loads. It recovers wasted compute.
MTP benchmark results (vLLM)
| Configuration | Speed | Improvement over baseline |
|---|---|---|
| AWQ, no MTP | 48 t/s | +140% vs FP8 |
| AWQ, MTP n=1 | 71 t/s | +253% vs FP8 |
| AWQ, MTP n=3 | 99 t/s | +395% vs FP8 |
| AWQ, MTP n=5 | 108 t/s | 440% vs FP8 (5× speedup) |
FP8 also benefits dramatically from MTP:
| Configuration | Speed | Improvement over baseline |
|---|---|---|
| FP8, no MTP | 20 t/s | — |
| FP8, MTP n=1 | 38 t/s | +90% |
| FP8, MTP n=3 | 60 t/s | +200% |
| FP8, MTP n=5 | 72 t/s | +260% |
The RTX 4090 has native FP8 hardware acceleration (Tensor Cores), making FP8 + MTP competitive even against quantized models without speculative decoding.
Task-type variance
Speculative decoding speed depends on predictability of the output domain:
| Task | DFlash Speed | Why |
|---|---|---|
| Math problems | ~150 t/s | Fixed formula structures, highly deterministic |
| Code generation | ~125 t/s | Custom variables/functions introduce unpredictability — user_id vs user_account breaks speculative chains |
| Creative writing | Lowest | Maximum entropy, every token branch diverges |
The host’s key insight: multi-agent coding workflows are ideal for speculative decoding because code has structural regularity (indentation, brackets) while remaining deterministic enough that small models predict well.
Optimization 3 — DFlash (Diffusion-Based Speculative Decoding)
MTP speculates along a single linear path. If one token is wrong, all subsequent predictions are wasted. DFlash takes a fundamentally different approach — borrowed from diffusion image generation.
Diffusion applied to text
The analogy: generating an image starts as noise and iteratively refines toward clarity. DFlash applies this to tokens:
- The draft sees
[last_target_token, MASK x 15]plus 5 captured target hidden states from specific layers - It denoises all 16 masks in a single forward pass — no chain dependency
- DDTree builds a best-first tree of up to 22 nodes (or flat chain without DDTree)
- One target forward verifies the entire tree via causal mask; committed tokens feed back, rejected branches discarded
Diffusion models are inherently parallel — they do not depend on sequential chain-of-thought like autoregressive generation. Qwen3.5-27B is a hybrid model (every 4th layer = full softmax attention, rest = Gated DeltaNet), which Lucebox handles via ggml_gated_delta_net — the only kernel needed beyond standard ggml.
DFlash benchmark
Lucebox ported DFlash to GGUF via a custom C++/CUDA engine on top of ggml (no libllama). Qwen3.5-27B Q4_K_M (~16 GB target + 3.46 GB BF16 draft) fits on one RTX 3090 with 24 GB VRAM:
| Environment | Model | Baseline AR | With DFlash (DDTree budget=22) | Improvement |
|---|---|---|---|---|
| RTX 3090 (Lucebox demo) | Qwen3.5-27B Q4_K_M | 38.0 t/s | 207.6 t/s peak | 5.46× |
| RTX 3090 (HumanEval bench) | Qwen3.5-27B Q4_K_M | 37.78 t/s | 129.5 t/s mean | 3.43× |
| RTX 4090 (host) | Qwen3.6 27B AWQ+MTP | 108 t/s | 141 avg / 184 peak | +70% over MTP alone |
The host achieves 184 tokens per second peak throughput on an RTX 4090 — nearly 10× the FP8 baseline on a single card. Lucebox’s demo hits 207 tok/s on a less powerful RTX 3090, proving DFlash scales beyond high-end hardware.
Optimization 4 — DDTree (Diffusion Draft Tree)
DFlash generates a block of tokens but chains them as a single linear path to the target model. If one token fails validation, all downstream predictions are wasted — same problem MTP had, just scaled up.
DDTree extends DFlash by exploring multiple candidate paths simultaneously:
- Diffusion generates a rough block of candidates
- Instead of one linear chain, DDTree branches into N parallel hypotheses (configured as 22 paths in Lucebox’s setup —
budget=22) - All 22 paths are validated against the target model via a causal mask
- The best path is committed; rejected branches discarded, recurrent state rolled back to the committed prefix
The metaphor: generate a forest, then find the best route through it. Lucebox’s implementation uses ~8.3 tokens committed per draft/verify step on HumanEval at this budget.
Multi-GPU: Dual RTX 4090 Results
The host tested dual RTX 4090s and found that multi-GPU does not mean “double speed”:
| Configuration | Single Request | 10+ Concurrent Requests |
|---|---|---|
| FP8, MTP n=5 | 120 t/s (+10 over single) | Scales linearly — 2× throughput |
| AWQ + MTP n=5 | Similar latency | Significantly higher aggregate throughput |
Why dual GPU is not 2× for single requests
The bottleneck is inter-card synchronization of model weights, not compute:
- RTX 4090 has no P2P (peer-to-peer) VRAM communication between cards
- Data must route through CPU → system RAM → PCIe → second card
- Each hop introduces latency that erodes the benefit for single-token generation
Where multi-GPU shines: concurrency and context length
Dual GPUs unlock two things:
- More context — split model weights across two VRAM pools, enabling longer KV cache windows (e.g., TurboQuant enables 200K context on a single 24GB card; dual cards double that capacity)
- Concurrent throughput — 10+ simultaneous requests fill both cards like moving from 2-lane to 4-lane highway
The host’s multi-agent orchestration system relies on this: high-IQ models handle planning, while quantized, high-concurrency instances execute repetitive tasks simultaneously. The concept of “extreme leverage” — same hardware, same power draw, but 10×–50× token throughput through optimization and concurrency.
Optimization 5 — TurboQuant (KV Cache Compression)
TurboQuant compresses KV cache from FP16 to 3–4 bits — nearly 4× compression ratio with negligible quality loss.
| Card | Model Format | KV Cache | Context Window |
|---|---|---|---|
| RTX 3090 (24GB) | Q4 weights | FP16 cache | ~50K tokens (cache fills VRAM) |
| RTX 3090 (24GB) | Q4 weights | TurboQuant 3-bit cache | ~200K tokens |
With vLLM 0.20+ and locebox both supporting TurboQuant, this unlocks long-context workloads on consumer hardware that previously required A100-level VRAM.
Production Configuration
The host’s production setup prioritizes stability over peak speed:
| Component | Choice | Rationale |
|---|---|---|
| Model precision | FP8 | Best quality, native 4090 Tensor Core acceleration |
| Speculative decoding | MTP n=3 (not DFlash) | Stable, supports multi-concurrency; n=3 is the pinned-comment default |
| Framework | vLLM + PagedAttention | Production-ready concurrency |
| Concurrency target | ~10 concurrent requests → 500+ t/s aggregate | Multi-agent orchestration pipeline |
Host’s Pinned vLLM Launch Command
VLLM_USE_MODELSCOPE=true \uv run vllm serve qwen/Qwen3.6-27B-FP8 \ --speculative-config '{"method":"mtp","num_speculative_tokens":3}' \ --max-num-seqs 10 \ --max-model-len auto \ --port 5000 \ --enable-prefix-caching \ --gpu-memory-utilization 0.92 \ --reasoning-parser qwen3 \ --enable-auto-tool-choice \ --served-model-name qwen3.6 \ --tool-call-parser qwen3_coderKey flags:
| Flag | Purpose |
|---|---|
VLLM_USE_MODELSCOPE=true | Download from ModelScope (China mirror, faster than HuggingFace in Asia) |
--speculative-config '{"method":"mtp","num_speculative_tokens":3}' | MTP with 3 speculative tokens — balanced speed/stability for production |
--max-num-seqs 10 | Up to 10 concurrent sequences |
--gpu-memory-utilization 0.92 | Use 92% of VRAM for KV cache / model weights |
--enable-prefix-caching | Cache shared prefix across requests — critical for multi-agent workloads where prompts overlap |
--reasoning-parser qwen3 | Parse Qwen3 reasoning output format |
--tool-call-parser qwen3_coder | Parse tool calls from Qwen3-Coder style outputs |
--enable-auto-tool-choice | Let model decide whether to call tools |
RTX 5090 Alternative — GPTQ-MARLIN MoE at 211 t/s
A viewer reported that the host’s FP8+MTP config struggled on an RTX 5090 (stuck at ~25 t/s), but switching to GPTQ-Int4 with MARLIN quantization on the MoE variant Qwen3.5-35B-A3B delivered dramatically better results:
vllm serve Qwen/Qwen3.5-35B-A3B-GPTQ-Int4 \ --quantization gptq_marlin \ --dtype bfloat16 \ --kv-cache-dtype fp8 \ --gpu-memory-utilization 0.9 \ --max-model-len 32768 \ --max-num-batched-tokens 2096 \ --max-num-seqs 2 \ --enable-prefix-caching \ --reasoning-parser qwen3 \ --enable-auto-tool-choice \ --tool-call-parser qwen3_coder \ --trust-remote-code \ --port 5000 \ --served-model-name qwen3| Flag | Purpose |
|---|---|
--quantization gptq_marlin | GPTQ with MARLIN kernel — optimized for RTX 50-series Tensor Cores |
--dtype bfloat16 | Compute in BF16 despite INT4 weights (MARLIN upcasts internally) |
--kv-cache-dtype fp8 | FP8 KV cache — reduces memory pressure on long contexts |
--max-model-len 32768 | Fixed context window (not auto, which can overallocate) |
--max-num-batched-tokens 2096 | Limits per-step batch size to avoid OOM on MoE routing |
--max-num-seqs 2 | Conservative concurrency — MoE models are memory-intensive per request |
--trust-remote-code | Required for Qwen3.5-MoE custom model code |
Result: 211 t/s on a single RTX 5090 with the GPTQ-MARLIN + FP8 KV cache config — compared to only 25 t/s with the host’s original FP8+MTP setup. The MoE architecture (35B total, ~3B active per token) means far less memory bandwidth per step than dense models, and MARLIN is specifically optimized for the RTX 50-series compute path.
Hardware Economics — GPU as Asset
The host makes an argument for local compute as investment:
- RTX 4090 (48GB) purchased one year ago has appreciated in value, not depreciated
- RTX 3090 may also appreciate given DFlash + TurboQuant enabling previously impossible workloads
- Lucebox team optimizing CUDA kernel-level scheduling — Apple M5 Max has better energy efficiency out of box; RTX GPUs waste power on suboptimal dispatch and idle waits, not compute itself
The host references the Luce megakernel project (fusing all 24 layers of Qwen into a single CUDA dispatch on an RTX 3090 at 220W, hitting 1.87 tok/J — matching M5 Max efficiency while delivering 1.8× throughput). Most GPU power consumption is scheduling overhead, not computation.
Complete Optimization Pipeline Summary
| Step | Technique | Speed (t/s) | Improvement over FP8 baseline |
|---|---|---|---|
| 0 | FP8, no optimization | 20 | — |
| 1 | AWQ quantization | 48 | +140% |
| 2 | MTP n=5 speculative decoding | 108 | +440% |
| 3 | DFlash diffusion-based acceleration | 141 avg / 184 peak | +820% |
From 20 t/s to 184 t/s — a 9.2× speedup on a single RTX 4090, achieved through compounding software optimizations rather than hardware upgrades.
Framework Support Status (June 2026)
| Feature | vLLM | llama.cpp | Lucebox (GGUF/CUDA) |
|---|---|---|---|
| AWQ int4 | ✅ PagedAttention | ❌ | ✅ |
| MTP speculative decoding | ✅ n=1–5 | ⚠️ N-gram only (limited benefit) | ✅ |
| DFlash diffusion | Not merged | Not merged | ✅ (primary GGUF implementation) |
| DDTree branching | Not merged | Not merged | ✅ (budget=22, ~8.3 committed/step) |
| TurboQuant KV cache | ✅ vLLM 0.20+ | — | ✅ (Q4_0, 128K context on 24 GB) |
References
- Qwen3.6 27B,多种优化方式,从20t/s飙到184t/s,我是怎么做到的? — 小天fotos, YouTube (May 2026) — https://www.youtube.com/watch?v=edHNTFt5jYk
- DFlash on ggml: up to 207 tok/s Qwen3.5-27B on a RTX 3090 — Davide Ciffa, Lucebox Blog (April 2026) — https://lucebox.com/blog/dflash27b
- Luce megakernel: CUDA fusion beats Apple Silicon efficiency — https://lucebox.com/blog/megakernel
- Lucebox DFlash Repository — https://github.com/Luce-Org/lucebox-hub/tree/main/dflash
- ToolCall15 — Tool-calling benchmark dataset, Twitter/X trending
- vLLM 0.20 release notes — TurboQuant KV cache support added
This article was written by Qwen Code (Qwen 3.5 Coder Plus | Alibaba Cloud), based on content from: https://www.youtube.com/watch?v=edHNTFt5jYk


