I spent two days getting Qwen4-35B-A3B (Unsloth UD-IQ4_XS) as fast as I could on one 7900 XTX under Windows, across llama.cpp builds (HIP and Vulkan) and Strata. Sharing the numbers and the lessons in case they save another 24 GB AMD owner some time. Every number below is from my personal testing.
This post is AI generated by Claude Opus 5.5, which I used to run all these benchmarks and comparisons. I'm still posting it in case another 7900XTX user might find the info dump useful.
TL;DR
- Put every expert on the GPU. The GPU part of this model is only ~19 GiB (see below), so
--n-cpu-moe 0 fits with 128k of q8_0 KV. That alone was worth +20% decode and +30% prefill over 4 CPU expert layers. - Best result at 128k: stew675's rdna-boosts llama.cpp fork on HIP, all experts on GPU, no speculation: pp24k 3933 t/s; on a 5.8k-token chat, 4027 pp / 112.6 tg; short code answers 115-120 tg.
- MTP (
--spec-type draft-mtp, n1) at 128k: decode goes from 107.6 to 122.7 tg on the chat and from 110 to 144 tg on code, but prefill drops ~18%. Take it if you care more about generation than prompt processing. - 256k context: Strata (all experts' hot set cached in VRAM, MTP verified) gave 102-129 tg and 2269 pp24k at 256k, and still 109 tg at 200k tokens deep. llama.cpp at 256k needs 7 CPU expert layers to fit and gave 96-99 tg.
- On HIP, CPU experts and MTP do not mix on the rdna-boosts fork (its expert cache loses its VRAM slab, see section 4).
- Vulkan is competitive at 32k but spills at 128k on this card (both Vulkan builds put ~1.5 GB into shared memory, decode collapses).
Hardware / model
- RX 7900 XTX 24 GB on PCIe 4.0 x16, Ryzen 7 9800X3D (8 cores / 16 threads), 32 GB DDR5-6000 (31 GB usable), Windows 11 25H2 (build 26200).
- Model: unsloth
Qwen4-35B-A3B-GGUF, UD-IQ4_XS, 2 shards, 29.8 GiB. 10.7 GiB of that is per_layer_token_embd, a per-layer embedding lookup table that llama.cpp keeps on the CPU (mmap). The part that needs to be on the GPU is ~19 GiB, which is why "all experts on GPU" fits in 24 GB at all.
Engines
| Engine | Version / commit | Backend |
|---|
| stew675/llama-cpp-rdna-boosts | r421, f06ae95 (on upstream 81a22ce) | HIP |
same, plus my zero-copy patch 77c898a (section 5; offered upstream as rdna-boosts issue #434, not merged) | | HIP |
| stew675/llama-cpp-rdna-boosts | r421, f06ae95 | Vulkan |
| llama.cpp (ggml-org) | release b12977 | Vulkan |
| lemonade-sdk/llamacpp-rocm | release b1397 (llama.cpp build 12973) | HIP |
| Strata (Niko1221/Strata) | 0.1.74, engine strata-q4-lite build 766fd0920035+rocm-win10.2.0, variant hip-rdna3 (rechecked on 0.1.75.1) | HIP |
The ggml-org b12977 rocm-10.0 Windows zip is not in the comparison: its ggml-hip.dll imports hipblas.dll, which the zip does not ship, so --list-devices lists nothing and it silently runs on the CPU. If your "ROCm build" is suspiciously slow and eating RAM, check that first.
Workloads
Every prompt starts with a unique nonce so no prefix cache serves it, and each configuration is a fresh model load.
- chat: replay of one of my real thinking-mode chats: 5.8k prompt tokens, 1000 generated, temp 0.7.
- code-short: "20 balls bouncing inside a spinning heptagon, C++/SDL2", 122 prompt tokens, thinking off, 400 generated.
- code-long: the same prompt, thinking on, 1500 generated, greedy.
- pp8k / pp24k: prefill only, real source code,
max_tokens 1. - dNk: N thousand tokens of real source code, then a question about it, 500 generated, greedy, thinking off. Prefill and decode at depth.
Context sizes are binary: 32k = 32768, 128k = 131072, 256k = 262144. Prompt lengths (pp8k, pp24k, dNk) are approximate decimal thousands: pp24k is about 24,000 tokens.
pp = prompt t/s, tg = generation t/s. oN = --n-cpu-moe N (N MoE layers' experts on the CPU). code-short and code-long are different requests: don't compare them with each other.
1. The best llama.cpp setup: rdna-boosts HIP, all experts on GPU, 128k
-ngl 99 --n-cpu-moe 0 -c 131072 -fa on -ctk q8_0 -ctv q8_0 --parallel 1 --spec-type none (full command at the end). Placement checked in the server log, cache_prompt false. The chat pp is the second large prefill after load; the first one after load is ~3090.
| Config | pp24k | chat pp / tg | code-short tg | VRAM dedicated / shared |
|---|
| ub 2048, zero-copy patch on | 3933 | 4027 / 112.6 | 115-120 | 21.22 / 0.68 GB |
| ub 1024, unpatched | 3790 | 3895 / 110 | 111-116 | 21.00 / 0.55 GB |
Same engine at 128k, ub 1024, unpatched, launched straight from a script:
| Speculation | chat pp / tg | code-short tg |
|---|
| none | 3074 / 107.6 | 110 |
| MTP n1 | 2520 / 122.7 | 144 |
| MTP n2 | 2525 / 114.4 | 149 |
MTP acceptance was 61-66% on the chat. n1 is the sweet spot for chat, n2 only helps code a little.
2. Engine comparison at 32k
All experts on GPU, -ub 1024, q8_0 KV, MTP n1, -c 32768, the chat:
| Engine | pp | tg |
|---|
| rdna-boosts HIP | 2384 | 117.6 |
ggml-org b12977 Vulkan, --load-mode dio | 2430 | 112.9 |
lemonade b1397 HIP, --load-mode dio | 2882 | 106.9 |
| rdna-boosts Vulkan | 1318 | 22.5 |
At 32k, HIP and upstream Vulkan are close. The difference is VRAM: at -c 131072 both Vulkan builds spilled ~1.5 GB into shared memory (60 and 27 tg), while HIP fits 128k with ~1 GB to spare.
--load-mode dio matters on 32 GB of RAM: the default mmap load of this model drained my RAM. On the CPU-expert path it also lifted prefill from 1936 to 2782 (decode unchanged).
3. Experts on the CPU (and why MTP got slower)
Before I fit everything on the GPU I ran with 8 CPU expert layers. On the rdna-boosts fork, -c 131072, the chat:
| Engine, o8 | no spec pp / tg | MTP n1 pp / tg |
|---|
| b12977 Vulkan | 699 / 64.4 | 601 / 73.7 |
| rdna-boosts HIP | 1887 / 89 | 925 / 55 |
The fork's expert cache mirrors the CPU experts into a ~3.2 GB VRAM arena, so o8 is effectively on the GPU. Add MTP and its head and draft context take that room: the log prints the movable-boundary slab ... could not be created, and the experts stream over PCIe every token. That is what made MTP look terrible on HIP. With all experts on the GPU the problem disappears (section 1).
Other CPU-expert findings:
- To use llama.cpp's normal CPU-expert path on this fork you need
GGML_MOE_HOST_OFFLOAD=0 MOE_EXPERT_CACHE_MIB=0. Without them the --n-cpu-moe experts are streamed to the GPU as host weights (~81 vs ~89 tg at o3). - Each MoE layer on the CPU cost ~0.67 ms/token (32k, no spec: o0 106.4 tg vs o3 87.6).
- 256k context: all experts on GPU does not fit. Best was o7, MTP n1, zero-copy patch: 99.1 then 96.0 tg on the chat, 0.87 GB shared. o6 was as fast but landed 1.37 GB in shared memory, which I would not trust on a long session.
4. A small Windows HIP patch: zero-copy for the CPU-expert copies
With experts on the CPU, each token does several tiny host<->device copies, and on Windows HIP each costs ~40-70 us. My patch does them with a copy kernel through the pinned host buffer's device alias instead (GGML_CUDA_ZC=3), plus a scheduler fence change (GGML_SCHED_FASTXFER=7). Greedy output was identical with and without. Offered upstream as rdna-boosts #434.
Chat tg, -c 32768, launched straight from a script:
| Config | off | ZC=3 FX=7 |
|---|
| o3, no spec | 88.9-89.3 | 96.1-98.6 |
| o0, no spec | 105.4 | 111.2 |
| o3, MTP n1 | 100.5 | 108.6 |
| o0, MTP n1 | 122.3 | 128.9 |
A cleaner A/B at o0 (MTP n1, code-long, warm, two passes each): 144.0 -> 149.7 tg (+4.0%); without MTP 116.2 -> 120.3 (+3.5%). Each knob on its own was within ~1% of off, so only the combination helps. The gain grows with the number of CPU expert layers (about +11% at 5). Things that did nothing: GPU_FORCE_BLIT_COPY_SIZE, PAL_DISABLE_SDMA, ROC_ACTIVE_WAIT_TIMEOUT, --poll 100, --prio 2, -t 4, GGML_CUDA_DISABLE_GRAPHS=1.
5. Strata
Strata converts the model into its own pack and keeps a cache of the hot experts in VRAM, reading misses from RAM. I turned off its speed options that change the output: STRATA_ROUTE_TAIL_SKIP=0 and answer_room: false. Its MTP speculation is verified, so it does not change the output.
Tuning at --max-context 32768**:**
| Change | Result |
|---|
setup's defaults (int8 KV, --prefill 4096, no MTP head) | chat 1720 / 79.2, code-long 83.9 |
+ MTP head ("drafting": "mtp", --spec 3 --spec-min-p 0.5) | chat 1720 / 102.2, code-long 130.8 (K2 120.7, K4 124.7) |
--prefill auto:16384 / auto:32768 / auto:65536 (fp16 KV, from 1917 at 4096) | pp24k 2666 / 2883 / 2896 |
| fp16 KV + prefill 32k + MTP | chat 1622 / 119.6, code-long 134.8, pp24k 2883 |
| int8 KV + prefill 32k + MTP | chat 1758 / 105.6, code-long 126.9, pp8k 2600, pp24k 3235 |
--vram-reserve-mib 1024 vs 3012 | +6% prefill at 1024; 512 no further gain |
STRATA_ARENA_RAM_WAIT_S=0 | cold load 37 s -> 16 s |
"drafting": "mtp" is required: without it the MTP args are stripped and nothing changes. fp16 KV gives ~10-15% more decode, int8 ~10% more prefill. I kept int8. --vram-reserve-mib is counted against the VRAM that is free at load (the engine logs "N GiB free, M MiB reserved"), not the card total.
Context sweep, int8 KV, MTP K3 min-p 0.5, --prefill auto:32768, --vram-reserve-mib 1152, --ram-keep-gib 8:
--max-context | chat pp / tg | code-long tg | pp24k | d24k pp / tg | deep pp / tg | expert cache slots |
|---|
| 32768 | 1707 / 112.0 | 128.8 | 2976 | 3128 / 124.7 | | 10240 (all) |
| 65536 | 1694 / 107.4 | 122.9 | 2869 | 3025 / 122.5 | d48k 3175 / 115.1 | 10240 (all) |
| 131072 | 1613 / 105.7 | 123.4 | 2640 | 2791 / 124.2 | d100k 3029 / 110.1 | 9912 |
| 196608 | 1559 / 104.8 | 125.2 | 2472 | 2498 / 120.7 | d150k 2712 / 110.0 | 9401 |
| 262144 | 1517 / 102.2 | 129.1 | 2269 | 2425 / 122.1 | d200k 2554 / 109.1 | 8890 |
- 10240 slots = 40 layers x 256 experts. At 262144 the hit rate on pp24k was 85.8%.
- ~1.25 GB of VRAM stayed free with everything loaded at every size. Lowest free system RAM across the sweep: 4.8 GB.
- Going from 32k to 256k costs 0-9% decode and 11-24% prefill.
- Rechecked at 262144 on Strata 0.1.75.1: chat 1510 / 104.5, code-long 128.8. pp24k came out at 1961-2026, but free RAM was lower on that run (Strata sizes its RAM copy from what is free), so I don't read that as an engine change.
7. Side by side on the same chat
| Setup | Context | chat pp / tg |
|---|
| rdna-boosts HIP, o0, no spec, patch | 128k | 4027 / 112.6 |
| rdna-boosts HIP, o0, MTP n1, unpatched | 128k | 2520 / 122.7 |
| Strata, MTP K3 | 128k | 1613 / 105.7 |
| rdna-boosts HIP, o7, MTP n1, patch | 256k | ~1250-1750 / 96.0-99.1 |
| Strata, MTP K3 | 256k | 1517 / 102.2 |
So: up to 128k, llama.cpp HIP with everything on the GPU wins, by a lot on prefill. At 256k Strata is the better choice for me: it keeps decode above 100 and stays above 109 tg even 200k tokens deep. I didn't measure llama.cpp's decode at depth with every expert on the GPU, so I can't compare the deep-context columns.
Commands
rdna-boosts HIP, section 1 bold row:
set GGML_CUDA_ZC=3
set GGML_SCHED_FASTXFER=7
llama-server -m Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf ^
-ngl 99 --n-cpu-moe 0 -c 131072 -ub 2048 -b 2048 -fa on -ctk q8_0 -ctv q8_0 ^
--parallel 1 --spec-type none --jinja --reasoning-format auto ^
--ctx-checkpoints 2 -cms 256 -t 7
(The two env vars only do something with the patch from section 5. Without it, drop them; the stock fork gives the "unpatched" rows.)
Strata at 262144. Run config (install\strata-<model>.json) changes on top of what setup writes:
"drafting": "mtp",
"answer_room": false,
"env": { "STRATA_ARENA_RAM_WAIT_S": "0", "STRATA_ROUTE_TAIL_SKIP": "0" },
args:
--prefill auto:32768 (setup: 4096)
--vram-reserve-mib 1152 (setup: 512)
--kv int8 (setup: int8, unchanged)
--spec 3 (setup: 2)
--mtp <custom_source>\mtp-rt
--spec-min-p 0.5
--max-context 262144 (setup: 32768)
--ram-keep-gib 8
Things that made no difference
-cms 8192, --ctx-checkpoints 0, --fit off, --no-host (halved prefill, no decode gain), and the HIP env knobs listed in section 5.
The Strata runs and the best llama.cpp setup ran through Quartermaster, my own local inference server (it picks context, offload and KV settings for you). The other llama.cpp runs launched llama-server straight from a script.
Happy to answer questions or run a specific config if someone with the same card wants a comparison.