mike2153/mbea-qwen38-dflash

Qwen3.8-27B at 125-134 tok/s with up to 260k context on one AMD Radeon AI PRO R9700 (Windows + WSL2, vLLM radiance + DFlash). One-command install.

Shell

10

2 commits

updated Oct 11, 2026

See the code

See what people are saying

SourceMessageScoreDate

Qwen3.8-27B at ~130 tok/s with 216k–260k context on a single Radeon AI PRO R9700, on Windows (WSL2). One-command install, everything pinned. (r/LocalLLM)

Another Qwen 3.8 on a R9700 post, but I thought I'd share my repo for anyone who might benefit. I might be wrong, but I don't think I have seen anyone with it this fast on windows. I've spent the last few weeks tuning Qwen3.8-27B on one AMD Radeon AI PRO R9700 (32 GB, RDNA4), and I've packaged the…

1

Oct 8, 2026

README

mbea-qwen38-dflash

Qwen3.8-27B at 125–134 tokens/s with up to 260k context on a single AMD Radeon AI PRO R9700, running on Windows.

A tuned, reproducible vLLM serving setup for one R9700 (RDNA4, gfx1201, 32 GB) under Windows 11 + WSL2. It uses AMD's official MXFP4 checkpoint, a DFlash2 speculative drafter and the RDNA4 kernels from radiance. One command installs everything, one starts an OpenAI-compatible server.

GPU OS Engine Decode Context

Demo: start, a real-time streamed Rust answer, and the benchmark

Real output from one R9700. The code stream plays at its recorded speed (548 tokens, 170 tok/s; short answers with reasoning off decode faster than the long benchmark runs). The 166 s model load and the 5-minute benchmark are skipped. The generated code compiles and passes its own 3 tests.


Performance

Measured on one R9700 32 GB, Ryzen 9 9950X, 96 GB RAM, Windows 11 + WSL2, AMD Software PRO 26.7.1. Every number is a median of repeated runs on the shipped profile; method and raw tables in docs/BENCHMARKS.md.

Result
Decode, greedy125–134 tok/s (medians of three separate starts)
Decode, sampled (temp 0.7, top-p 0.95)117–126 tok/s
Prefill, 1.9k-token prompt2,750–2,970 tok/s, time to first token 0.66–0.70 s
Prefill, long prompts32k in 10.9 s · 98k in 41 s · 164k in 83 s · 258k in 164 s
Decode deep in context165 tok/s at 32k · 136 at 98k · 145 at 164k · 115 at 258k
Context window~216k tokens by default · ~260k with -Long (the model's 262k limit)
Draft acceptance59–63 % of drafted tokens · 5.1–5.4 tokens per verify step
Long-context recall8/8 facts retrieved from a 257,768-token prompt
Coding quality10 of 12 runs pass all 46 tests on a 1.9k-token Rust spec
Load time~2.5–3 min (the one-time kernel compile is done during install)

A clean install from this repository, then .\qwen38.ps1 bench, reproduced the setup on the same box (2026-10-08):

TestPrompt tokensPrefill tok/sTTFT sDecode tok/sDraft acceptance
Coding task, greedy (x3)1,9202,7440.70125.361.9%
Coding task, sampled (x3)1,9212,7570.70116.758.2%
Long prompt (~32k)34,7412,76212.58138.4-

For reference, the same model in a tuned llama.cpp build (IQ4_XS GGUF, MTP + n-gram speculation) decodes at 52–68 tok/s on this card. That was measured with a different prompt, so treat it as a rough comparison.

Where the speed comes from

TechniqueEffect
DFlash2 drafter (tcclaviger/Qwen3.8-27B-DFlash2-FP8) drafts 7 tokens per step~5.3 tokens accepted per forward pass of the 27B model
Draft re-ranking + dedicated verify head (RADIANCE_DRAFT_RERANK=80, RADIANCE_VERIFY_HEAD=1)+7 % decode, acceptance unchanged
MXFP4 weights through a hand-written W4A8 GEMM for gfx12014-bit weights without vLLM's emulation path
libr4d FP8 paged attention + gated-delta-net kernels (pinned b9e42ab + rx9 narrow-state patch)the stock kernel NaNs this model; this one is fast and correct
WSL pinned-memory fixhost→device copies become async (a 4-byte copy cost ~17 ms before)
Free-VRAM budgeting at startupuses all VRAM Windows isn't holding, without paging through host memory
Vision tower skipped (language_model_only)~1 GiB more KV cache

Requirements

GPUAMD Radeon AI PRO R9700 (gfx1201). Other cards are not supported: the kernels are compiled for gfx1201 only
OSWindows 11 with WSL2 (wsl --update recommended)
DriverAMD Software: PRO Edition with WSL support (tested: 26.7.1)
Disk~45 GB free for the WSL distro (19 GB model, 2 GB drafter, 14 GB image, caches)
RAM32 GB minimum, 64 GB+ recommended (tested with 96 GB)
Network~35 GB of downloads on first install

Nothing else needs to be preinstalled. The installer sets up Ubuntu 24.04, Docker and ROCDXG inside WSL. ROCDXG is AMD's bridge that lets ROCm reach the GPU from WSL. The full ROCm stack is not needed on the host because it ships inside the container.

Quick start

From PowerShell:

git clone https://github.com/mike2153/mbea-qwen38-dflash
cd mbea-qwen38-dflash
.\qwen38.ps1 install      # one-time, ~30-60 min: ~35 GB of downloads + kernel builds
.\qwen38.ps1 start        # ready on http://localhost:8080/v1

If WSL isn't installed yet, install sets it up first. Create your Linux user when Ubuntu asks, then run install again.

Running scripts blocked? Use powershell -ExecutionPolicy Bypass -File .\qwen38.ps1 install.

Commands

CommandWhat it does
.\qwen38.ps1 installOne-time setup. Safe to re-run: finished steps are skipped and downloads resume
.\qwen38.ps1 startStarts the server and waits until it's ready (~216k context)
.\qwen38.ps1 start -LongLeaves 1.0 GiB for Windows instead of 1.5 GiB. Gives ~260k context, but close browsers and other GPU apps first
.\qwen38.ps1 statusContainer state, endpoint and actual context window
.\qwen38.ps1 benchMeasures prefill, decode and draft acceptance on your box (~5 min)
.\qwen38.ps1 logsFollows the server log
.\qwen38.ps1 stopStops and removes the container. Models and caches stay

Already in WSL? scripts/qwen38.sh setup|start [--long]|stop|status|logs does the same thing as root.

Using it

It's a standard OpenAI-compatible endpoint. The model name is Qwen3.8-DFlash.

curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "Qwen3.8-DFlash",
  "messages": [{"role": "user", "content": "Write a Rust function that reverses a linked list."}]
}'
  • Reasoning is on by default and is returned in reasoning_content. Turn it off per request with "chat_template_kwargs": {"enable_thinking": false}.
  • Tool calls work out of the box (qwen3_coder parser, auto tool choice), so agents such as Codex, opencode, Cline and Continue can use it as an OpenAI-compatible provider. Use base URL http://localhost:8080/v1 and any API key.
  • Defaults: temperature 0.7, top-p 0.95, top-k 20. Requests can override them.
  • One request at a time (--max-num-seqs 1). This setup is tuned for a single fast agent, not many users at once.

Configuration

Set these in WSL before qwen38.sh, or pass them through wsl -u root -- env VAR=... bash scripts/qwen38.sh ...:

VariableDefaultMeaning
VRAM_RESERVE_GIB1.5VRAM left free for Windows. Lower means more context
VRAM_CAP0.90Most of the card vLLM may take. start -Long sets 1.0 / 0.95
PORT8080Server port
MODELS/root/modelsWhere the checkpoints live in WSL
QWEN38_DATA/root/qwen38-dflashRadiance checkout, libr4d build, compile caches
HF_TOKENunsetOnly needed if Hugging Face rate-limits you

The tuned engine settings live in config/dflash.env, and the vLLM arguments are in cmd_start in scripts/qwen38.sh.

The context window is sized from free VRAM at each start. If Windows apps hold more VRAM, the window gets smaller. That's the trade for never paging through host memory, which drops decode to around 10 tok/s.

What install does

Step
1. Host checkWSL2 GPU bridge (/dev/dxg) and free disk
2. Packagesgit, curl, python3, docker.io inside Ubuntu
3. ROCDXGrocdxg-roct 1.2.2, which lets ROCm reach the GPU through WSL
4. Imagestilldeadcode/vllm-radiance:0.9.3, pinned by digest
5. GPU checkConfirms the container sees a gfx1201 GPU before downloading anything large
6. RuntimeClones radiance at commit 7d9a15a and applies patches/radiance-wsl-r9700.patch (WSL GPU detection, pinned memory, VRAM budgeting)
7. Modelsamd/Qwen3.8-27B-Quark-AWQ-MXFP4 and the DFlash2-FP8 drafter at pinned revisions, then a one-line config fix (scripts/fix_checkpoint.py) instead of upstream's 15-minute re-quantisation
8. KernelsBuilds libr4d b9e42ab + the rx9 patch inside the image
9. First startStarts and stops the server once to fill the Triton/inductor cache. A cold start's autotuning buffers inflate vLLM's memory profile and would cut the first window to ~100k tokens

Every version is pinned (image digest, git commits, Hugging Face revisions), so a fresh install reproduces the measured setup.

Troubleshooting

SymptomFix
/dev/dxg is missingInstall or update the AMD Windows driver, then run wsl --update and wsl --shutdown
GPU check fails: no GPU visibleRun wsl --shutdown and retry. Make sure no other WSL distro or app holds the GPU exclusively
docker is installed but not runningEnable systemd: add [boot] and systemd=true to /etc/wsl.conf, then run wsl --shutdown
Container exits with Insufficient free VRAMClose GPU-heavy apps (browsers, games) or move a second monitor to the iGPU
Decode suddenly ~10 tok/sVRAM spilled into shared memory. stop, free VRAM, then start without -Long
Port 8080 already in usePORT=8090 (see Configuration)
Want the disk space back.\qwen38.ps1 stop, then in WSL rm -rf /root/qwen38-dflash /root/models/*Qwen3.8* and docker rmi stilldeadcode/vllm-radiance:0.9.3

Repository layout

qwen38.ps1                    Windows entry point (install / start / stop / status / logs / bench)
scripts/qwen38.sh             everything that runs in WSL: setup and container lifecycle
scripts/entry.sh              runs inside the container: patch chain, kernel build, launch
scripts/fix_checkpoint.py     makes AMD's checkpoint loadable without rewriting weights
config/dflash.env             the tuned engine profile
patches/radiance-wsl-r9700.patch   local changes on top of the pinned radiance commit
bench/                        stdlib benchmark + the coding prompt used for the published numbers
docs/BENCHMARKS.md            full measurements and method

Credits

This repository is packaging and tuning. The hard parts are other people's work:

Nothing third-party is redistributed here. The installer fetches each component from its source under that component's own license. The scripts and patch in this repository are MIT (LICENSE).

Status: experimental, community-maintained, not affiliated with AMD, Qwen or the radiance authors. Tested on one machine. Reports from other R9700 owners are welcome as issues.

mike2153/mbea-qwen38-dflash

Qwen3.8-27B at 125-134 tok/s with up to 260k context on one AMD Radeon AI PRO R9700 (Windows + WSL2, vLLM radiance + DFlash). One-command install.

Shell

10

2 commits

updated Oct 11, 2026

See the code

See what people are saying

SourceMessageScoreDate

Qwen3.8-27B at ~130 tok/s with 216k–260k context on a single Radeon AI PRO R9700, on Windows (WSL2). One-command install, everything pinned. (r/LocalLLM)

Another Qwen 3.8 on a R9700 post, but I thought I'd share my repo for anyone who might benefit. I might be wrong, but I don't think I have seen anyone with it this fast on windows. I've spent the last few weeks tuning Qwen3.8-27B on one AMD Radeon AI PRO R9700 (32 GB, RDNA4), and I've packaged the…

1

Oct 8, 2026

README

mbea-qwen38-dflash

Qwen3.8-27B at 125–134 tokens/s with up to 260k context on a single AMD Radeon AI PRO R9700, running on Windows.

A tuned, reproducible vLLM serving setup for one R9700 (RDNA4, gfx1201, 32 GB) under Windows 11 + WSL2. It uses AMD's official MXFP4 checkpoint, a DFlash2 speculative drafter and the RDNA4 kernels from radiance. One command installs everything, one starts an OpenAI-compatible server.

GPU OS Engine Decode Context

Demo: start, a real-time streamed Rust answer, and the benchmark

Real output from one R9700. The code stream plays at its recorded speed (548 tokens, 170 tok/s; short answers with reasoning off decode faster than the long benchmark runs). The 166 s model load and the 5-minute benchmark are skipped. The generated code compiles and passes its own 3 tests.


Performance

Measured on one R9700 32 GB, Ryzen 9 9950X, 96 GB RAM, Windows 11 + WSL2, AMD Software PRO 26.7.1. Every number is a median of repeated runs on the shipped profile; method and raw tables in docs/BENCHMARKS.md.

Result
Decode, greedy125–134 tok/s (medians of three separate starts)
Decode, sampled (temp 0.7, top-p 0.95)117–126 tok/s
Prefill, 1.9k-token prompt2,750–2,970 tok/s, time to first token 0.66–0.70 s
Prefill, long prompts32k in 10.9 s · 98k in 41 s · 164k in 83 s · 258k in 164 s
Decode deep in context165 tok/s at 32k · 136 at 98k · 145 at 164k · 115 at 258k
Context window~216k tokens by default · ~260k with -Long (the model's 262k limit)
Draft acceptance59–63 % of drafted tokens · 5.1–5.4 tokens per verify step
Long-context recall8/8 facts retrieved from a 257,768-token prompt
Coding quality10 of 12 runs pass all 46 tests on a 1.9k-token Rust spec
Load time~2.5–3 min (the one-time kernel compile is done during install)

A clean install from this repository, then .\qwen38.ps1 bench, reproduced the setup on the same box (2026-10-08):

TestPrompt tokensPrefill tok/sTTFT sDecode tok/sDraft acceptance
Coding task, greedy (x3)1,9202,7440.70125.361.9%
Coding task, sampled (x3)1,9212,7570.70116.758.2%
Long prompt (~32k)34,7412,76212.58138.4-

For reference, the same model in a tuned llama.cpp build (IQ4_XS GGUF, MTP + n-gram speculation) decodes at 52–68 tok/s on this card. That was measured with a different prompt, so treat it as a rough comparison.

Where the speed comes from

TechniqueEffect
DFlash2 drafter (tcclaviger/Qwen3.8-27B-DFlash2-FP8) drafts 7 tokens per step~5.3 tokens accepted per forward pass of the 27B model
Draft re-ranking + dedicated verify head (RADIANCE_DRAFT_RERANK=80, RADIANCE_VERIFY_HEAD=1)+7 % decode, acceptance unchanged
MXFP4 weights through a hand-written W4A8 GEMM for gfx12014-bit weights without vLLM's emulation path
libr4d FP8 paged attention + gated-delta-net kernels (pinned b9e42ab + rx9 narrow-state patch)the stock kernel NaNs this model; this one is fast and correct
WSL pinned-memory fixhost→device copies become async (a 4-byte copy cost ~17 ms before)
Free-VRAM budgeting at startupuses all VRAM Windows isn't holding, without paging through host memory
Vision tower skipped (language_model_only)~1 GiB more KV cache

Requirements

GPUAMD Radeon AI PRO R9700 (gfx1201). Other cards are not supported: the kernels are compiled for gfx1201 only
OSWindows 11 with WSL2 (wsl --update recommended)
DriverAMD Software: PRO Edition with WSL support (tested: 26.7.1)
Disk~45 GB free for the WSL distro (19 GB model, 2 GB drafter, 14 GB image, caches)
RAM32 GB minimum, 64 GB+ recommended (tested with 96 GB)
Network~35 GB of downloads on first install

Nothing else needs to be preinstalled. The installer sets up Ubuntu 24.04, Docker and ROCDXG inside WSL. ROCDXG is AMD's bridge that lets ROCm reach the GPU from WSL. The full ROCm stack is not needed on the host because it ships inside the container.

Quick start

From PowerShell:

git clone https://github.com/mike2153/mbea-qwen38-dflash
cd mbea-qwen38-dflash
.\qwen38.ps1 install      # one-time, ~30-60 min: ~35 GB of downloads + kernel builds
.\qwen38.ps1 start        # ready on http://localhost:8080/v1

If WSL isn't installed yet, install sets it up first. Create your Linux user when Ubuntu asks, then run install again.

Running scripts blocked? Use powershell -ExecutionPolicy Bypass -File .\qwen38.ps1 install.

Commands

CommandWhat it does
.\qwen38.ps1 installOne-time setup. Safe to re-run: finished steps are skipped and downloads resume
.\qwen38.ps1 startStarts the server and waits until it's ready (~216k context)
.\qwen38.ps1 start -LongLeaves 1.0 GiB for Windows instead of 1.5 GiB. Gives ~260k context, but close browsers and other GPU apps first
.\qwen38.ps1 statusContainer state, endpoint and actual context window
.\qwen38.ps1 benchMeasures prefill, decode and draft acceptance on your box (~5 min)
.\qwen38.ps1 logsFollows the server log
.\qwen38.ps1 stopStops and removes the container. Models and caches stay

Already in WSL? scripts/qwen38.sh setup|start [--long]|stop|status|logs does the same thing as root.

Using it

It's a standard OpenAI-compatible endpoint. The model name is Qwen3.8-DFlash.

curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
  "model": "Qwen3.8-DFlash",
  "messages": [{"role": "user", "content": "Write a Rust function that reverses a linked list."}]
}'
  • Reasoning is on by default and is returned in reasoning_content. Turn it off per request with "chat_template_kwargs": {"enable_thinking": false}.
  • Tool calls work out of the box (qwen3_coder parser, auto tool choice), so agents such as Codex, opencode, Cline and Continue can use it as an OpenAI-compatible provider. Use base URL http://localhost:8080/v1 and any API key.
  • Defaults: temperature 0.7, top-p 0.95, top-k 20. Requests can override them.
  • One request at a time (--max-num-seqs 1). This setup is tuned for a single fast agent, not many users at once.

Configuration

Set these in WSL before qwen38.sh, or pass them through wsl -u root -- env VAR=... bash scripts/qwen38.sh ...:

VariableDefaultMeaning
VRAM_RESERVE_GIB1.5VRAM left free for Windows. Lower means more context
VRAM_CAP0.90Most of the card vLLM may take. start -Long sets 1.0 / 0.95
PORT8080Server port
MODELS/root/modelsWhere the checkpoints live in WSL
QWEN38_DATA/root/qwen38-dflashRadiance checkout, libr4d build, compile caches
HF_TOKENunsetOnly needed if Hugging Face rate-limits you

The tuned engine settings live in config/dflash.env, and the vLLM arguments are in cmd_start in scripts/qwen38.sh.

The context window is sized from free VRAM at each start. If Windows apps hold more VRAM, the window gets smaller. That's the trade for never paging through host memory, which drops decode to around 10 tok/s.

What install does

Step
1. Host checkWSL2 GPU bridge (/dev/dxg) and free disk
2. Packagesgit, curl, python3, docker.io inside Ubuntu
3. ROCDXGrocdxg-roct 1.2.2, which lets ROCm reach the GPU through WSL
4. Imagestilldeadcode/vllm-radiance:0.9.3, pinned by digest
5. GPU checkConfirms the container sees a gfx1201 GPU before downloading anything large
6. RuntimeClones radiance at commit 7d9a15a and applies patches/radiance-wsl-r9700.patch (WSL GPU detection, pinned memory, VRAM budgeting)
7. Modelsamd/Qwen3.8-27B-Quark-AWQ-MXFP4 and the DFlash2-FP8 drafter at pinned revisions, then a one-line config fix (scripts/fix_checkpoint.py) instead of upstream's 15-minute re-quantisation
8. KernelsBuilds libr4d b9e42ab + the rx9 patch inside the image
9. First startStarts and stops the server once to fill the Triton/inductor cache. A cold start's autotuning buffers inflate vLLM's memory profile and would cut the first window to ~100k tokens

Every version is pinned (image digest, git commits, Hugging Face revisions), so a fresh install reproduces the measured setup.

Troubleshooting

SymptomFix
/dev/dxg is missingInstall or update the AMD Windows driver, then run wsl --update and wsl --shutdown
GPU check fails: no GPU visibleRun wsl --shutdown and retry. Make sure no other WSL distro or app holds the GPU exclusively
docker is installed but not runningEnable systemd: add [boot] and systemd=true to /etc/wsl.conf, then run wsl --shutdown
Container exits with Insufficient free VRAMClose GPU-heavy apps (browsers, games) or move a second monitor to the iGPU
Decode suddenly ~10 tok/sVRAM spilled into shared memory. stop, free VRAM, then start without -Long
Port 8080 already in usePORT=8090 (see Configuration)
Want the disk space back.\qwen38.ps1 stop, then in WSL rm -rf /root/qwen38-dflash /root/models/*Qwen3.8* and docker rmi stilldeadcode/vllm-radiance:0.9.3

Repository layout

qwen38.ps1                    Windows entry point (install / start / stop / status / logs / bench)
scripts/qwen38.sh             everything that runs in WSL: setup and container lifecycle
scripts/entry.sh              runs inside the container: patch chain, kernel build, launch
scripts/fix_checkpoint.py     makes AMD's checkpoint loadable without rewriting weights
config/dflash.env             the tuned engine profile
patches/radiance-wsl-r9700.patch   local changes on top of the pinned radiance commit
bench/                        stdlib benchmark + the coding prompt used for the published numbers
docs/BENCHMARKS.md            full measurements and method

Credits

This repository is packaging and tuning. The hard parts are other people's work:

Nothing third-party is redistributed here. The installer fetches each component from its source under that component's own license. The scripts and patch in this repository are MIT (LICENSE).

Status: experimental, community-maintained, not affiliated with AMD, Qwen or the radiance authors. Tested on one machine. Reports from other R9700 owners are welcome as issues.