Patching vLLM for a 55-60% faster Qwen3.8-27B on two RTX 3090s
- Hardware
- 2x RTX 3090, 300W power limit
- Models & engines
- Qwen3.8-27B-AWQ-INT4 with a DFlash2 K=7 drafter
vLLM 0.33.0 and LMCache 0.5.6, patched
Patches, step_probe.py, logit_diff.py and an AGENTS.md + skills/ kit in the llm-engine-qwen-optimization repo - Key gotcha
- Pushing quantization harder than INT4 AWQ made the model get stuck in reasoning loops
What they built
u/Old_Ad_6033 runs Qwen3.8-27B-AWQ-INT4 with a DFlash2 K=7 speculative drafter on a box with two RTX 3090s at a 300W power limit. Having concluded that INT4 AWQ is the quality floor for this model, they left the weights alone and looked for speed that vLLM and LMCache were leaving on the table.
The post (written with an agent, then rewritten by the author) compares stock vLLM 0.33.0 against their patched build on the same rig, and shares the patches as plain git diffs with measurement scripts.
Setup
- 2x RTX 3090, 300W power limit
- Qwen3.8-27B-AWQ-INT4 with a DFlash2 K=7 drafter
- vLLM 0.33.0 and LMCache 0.5.6, patched
- Patches, step_probe.py, logit_diff.py and an AGENTS.md + skills/ kit in the llm-engine-qwen-optimization repo
How it works
- Moved the drafter into CUDA graphs (with software FP8 KV decode, since 3090s lack it in hardware) and had FlashInfer pre-plan page counts, so the GPU stops waiting on the CPU each step
- Added a Marlin launch path for small batches (M <= 8), quantized the drafter's lm_head to NVFP4, and sped up sliding-window draft attention
- Cut agent-loop prefix caching from 1,600-token to 64-token granularity and stopped LMCache re-reading chunks from NVMe that were already in VRAM
- Each patch sits behind an env var; off means stock behavior
Results & numbers
- Decode step time at a short prompt went from 25.42 ms to 15.83 ms (+60.6%); at 16K context from 105 to 163 tokens/s
- Agent-loop time to first token at 64K + 50 new tokens went from 940.4 ms to 106.2 ms
- GPU idle time per step dropped 81-86%, and the KV cache pool grew 18.7%
- Top-20 decode logit KL vs stock was 4.15e-4 with a 99.64% top-1 match; the main model weights and BF16 lm_head are untouched
Gotchas
- Pushing quantization harder than INT4 AWQ made the model get stuck in reasoning loops
- They hit an upstream copy-on-write bug that was silently zeroing KV cache
- The constants are tuned for 2x3090; don't copy them as-is to other GPUs
- nsys shows 74% of each step is now raw VRAM bandwidth, so little is left to gain on this hardware
“74% of each step is just streaming weights at the 3090's raw VRAM bandwidth”— u/Old_Ad_6033
Do it yourself
- Benchmark your stock vLLM decode step time and agent-loop TTFT first
- Clone the repo and apply the diffs on top of vLLM 0.33.0 and LMCache 0.5.6
- Enable patches one env var at a time and re-measure
- Check output drift with the logit_diff script before trusting a patch
- Re-tune the constants for your own GPUs rather than copying the 3090 values
Similar setups
Tencent's DSpine drafter on a 3090: faster single-agent Qwen 27B in llama.cpp, slower when busy
Timothy Lewis rounded up llama.cpp numbers for Tencent's 2B DSpine speculative drafter in front of a local Qwen3.8-27B and explains when it helps and when it doesn't.
Bringing up vLLM and llama.cpp on a DGX Spark with the network fully blocked
Ashwin J.B. spent about a week getting vLLM, llama.cpp and a native backend to serve on an arm64 DGX Spark (GB10) with all outbound traffic blocked, and wrote down every error, its fix and the speeds he measured.
Coding with a local Qwen 3.8 27B on a self-hosted NVR project: what worked and what didn't
Willy (Shimitar) used Open WebUI, OpenTerminal and llama.cpp running Qwen 3.8 27B to add RTSP streaming, themes and docs to his open-source camera viewer LazyNVR, and found it failed at big autonomous changes but excelled at small, tightly reviewed steps.
Local code review bots on one RTX 3090 with Ollama, LiteLLM and Gitea
TechLuddite runs local 4-bit models as advisory code reviewers on pull requests in a home lab, and measured which of ten models found real problems.