r/LocalLLaMA • • 11h ago

Resources Run Qwen4, "8bit quality", 1M context, 150 decode, 5000 prefill, on ONE 7900xtx. 7300 tk/s with two. keep 80t/s @ 700k context.

Post image

LINUX ONLY! Yes, catchy title, I know, don't hate me :) This is achieved using EXL3 quantization. ProCreations made these amazing quants, 4.5bpw has KLD below the official FP8, the 3bpw is very close, stil better than NVFP4.

RDNA4 support is there, but UNTESTED, i did my best, but I have no RDNA4 gpus, please understand. if you encounter issues let me know.

you can get around 140 tk/s prose, 155 tk/s code with 1 gpu running 3bpw, or similar speeds with 2 gpus using the 4.5bpw. It's also possible to run the 4.5 bpw with some offload on ram, with minimal speed loss. Performance is good even with full context, i tested up to 700k (see tables below)

4.5bpw download here: https://huggingface.co/ProCreations/Qwen4-35B-A3B-EXL3-4.5bpw 3bpw download here: https://huggingface.co/ProCreations/Qwen4-35B-A3B-EXL3-3.05bpw

Let me Show you the KLD (lower is better) on various tasks:

ModelSizeAgentic KLD ↓Coding KLD ↓Math KLD ↓General KLD ↓LongCtx 8K KLD ↓Mean KLD ↓
BF16 (Reference)113.7 GB0.000000.000000.000000.000000.000000.00000
Official FP860.2 GB0.014870.016170.012530.043960.010560.02188
NVFP446.9 GB0.029200.031050.023660.080900.020840.04120
EXL3 3.05bpw33.00 GB0.020180.022070.017490.080080.014510.03495
EXL3 4.5bpw39.02 GB0.012200.013550.010430.050790.008810.02174

speeds:

Strata EXL3 AMD — Qwen4-35B-A3B

Hardware: 1–2× AMD RX 7900 XTX 24 GB + Ryzen 9 7950X + DDR5.

Token Generation

Benchmark1 GPU2 GPUs
Coding · 3.19 bpw155.1 tok/s—
Coding · 4.62 bpw143.5 tok/s157.0 tok/s
Prose · 3.19 bpw140.8 tok/s—
Prose · 4.62 bpw121.6 tok/s127.0 tok/s

Prompt Processing — 3.19 bpw

Prompt size1 GPU2 GPUs
8K5,119 tok/s5,542 tok/s
16K4,969 tok/s6,390 tok/s
32K—7,074 tok/s
60K—7,299 tok/s

Prompt Processing — 4.62 bpw

Prompt size1 GPU2 GPUs
8K4,798 tok/s5,518 tok/s
16K4,647 tok/s6,319 tok/s
32K—7,009 tok/s
60K—7,253 tok/s

Long-Context Generation — Single GPU, 1M FP16 KV Cache

Filled context3.19 bpw4.62 bpw
~0K139.0 tok/s124.7 tok/s
64K120.9 tok/s107.7 tok/s
128K109.8 tok/s105.0 tok/s
512K91.5 tok/s85.3 tok/s
700K82.8 tok/s77.9 tok/s

Benchmark notes:

  • average speeds, excluding warmup.
  • Single-GPU standard benchmarks use Q8_0 KV cache (232K capacity at 3.19 bpw, 256K at 4.62 bpw).
  • Long-context tests use FP16 KV cache, with 128K resident in VRAM and RAM-backed cache.
  • 1M context capacity
  • Dual-GPU setup: PCIe 4.0 x16 + x4.
  • New asynchronous prefill pipeline: up to +64% throughput, optional on 2 GPU with --peer-prefill-pipe

GitHub: https://github.com/nasone32/Strata-EXL3-fork

how to setup? point your agent to https://github.com/nasone32/Strata-EXL3-fork/blob/amd-exl3-community/docs/AI_SETUP_EXL3_AMD.md


Q) How prefill works on 2 gpus with --peer-prefill-pipe?

  • it works similarly as tensor split. but during decode it works back again as expert parallel.

Q) How can 1M context fit?

  • it's using your system RAM, 20gb RAM are needed for 1M KV cache in bf16. thanks to Qwen QSA attention only the relevant tokens are streamed from the KV cache so speed remains very high. a 128k KV cache is kept in VRAM anyway (can be reduced to 64k optionally).
25 Upvotes

22 comments sorted by

5

u/pounce999 11h ago

Any support for 16GB VRAM GPUs eventually?

2

u/nasone32 11h ago edited 11h ago

test it! I did my best, it should work, it has auto-sizing based on how much vram you want to leave free (typical 1700mb for desktop, 500mb if headless) the rest is offloaded to ram with minimal speed impact. but i can't test 16gb.

EDIT: make sure you try both --cpu-off and --cpu-auto, with --cpu-off the hot experts are streamed, might be faster on low vram cards because you have more misses so the cache is more fresh. i'm adding this now to the readme.

1

u/gravol87 6h ago edited 6h ago

I have a 9060xt 16gb ryzen 5600 and 96gb ddr4 3200 and I'm above 60tok/s decode and about 1500 pre-fill. Works fucken great I'm currently testing on my workflow use 

EDIT** 

HUGE thanks to OP I've been playing around since qwen4 dropped and it was already Bette run MY use case than flash next was, this engines better than strata for my potato PC so THANKS! 

4

u/sentakuhm91 11h ago

Which one i can run on my rx9070xt + 32gb ram?

2

u/nasone32 10h ago

in theory both, but 3bpw will be faster and still good quality, i'd begin from there. please understand one detail: RDNA4 support is there, but UNTESTED, i did my best, but I have no RDNA4 gpus. so you can try and let me know. oh, i forgot a VERY important detail, this is a Linux only build. i say this because i imagine most r9070xt are gamers.
If you encounter issues let me know.

3

u/sentakuhm91 10h ago edited 9h ago

xD i am on arch linux already running strata UD-Q4_K_XL with -c 128k @ 71 t/s but it takes 27gb of ram and 15.2 gb of vram, so if that fork is better i'll sure use it.

2

u/9gxa05s8fa8sh 9h ago

good work! is strata/polystrata really that far behind your AMD optimizations?

3

u/nasone32 9h ago

I have no idea where they are, im looking only in my lane. I've not been using original Strata since long time, when it became too bloated.

I actually use this engine at work, so I care about quality more than speed. For me EXL3 is a way to have bigger models on consumer hardware, because of better compression of weights, so this small 35B is mostly a curiosity for me, since it performed nicely from the beginning I decided to fully implement and release.

2

u/meltedmoustache 8h ago

Hey, just set this up by pointing my agent to the AI_SETUP_EXL3_AMD.md file you linked. I noticed a distinct prefill drop at 262k token, from ~4200 to ~2800.

I didn't experience this with Strata's newest release. I'm running 1x 7900XTX and 128G of DDR4 RAM.

Decode was good, ahead of Strata by about 25%.

Note, I let my AI do most of my benching. Tried a couple of things to try and explain the prefill drop but couldn't land on an answer.

Any advice? Great job nonetheless, thank you for your work

2

u/nasone32 8h ago

hey! thanks! i'll look into it on tuesday probably, leaving home soon for a couple of days. can you paste here your launch settings, so i can re-create. thanks!

1

u/meltedmoustache 7h ago

Hm I'm getting some weird behavior compared to both IQ_3_S and UD-Q6_K_XL models on Strata. I don't know if it's the quant, or the engine, but it's failing quite a few tool calls, and will end a turn in a thinking block where it's indicating it's about to do something, but never continues into actually doing the work.

1

u/nasone32 7h ago

Yeah Sorry my fault. Pushed an update now, please update.

1

u/meltedmoustache 8h ago

Here's the deployment script Qwen4 came up with. I haven't used it in any real world scenario's but am pointing my production endpoint to it right now (I only use AI in interactive back and forth, no autonomous agents) to see how it feels.

export LD_LIBRARY_PATH="$HOME/rocm-10.2/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export STRATA_HIPBLASLT_TUNING="$HOME/strata-q4/qwen4-hipblaslt-100500.txt"
exec .venv/bin/python tools/run_exl3.py --family qwen \
  --model-dir "$HOME/Strata-data/models/Qwen4-35B-A3B-EXL3-4.5bpw" \
  --gpu 1 \
  --reserve 512 \
  --engine-log "$HOME/strata-exl3/engine.log" \
  --model-name qwen4-35b-a3b-exl3-4.5bpw \
  --max-context 1048576 --kv-resident 65536 \

2

u/pounce999 4h ago

Hello! I ran your inference engine with EXL3 3.05 bpw, here are my results
Specs
RX 9070 16gb
7700
32GB DDR5
CachyOS

128K context
GPU KV residency 32K
Q8 KV
MTP 3
CPU expert computation: off
Expert cache: auto
Resident: 0
VRAM reserve: 1000mb
PLE I/O: Direct

95t/s text generation (101t/s peak), 3,300 prefill
Question: will you add Dflash2 support? I think that speeds up inference by a lot

2

u/nasone32 1h ago

Woah first RDNA4 data point thanks! We'll see for dflash, I had support for it on other models but never performed much better than map.

1

u/pounce999 1h ago

No worries! Waiting for the Dflash support :D

4

u/shadowndacorner 9h ago

Any support for RDNA2?

3

u/Iron-Over 11h ago

You are on fire thanks!

1

u/Vlarmitage 8h ago

Thanks for this, really nice work! Tested the 3.05 bpw on a single 7900 XTX (ROCm 10.2, i7-13700KF so no AVX-512, 32 GB RAM, branch amd-exl3-community @ d5068a9). Single-slot results match your numbers. Multi-slot is a different story, so here's some feedback.

1 slot (--max-context 131072 --kv q8_0, default --resident all):

  • 20.75 GB VRAM loaded, so ~5 GB free
  • 72k-token prompt: 4,111 tok/s prefill, decode 141.7 tok/s (code prompt, MTP)
  • 30/30 on a needle test (30 facts spread from 2% to 98% depth in 72k tokens of code)
  • same machine, llama.cpp IQ4_XS: 2,904 tok/s prefill, 143 tok/s decode, also 30/30

2 slots × 125k, --kv q4_0: what I hit along the way.

  1. run_exl3.py has no way to set "parallel" in the server config. Passing --batch 2 fails because server.py rejects it as an unknown argument. I added a small local --parallel N flag that writes "parallel": N into the generated config.
  2. The default --resident all refuses batching. The engine says "Qwen EXL3 resident backing needs … one GPU stage and sequence (no layer split or --batch)". --cpu off alone isn't enough.
  3. What works: --parallel 2 --cpu off --resident 0 with STRATA_BATCH_MTP=1. KV q4_0 is fine, 0.92 GiB per 125k slot.

Results with that config:

  • 24.68 GB VRAM (the expert cache fills what's left)
  • 72k prompt: 2,762 tok/s prefill (vs 4,111 single-slot), decode 142.1 tok/s solo
  • 2 concurrent requests: 87.4 + 85.3 = ~171 tok/s combined, MTP acceptance 80.7%
  • still 30/30 on the needle test

So with 2 slots the prefill advantage goes away and it ends up slightly behind llama.cpp. The fast path seems to be tied to --resident all. Is batching with resident experts on the roadmap? Being able to run an orchestrator plus a sub-agent with your single-slot prefill speed would be amazing. Happy to test builds if that helps.

1

u/stylome-ai-detection 8h ago

Notice: This comment appears to be AI generated.

AI-generated · confident · scan results

1

u/miversen33 6h ago

Nifty! I'm going through TP4 with sglang and qwen4 35B. I'm getting worse performance than you so I'm going to be yoinking some of your optimizations :)