One Env Var Took Qwen3.8-27B From 10 to 74 tok/s on an RX 7900 XTX (Short Prompts) — Then 48K Rewrote the Story
Single Source of Truth (SSOT): All local measurements below were taken on a single Windows 11 machine with one AMD Radeon RX 7900 XTX 24 GB, using the same Qwen3.8-27B-UD-Q4_K_M model file throughout. Nothing is borrowed from another machine, another quant, or another context length. The one upstream figure we cite (146 tok/s) is explicitly labeled as such and was not reproduced here. Where a comparison is not apples-to-apples, it is labeled that way.
The short version — if you only read one box, read this one:
- A process-scoped env var,
GGML_VK_DISABLE_HOST_VISIBLE_VIDMEM=1, took short-prompt decode from about 10 to 38 tok/s; stacking MTP n=3 reached 73.77 tok/s — short prompts only. - At a real 48K prompt, HIP wins on reading, not writing: prefill +44.5%, TTFT −30.8% (~26 s less waiting), but decode stays flat at 52.11 vs 51.22 tok/s.
- HIP’s speed costs memory: about 4 GiB more VRAM at 48K (22.5 vs 18.5 GiB), leaving under 2 GiB of headroom on a 24 GB card.
- Around 20K context, HIP is the better all-rounder and still has VRAM to spare.
- The 146 tok/s BridgeSpec/DFlash figure is an upstream 8K result — we never ran it locally (P0 preflight only).
Prefer to watch? The full benchmark walkthrough is embedded at the top of this page; this write-up gives you the numbers and the reasoning behind them.
Same GPU. Same 24 GB. Same GGUF weights. No new card, no driver swap, no re-download. On short prompts, one child-process environment variable lifted decoding from about 10 to 38 tok/s, and adding MTP speculation pushed it to 73.77 tok/s. That headline is real — but it is a short-probe result, and it is not what you get at 48K context. The long-context story is more interesting and more honest, so let’s walk through it end to end.
The Test Rig
| Component | Spec |
|---|---|
| OS | Windows 11 |
| GPU | AMD Radeon RX 7900 XTX 24 GB (24,560 MiB dedicated VRAM) |
| CPU | AMD Ryzen 7 3700X (8-core) |
| RAM | 96.0 GB DDR4-3200 (95.9 GB usable) |
| Driver | 32.0.32015.7029 |
| Model | Qwen3.8-27B-UD-Q4_K_M.gguf — 16,464,440,224 bytes (~15.33 GiB) |
Everything in this post isolates a single GPU. If you run a dual-GPU Linux box, your baseline will not match — and that is the point: this is a clean, single-card Windows story.
Why It Started at ~10 tok/s
On the baseline Vulkan build (b12019, 32K context, 18,126 input / 1,024 output, MTP off), decode sat at 10.21 tok/s, with prefill at 189.28 tok/s, TTFT 95.816 s, total 196.045 s, and 16,134.3 MiB dedicated VRAM.
The instinct is to “just turn on speculative decoding.” That instinct is wrong when the bottleneck lives somewhere else. With MTP enabled but the host-visible VRAM mapping left untouched, MTP n=2 only reached 14.60 tok/s (TTFT 102.876 s, 71.29% accept) and MTP n=3 actually dropped to 13.64 tok/s (TTFT 103.741 s, 57.37% accept). Throwing more speculation at a memory-mapping problem does not fix the memory-mapping problem.
The One-Line Fix (Short Probe)
The fix is a process-scoped environment variable applied only to the Vulkan llama-server child process:
$env:GGML_VK_DISABLE_HOST_VISIBLE_VIDMEM = "1"
This does not change any global system setting — it only alters how that one process maps VRAM. On a short-probe workload (same card, same model, MTP off):
- Step A → Step B: server decode went from 10.38 to 38.50 tok/s (probe median 10.4 → 38.7). Dedicated VRAM moved 16,193.5 → 16,533.2 MiB, and shared memory fell from 1,524.0 → 1,190.4 MiB.
- Step C: with the env var plus
--spec-type draft-mtp --spec-draft-n-max 3, short-probe decode reached 73.77 tok/s (probe median 73.8), MTP accept 70.93%, dedicated 17,578.5 MiB.
Read this carefully: 73.77 tok/s is a SHORT-PROBE (short-prompt) result only. It must never be quoted as a 48K or 64K–256K long-context number. The controlled A/B here points to host-visible VRAM mapping overhead — but we will not overclaim that an independent GPU kernel profiler isolated a single hardware root cause; the evidence is a strong controlled A/B, not a profiler trace.
Is your ~10 tok/s the same problem?
Before you change anything, run a quick self-test. If your Vulkan llama-server crawls at single-digit-to-low-teens tok/s on short prompts while prefill still looks normal, set the env var and re-measure with the exact same binary, model, and prompt. In our A/B, that one variable alone moved decode from 10.38 to 38.50 tok/s — a clean, repeatable signal that you are hitting the same host-visible VRAM mapping overhead. If you see no change at all, your bottleneck is elsewhere (driver, layer offload, thermals, or a different backend), and speculative decoding by itself will not rescue you.
The Real Test: 48K Long Context
Short probes are a warm-up. The decisive run is a genuine long-context prompt: a 64K window (65,536), 47,808 input tokens, MTP n=3, with a 3-needle retrieval check.
| Metric | Vulkan b12019 (+env) | Windows HIP ROCm b1381 |
|---|---|---|
| Output tokens | 263 | 233 |
| Prefill | 562.23 tok/s | 812.15 tok/s (+44.5%) |
| Decode | 52.11 tok/s | 51.22 tok/s (flat, −1.7%) |
| TTFT | 85.114 s | 58.940 s (−30.8%, ~26.2 s less) |
| Total | 90.144 s | 63.471 s |
| MTP accept | 63.70% | 63.33% |
| Retrieval | 3/3 | 3/3 |
| Dedicated VRAM | 18,481.6 MiB (~18.05 GiB) | 22,536.2 MiB (~22.01 GiB, +4,054.6 MiB) |
Here is the honest reading of that table:
- HIP’s win is in ingestion, not generation. Prefill jumped +44.5% and TTFT dropped about 30.8% (~26.2 s less waiting). If your workload is “read a large document, then ask questions,” that is a real, felt improvement.
- 48K decode is flat. It moved 52.11 → 51.22 tok/s — essentially unchanged, marginally lower. HIP speeds up reading, not writing. Any claim that +44.5% applies to decode is false.
- Total time is a same-prompt reference only. The 90.144 s → 63.471 s drop looks like −29.6%, but the two runs produced 263 vs 233 output tokens. Different output lengths mean you cannot treat total time as a strict A/B; quote it only with that caveat attached.
- HIP costs VRAM. Dedicated peak rose to 22,536.2 MiB, about 4,054.6 MiB more than Vulkan — close to the 24,560 MiB cap (under 2 GiB of headroom). On a 24 GB card, that is the price of admission.
The 20K Sweet Spot
If 48K leaves too little VRAM for your other apps, the ~20K window is the comfort zone (32K context, 19,754 input, MTP n=3):
| Metric | Vulkan b12019 (+env) | Windows HIP b1381 |
|---|---|---|
| Output tokens | 324 | 355 |
| Prefill | 669.09 tok/s | 908.76 tok/s |
| Decode | 59.31 tok/s | 62.03 tok/s |
| TTFT | 29.548 s | 21.763 s |
| Total | 34.994 s | 27.471 s |
| Retrieval | 3/3 | 3/3 |
| Dedicated VRAM | 17,632.3 MiB | 18,808.8 MiB |
At 20K, HIP is faster on prefill, TTFT, and decode, and it still keeps VRAM headroom. One caveat: these two runs also produced different output lengths (324 vs 355 tokens), so treat the total-time gap (34.994 vs 27.471 s) as a same-prompt reference rather than a strict A/B. Prefill and decode are per-token rates, and TTFT is measured on the same prompt, so those three are directly comparable. This is the sweet spot for most interactive long-document work on a single 24 GB card.
BridgeSpec + DFlash 2: Where We Stopped
You may have seen a 146 tok/s figure tied to BridgeSpec + DFlash 2. That number is an upstream 8K fixed-predictable code-edit development peak — it is not a local 48K result, and we never reproduced it.
Local work on this path stopped at P0 preflight for concrete reasons: the required Q4_0 base model was missing, the 5-layer DFlash draft model was missing, and the Windows SDK build environment was unverified. We did not download the models and did not run the benchmark. So this post makes no local DFlash claim — the honest status is “P0 blocked, P1–P3 not run.”
Which Backend Should You Pick?
| Your workload | Choose | Why |
|---|---|---|
| Long PDF / RAG ingestion, VRAM is not tight | HIP ROCm b1381 | +44.5% prefill, ~26 s less TTFT at 48K |
| Tight VRAM, or you run other GPU apps alongside | Vulkan b12019 + env var | ~4 GiB less VRAM at 48K |
| Interactive chat and ~20K documents | HIP b1381 | faster prefill, TTFT and decode, with headroom |
| Reproducible short-prompt burst speed | Vulkan + env + MTP n=3 | 73.77 tok/s, short-probe only |
Reproduce It
Core inference arguments (both backends), context 32768 or 65536 as needed:
llama-server -np 1 -ngl 999 -fa on --reasoning off -ctk q4_0 -ctv q4_0 --jinja --spec-type draft-mtp --spec-draft-n-max 3
Set the Vulkan-only env var for the Vulkan process, and explicitly remove it before switching to HIP:
$env:GGML_VK_DISABLE_HOST_VISIBLE_VIDMEM = "1" # Vulkan process only
Remove-Item Env:\GGML_VK_DISABLE_HOST_VISIBLE_VIDMEM # clear before HIP
The Takeaway
One environment variable genuinely turns a barely-usable 10 tok/s into a lively short-prompt experience. But the moment you push to real 48K context, the physics reassert themselves: HIP accelerates reading (prefill/TTFT) by ~44.5%, leaves generation (decode) flat at ~51–52 tok/s, and asks for ~4 GiB more VRAM in return. Match the backend to your workload — ingestion vs. generation, headroom vs. speed — and the single 24 GB card does far more than its spec sheet suggests.
Public References
- llama.cpp — https://github.com/ggml-org/llama.cpp
- Windows HIP ROCm b1381 release — https://github.com/lemonade-sdk/llamacpp-rocm/releases/tag/b1381
- Qwen3.8 MTP probe — https://github.com/sudoingX/qwen38-mtp/blob/master/probe.py
- BridgeSpec — https://github.com/kdheeraj-p/bridgespec
- BridgeSpec RX 7900 XTX benchmark CSV — https://github.com/kdheeraj-p/bridgespec/blob/main/benchmarks/data/qwen38-27b-rx7900xtx.csv
- AMD Windows HIP system requirements — https://rocm.docs.amd.com/projects/install-on-windows/en/latest/reference/system-requirements.html
All tests were run on a single Windows 11 RX 7900 XTX 24 GB. The 10 → 74 tok/s jump applies to short prompts only. At 48K, HIP improves prefill and TTFT but leaves decode flat and raises VRAM. Total-time comparisons use different output lengths (263 vs 233 at 48K; 324 vs 355 at 20K) and are same-prompt references only. No private repository links are included.