Qwen3-4B (Q4_K_M) for AMD Loom
A Loom package (.loom programs and a model.json card) for the unmodified GGUF checkpoint ggml-org/Qwen3-4B-GGUF (Qwen3-4B-Q4_K_M.gguf), for the AMD Ryzen AI Max+ 395 "Strix Halo", AMD Radeon AI PRO R9700 and AMD Radeon gfx1201 16 GB class (RX 9070 XT, RX 9070) GPUs, generated with the loom-skills workflow. Learn more on the Loom ecosystem website.
Quick start
Open your GPU and copy its commands.
AMD Ryzen AI Max+ 395 "Strix Halo" (gfx1151)pipx install "hrx-loom[hf]==0.2.0"
loom-fetch huggingface:loom-fun/ggml-org-Qwen3-4B-loom:chat --materialize=copy --output=Qwen3-4B
loom-serve --model=Qwen3-4B '--device=amdgpu://?completion_spin_ns=4294967295' --pool_backing=fixed --parameter_mode=preload
--materialize=copyputs copies of the fetched package files in the output directory.completion_spin_ns=4294967295enables active waiting for GPU completions (uses CPU while GPU work is in flight); the card's performance measurements use this setting.--pool_backing=fixedcommits the preset's memory pool up front instead of growing elastic backing.--parameter_mode=preloadonly changes how the weights are loaded on the host, so the performance rows were measured without it unless their job served with it.
pipx install "hrx-loom[hf]==0.2.0"
loom-fetch huggingface:loom-fun/ggml-org-Qwen3-4B-loom:chat --materialize=copy --output=Qwen3-4B
loom-serve --model=Qwen3-4B '--device=amdgpu://?completion_spin_ns=4294967295' --pool_backing=fixed --parameter_mode=preload
--materialize=copyputs copies of the fetched package files in the output directory.completion_spin_ns=4294967295enables active waiting for GPU completions (uses CPU while GPU work is in flight); the card's performance measurements use this setting.--pool_backing=fixedcommits the preset's memory pool up front instead of growing elastic backing.--parameter_mode=preloadonly changes how the weights are loaded on the host, so the performance rows were measured without it unless their job served with it.
pipx install "hrx-loom[hf]==0.2.0"
loom-fetch huggingface:loom-fun/ggml-org-Qwen3-4B-loom:chat-16gb --materialize=copy --output=Qwen3-4B
loom-serve --model=Qwen3-4B '--device=amdgpu://?completion_spin_ns=4294967295' --memory_bytes=15000000000 --state_slab_bytes=4mib --weight_slab_bytes=64mib --parameter_mode=preload
--materialize=copyputs copies of the fetched package files in the output directory.completion_spin_ns=4294967295enables active waiting for GPU completions (uses CPU while GPU work is in flight); the card's performance measurements use this setting.--memory_bytessets the serving memory budget for this GPU.--state_slab_bytessets the allocation slab size for state memory.--weight_slab_bytessets the allocation slab size for weight memory.--parameter_mode=preloadonly changes how the weights are loaded on the host, so the performance rows were measured without it unless their job served with it.
Send a request
In another terminal (optional thinking is turned off):
curl http://127.0.0.1:8080/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"model": "Qwen/Qwen3-4B", "messages": [{"role": "user", "content": "Hello"}], "chat_template_kwargs": {"enable_thinking": false}}'
Performance vs llama.cpp
Strix Halo (gfx1151)
| metric | llama.cpp | Loom | margin vs best llama.cpp | roofline | Loom % of roofline | llama.cpp Vulkan |
|---|---|---|---|---|---|---|
| decode tok/s, short prompt | 74.1 | 100.5 | +36 % | 167.3 | 60 % | 42.4 |
| decode tok/s, 2k context | 69.2 | 80.8 | +17 % | 157.8 | 51 % | 41.1 |
| decode tok/s, 32k context | 35.3 | 28.6 | -19 % | 30.0 | 95 % | 15.7 |
| prefill tok/s, 1k document | 2160.7 | 2932.3 | +36 % | 7802.6 | 38 % | 1780.7 |
| prefill tok/s, 2k document | 2143.2 | 3009.9 | +40 % | 7509.7 | 40 % | 1649.6 |
| prefill tok/s, 8k document | 1704.9 | 2397.3 | +41 % | 6129.3 | 39 % | 1226.2 |
| prefill tok/s, 16k document | 1296.9 | 1796.1 | +38 % | 4922.7 | 36 % | 892.5 |
| prefill tok/s, 32k document | 868.0 | 1262.6 | +45 % | 3532.1 | 36 % | 602.5 |
| 4 streams, aggregate decode tok/s | 211.8 | 262.4 | +20 % | 303.7 | 86 % | 219.3 |
| speculative decoding, drafted tokens accepted | — | 35 % | — | n/a | n/a | n/a |
Methodology
- Compared: Loom against llama.cpp ROCm
llamacpp-rocm/b1374, llama.cpp Vulkanllamacpp-vulkan/b12211; the same GGUF, the same DevLab runner type, different jobs, the same prompts; Loom served with the active wait. Values are the median of 6 sessions (a session's value is the median of its samples: 3 samples for decode_2k, decode_32k, prefill_8k; one sample for the others) (4 streams: median of 12); Loom is timed by the client, llama.cpp by its server. - llama.cpp measured on 2026-11-13 (DevLab Dispatch run 43376548212), Loom on 2026-11-17 (DevLab Dispatch run 44088677167): same runner type, different jobs (llama.cpp was not re-measured for this package).
- Out of the box on both engines: Loom serves the preset shipped in this package; llama.cpp runs its build defaults plus only the server arguments listed below (offload, context and slots, and on the 1-stream rows the drafting flags that match Loom's drafting). No tuning sweep on either engine.
- Drafting, 1-stream rows (decode, decode_2k, decode_32k, prefill): DFlash (AtomicChat/Qwen3-4B-DFlash-GGUF / Qwen3-4B-DFlash.Q8_0.gguf) on both engines; draft depth: Loom 3, llama.cpp --spec-draft-n-max 15 (each engine its own). Each engine is loaded once for all these rows.
- 4 streams: both engines loaded with drafting off, 4 parallel requests, aggregate tokens per second.
- Rows: decode = short-context decode; decode_2k / decode_32k = decode after a ~2k / ~32k-token context; prefill_Nk = prompt processing of an N k-token prompt; streams4 = 4-stream aggregate decode. A margin within +-3 % (the measured same-runner noise) is a tie.
- llama.cpp ROCm server arguments:
1-stream rows: -ngl 99 -cram 0 --spec-type draft-dflash --spec-draft-model card:parameter/Qwen3-4B-DFlash.Q8_0.gguf --spec-draft-n-max 15 -ngld 99 -c 65536 -np 1; 4 streams: -ngl 99 -cram 0 -c 65536 -kvu -np 4. - llama.cpp Vulkan server arguments:
1-stream rows: -ngl 99 -cram 0 --spec-type draft-dflash --spec-draft-model card:parameter/Qwen3-4B-DFlash.Q8_0.gguf --spec-draft-n-max 15 -ngld 99 -c 36864 -np 1; 4 streams: -ngl 99 -cram 0 -c 147456 -np 4. - Measured on AMD DevLab Dispatch Strix Halo runners (
devlab-perfjobs); runners differ between sessions. - Margin vs best llama.cpp: (Loom / max(ROCm, Vulkan) - 1) × 100 %, using the available measured tokens/s for each row on this GPU. With only one valid backend, that backend is used; with neither, the margin is not measured. Raw backend values and their measurement sources are retained below and in the table.
- Measured 2026-11-17; device AMD Strix Halo (DevLab Dispatch runner X2-LA03-S03-D07), Linux; hrx-loom
0.2.0(hrx-system0cd370f, recovered); source: DevLab Dispatch run 44088677167. - llama.cpp Vulkan: measured 2026-11-13; source: DevLab Dispatch run 43376548212. Archive sha256
9759acd. - Drafted tokens accepted: the share of the drafter's proposed tokens the model accepted during the
specgate's requests. - Roofline: the hardware ceiling for this GGUF on AMD Ryzen AI Max+ 395 "Strix Halo" (gfx1151) at 216 GB/s and 59 TFLOP/s, from loom-roofline
roofline.py(loom-skills6d3ca93); decode rows with speculative decoding: verify passes × (1 + acceptance × depth 3) tokens per pass, the drafter's cost not counted, with the acceptance measured in the row's own session: decode 31 %, decode at 2k 34 %; single-pass ceiling (no acceptance measured on this package) for decode at 32k; 4 streams run without drafting, so its ceiling is single-pass. - — not measured; n/a not applicable.
Radeon AI PRO R9700 (gfx1201, 32 GB)
| metric | llama.cpp | Loom | margin vs best llama.cpp | roofline | Loom % of roofline | llama.cpp Vulkan |
|---|---|---|---|---|---|---|
| decode tok/s, short prompt | 129.8 | 229.8 | +77 % | 471.9 | 49 % | 110.8 |
| decode tok/s, 2k context | 125.7 | 171.5 | +36 % | 452.3 | 38 % | 105.3 |
| decode tok/s, 32k context | 73.9 | 71.2 | -4 % | 85.0 | 84 % | 56.7 |
| prefill tok/s, 1k document | 6366.5 | 8636.6 | +36 % | 28301.1 | 31 % | 4728.3 |
| prefill tok/s, 2k document | 6345.0 | 9144.5 | +44 % | 27238.7 | 34 % | 4842.1 |
| prefill tok/s, 8k document | 5222.4 | 7879.2 | +51 % | 22231.6 | 35 % | 3993.1 |
| prefill tok/s, 16k document | 4074.4 | 6210.9 | +52 % | 17855.3 | 35 % | 3120.3 |
| prefill tok/s, 32k document | 2826.5 | 3877.1 | +37 % | 12811.4 | 30 % | 2153.0 |
| 4 streams, aggregate decode tok/s | 390.3 | 608.5 | +19 % | 861.8 | 71 % | 512.1 |
| speculative decoding, drafted tokens accepted | — | 34 % | — | n/a | n/a | n/a |
Methodology
- Compared: Loom against llama.cpp ROCm
llamacpp-rocm/b1375, llama.cpp Vulkanllamacpp-vulkan/b12211; the same GGUF, the same DevLab runner type, different jobs, the same prompts; Loom served with the active wait. Values are the median of 6 sessions (a session's value is the median of its samples: 3 samples for decode_2k, decode_32k, prefill_8k; one sample for the others) (4 streams: median of 12); Loom is timed by the client, llama.cpp by its server. - llama.cpp measured on 2026-11-15 (DevLab Dispatch run 43661796072), Loom on 2026-11-17 (DevLab Dispatch run 43993232852): same runner type, different jobs (llama.cpp was not re-measured for this package).
- Out of the box on both engines: Loom serves the preset shipped in this package; llama.cpp runs its build defaults plus only the server arguments listed below (offload, context and slots, and on the 1-stream rows the drafting flags that match Loom's drafting). No tuning sweep on either engine.
- Drafting, 1-stream rows (decode, decode_2k, decode_32k, prefill): DFlash (AtomicChat/Qwen3-4B-DFlash-GGUF / Qwen3-4B-DFlash.Q8_0.gguf) on both engines; draft depth: Loom 3, llama.cpp --spec-draft-n-max 15 (each engine its own). Each engine is loaded once for all these rows.
- 4 streams: both engines loaded with drafting off, 4 parallel requests, aggregate tokens per second.
- Rows: decode = short-context decode; decode_2k / decode_32k = decode after a ~2k / ~32k-token context; prefill_Nk = prompt processing of an N k-token prompt; streams4 = 4-stream aggregate decode. A margin within +-3 % (the measured same-runner noise) is a tie.
- llama.cpp ROCm server arguments:
-ngl 99 -cram 0 --spec-type draft-dflash --spec-draft-model card:parameter/Qwen3-4B-DFlash.Q8_0.gguf --spec-draft-n-max 15 -ngld 99 -c 65536 -np 1. - llama.cpp Vulkan server arguments:
-ngl 99 -cram 0 --spec-type draft-dflash --spec-draft-model card:parameter/Qwen3-4B-DFlash.Q8_0.gguf --spec-draft-n-max 15 -ngld 99 -c 36864 -np 1. - Measured on AMD DevLab Dispatch R9700 runners (
devlab-perfjobs); runners differ between sessions. - Margin vs best llama.cpp: (Loom / max(ROCm, Vulkan) - 1) × 100 %, using the available measured tokens/s for each row on this GPU. With only one valid backend, that backend is used; with neither, the margin is not measured. Raw backend values and their measurement sources are retained below and in the table.
- Measured 2026-11-17; device DevLab Dispatch runner ephemeral-devlab-sm-01-02-r9700s-6-133738799762, AMD Radeon AI PRO R9700S (gfx1201), Linux; hrx-loom
0.2.0(hrx-system commit unknown, recovered); source: DevLab Dispatch run 43993232852. - llama.cpp Vulkan: measured 2026-11-15; source: DevLab Dispatch run 43661796072. Archive sha256
9759acd. - Drafted tokens accepted: the share of the drafter's proposed tokens the model accepted during the
specgate's requests. - Roofline: the hardware ceiling for this GGUF on AMD Radeon AI PRO R9700S (gfx1201, 32 GB, 2.35 GHz) at 613 GB/s and 214 TFLOP/s, from loom-roofline
roofline.py(loom-skills203cf33); decode rows with speculative decoding: verify passes × (1 + acceptance × depth 3) tokens per pass, the drafter's cost not counted, with the acceptance measured in the row's own session: decode 31 %, decode at 2k 35 %; single-pass ceiling (no acceptance measured on this package) for decode at 32k; 4 streams run without drafting, so its ceiling is single-pass. - — not measured; n/a not applicable.
Radeon RX 9070 XT
| metric | llama.cpp | Loom | margin vs best llama.cpp | roofline | Loom % of roofline | llama.cpp Vulkan |
|---|---|---|---|---|---|---|
| decode tok/s, short prompt | 128.2 | 233.8 | +82 % | 492.7 | 47 % | 120.3 |
| decode tok/s, 2k context | 123.2 | 171.4 | +39 % | 471.6 | 36 % | 110.5 |
| decode tok/s, 32k context | 74.2 | 69.8 | -6 % | 88.8 | 79 % | 62.6 |
| prefill tok/s, 1k document | 6489.4 | 8367.1 | +29 % | 25735.5 | 33 % | 5891.8 |
| prefill tok/s, 2k document | 6497.1 | 8852.0 | +36 % | 24769.4 | 36 % | 6047.2 |
| prefill tok/s, 8k document | 5242.6 | 7459.4 | +42 % | 20216.2 | 37 % | 4993.4 |
| prefill tok/s, 16k document | 4032.8 | 6036.5 | +50 % | 16236.7 | 37 % | 3893.1 |
| prefill tok/s, 32k document | 2806.6 | 3424.2 | +22 % | 11650.0 | 29 % | 2672.5 |
| 4 streams, aggregate decode tok/s | 397.4 | 624.0 | +53 % | 899.8 | 69 % | 408.5 |
| speculative decoding, drafted tokens accepted | — | 34 % | — | n/a | n/a | n/a |
Methodology
- Compared: Loom against llama.cpp ROCm
llamacpp-rocm/b1375, llama.cpp Vulkanllamacpp-vulkan/b12211; the same GGUF, the same machine and session, the same prompts; Loom served with the active wait. Values are the median of 6 sessions (a session's value is the median of its samples: 3 samples for decode_2k, decode_32k, prefill_8k; one sample for the others) (4 streams: median of 3); Loom is timed by the client, llama.cpp by its server. - Out of the box on both engines: Loom serves the preset shipped in this package; llama.cpp runs its build defaults plus only the server arguments listed below (offload, context and slots, and on the 1-stream rows the drafting flags that match Loom's drafting). No tuning sweep on either engine.
- Drafting, 1-stream rows (decode, decode_2k, decode_32k, prefill): DFlash (AtomicChat/Qwen3-4B-DFlash-GGUF / Qwen3-4B-DFlash.Q8_0.gguf) on both engines; draft depth: Loom 3, llama.cpp --spec-draft-n-max 15 (each engine its own). Each engine is loaded once for all these rows.
- 4 streams: both engines loaded with drafting off, 4 parallel requests, aggregate tokens per second.
- Rows: decode = short-context decode; decode_2k / decode_32k = decode after a ~2k / ~32k-token context; prefill_Nk = prompt processing of an N k-token prompt; streams4 = 4-stream aggregate decode. A margin within +-3 % (the measured same-runner noise) is a tie.
- llama.cpp ROCm server arguments:
-ngl 99 -cram 0 --spec-type draft-dflash --spec-draft-model card:parameter/Qwen3-4B-DFlash.Q8_0.gguf --spec-draft-n-max 15 -ngld 99 -c 65536 -np 1. - llama.cpp Vulkan server arguments:
-ngl 99 -cram 0 --spec-type draft-dflash --spec-draft-model card:parameter/Qwen3-4B-DFlash.Q8_0.gguf --spec-draft-n-max 15 -ngld 99 -c 36864 -np 1. - Measured on AMD Ryzen 7 9800X3D 8-Core Processor, AMD Radeon RX 9070 XT, Ubuntu 26.04, a named machine (this GPU has no DevLab runner); both engines ran on it.
- Margin vs best llama.cpp: (Loom / max(ROCm, Vulkan) - 1) × 100 %, using the available measured tokens/s for each row on this GPU. With only one valid backend, that backend is used; with neither, the margin is not measured. Raw backend values and their measurement sources are retained below and in the table.
- Measured 2026-11-17; device AMD Ryzen 7 9800X3D 8-Core Processor, AMD Radeon RX 9070 XT, Ubuntu 26.04; hrx-loom
0.2.0(hrx-system0cd370f); source: named-machine run. - llama.cpp Vulkan: measured 2026-11-17; source: named-machine run. Archive sha256
9759acd. - Drafted tokens accepted: the share of the drafter's proposed tokens the model accepted during the
specgate's requests. - Roofline: the hardware ceiling for this GGUF on AMD Radeon RX 9070 XT (gfx1201, 16 GB) at 640 GB/s and 195 TFLOP/s, from loom-roofline
roofline.py(loom-skills963ead9); decode rows with speculative decoding: verify passes × (1 + acceptance × depth 3) tokens per pass, the drafter's cost not counted, with the acceptance measured in the row's own session: decode 31 %, decode at 2k 35 %; single-pass ceiling (no acceptance measured on this package) for decode at 32k; 4 streams run without drafting, so its ceiling is single-pass. - — not measured; n/a not applicable.
Features
| feature | status | detail |
|---|---|---|
| API | ✅ | OpenAI-style /v1/chat/completions |
| tool calling | ✅ | OpenAI-style tools and tool_calls |
| reasoning / thinking | ✅ | on by default; chat_template_kwargs: {"enable_thinking": false} turns it off |
| reasoning effort | — | not applicable |
| speculative decoding | ✅ | DFlash, depth 3, on by default; drafter AtomicChat/Qwen3-4B-DFlash-GGUF |
| image input | — | not applicable |
| audio input / output | — | not applicable |
| sampling | ✅ | temperature, top_p, top_k, seed |
| context size | ✅ | 40,960 tokens per request |
| concurrency | ✅ | 4 concurrent requests |
| max output tokens | ✅ | 4,096 (preset max_tokens) |
Correctness
| gate | description | Strix Halo | Radeon AI PRO R9700 | Radeon RX 9070 XT |
|---|---|---|---|---|
kernel_tests |
Unit tests of the generated kernels against reference implementations | ✅ pass (66/66) ¹ | ✅ pass (66/66) ² | ✅ pass (66/66) ⁶ |
golden |
llama.cpp reference recorded on the same GGUF: greedy tokens and top-5 log-probs, short prompts and 1k-32k documents | ✅ pass ³ | ✅ pass ⁴ | ✅ pass ⁵ |
compare |
Greedy output vs the llama.cpp reference, token by token; every divergence is a near-tie | ✅ pass ³ | ✅ pass ⁴ | ✅ pass ⁵ |
vision |
Image input vs llama.cpp with the same projector: identical prompt tokens, replies equal up to near-ties | — not applicable | — not applicable | — not applicable |
consistency |
Concurrent requests give the same output as the same requests run alone | ✅ pass ³ | ✅ pass ⁴ | ✅ pass ⁵ |
spec |
Speculative decoding on gives exactly the output of speculative decoding off | ✅ pass ³ | ✅ pass ⁴ | ✅ pass ⁵ |
agent |
Multi-turn tool-calling loop: exact prompt rendering, history reuse, valid tool calls, output vs llama.cpp | ✅ pass ³ | ✅ pass ⁴ | ✅ pass ⁵ |
agent_think_off |
The tool-calling loop with thinking off | ✅ pass ³ | ✅ pass ⁴ | ✅ pass ⁵ |
sampling |
temperature, top_k and seed behave as specified; first-token distribution matches llama.cpp | ✅ pass ³ | ✅ pass ⁴ | ✅ pass ⁵ |
logits |
Host logits readback (llm.logits on): at T=0 every returned row's argmax is the device's token, the top-k matches llama.cpp, greedy text is unchanged | ? not re-run on this package (the last pass was on a previous build, sha256 1dbe275; the nightly gates re-run it) |
? not re-run on this package (the last pass was on a previous build, sha256 1dbe275; the nightly gates re-run it) |
❌ no evidence |
decision |
Decision answers (choice, score, noul probabilities) vs llama.cpp on the same prompts | — not applicable | — not applicable | — not applicable |
- ¹ DevLab Dispatch run 44088677167, 2026-11-17; device AMD Strix Halo (DevLab Dispatch runner X2-LA03-S03-D07), Linux; hrx-loom
0.2.0(hrx-system0cd370f, recovered). - ² DevLab Dispatch run 43993232852, 2026-11-17; device DevLab Dispatch runner ephemeral-devlab-sm-01-02-r9700s-6-133738799762, AMD Radeon AI PRO R9700S (gfx1201), Linux; hrx-loom
0.2.0(hrx-system commit unknown, recovered). - ³ DevLab Dispatch run 44088677167, LEVEL=dev, 2026-11-17; device AMD Strix Halo (DevLab Dispatch runner X2-LA03-S03-D07), Linux; hrx-loom
0.2.0(hrx-system0cd370f, recovered). - ⁴ DevLab Dispatch run 43993232852, LEVEL=dev, 2026-11-17; device DevLab Dispatch runner ephemeral-devlab-sm-01-02-r9700s-6-133738799762, AMD Radeon AI PRO R9700S (gfx1201), Linux; hrx-loom
0.2.0(hrx-system commit unknown, recovered). - ⁵ named-machine run, LEVEL=dev, 2026-11-17; device AMD Ryzen 7 9800X3D 8-Core Processor, AMD Radeon RX 9070 XT, Ubuntu 26.04; hrx-loom
0.2.0(hrx-system0cd370f). - ⁶ named-machine run, 2026-11-17; device AMD Ryzen 7 9800X3D 8-Core Processor, AMD Radeon RX 9070 XT, Ubuntu 26.04; hrx-loom
0.2.0(hrx-system0cd370f). - Gates are the loom-benchmark correctness gates (
gates.sh); a gate without a recorded run shows no evidence.
Files
model.json/model.json.lock: the card and the pinned source files (sha256 checked byloom-fetch).program/*.loom,weights.loom: the generated Loom programs.tokenizer.json: the tokenizer.llm_config.json: the configuration the programs were generated from.info.json: the measurements, gate evidence and versions this card shows; everything else comes from the files above.REPORT.md: how the values above were measured: setup, commands and the value of every run.
Versions: card schema loom-card/3; loom-skills unknown; hrx-loom unknown; card generator b931191.
Source files, fetched by loom-fetch from their own repositories:
- checkpoint: ggml-org/Qwen3-4B-GGUF @
2f3b082,Qwen3-4B-Q4_K_M.gguf - drafter: AtomicChat/Qwen3-4B-DFlash-GGUF @
700be51,Qwen3-4B-DFlash.Q8_0.gguf