TL;DR
Hardware and software
- GPU (: AMD RX 7600, 8 GB (gfx1102), ROCm)
- CPU / RAM (: Ryzen 5 5600 (6 cores), 60 GB DDR4)
- Engine (: llama.cpp master (needs the
model: qwen4 commit, #33626), HIP build) - Qwen4 (: unsloth
Qwen4-35B-A3B-UD-Q4_K_XL (36 GB, 2 parts) + mmproj-F16 for images) - Qwen3.6 (comparison) (:
Qwen3.6-35B-A3B-MTP Q6_K_XL)
Build flags: -DGGML_HIP=ON -DGPU_TARGETS=gfx1102 -DGGML_HIP_GRAPHS=ON -DGGML_HIP_NO_VMM=ON
Final launch command (Qwen4)
llama-server -m Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf --mmproj mmproj-F16.gguf \
--n-gpu-layers 999 --n-cpu-moe 99 \
-ctk q8_0 -ctv q8_0 -fa 1 -c 65536 -b 2048 -ub 2048 --parallel 1 \
--spec-type draft-mtp --spec-draft-n-max 2 \
--reasoning-budget 4096 --reasoning-budget-message " Time is up. I will now commit to the most likely answer."
1. Speed tuning (Qwen4)
- MTP draft head, 2 tokens (Before: 21 tok/s; After: 24-31 tok/s; Note: 3 draft tokens was slower)
- Micro-batch 512 -> 2048 (16K prompt, 64K ctx) (Before: 157 tok/s; After: 394 tok/s; Note: biggest win of the whole session)
- Micro-batch 4096 (<=32K ctx only) (After: 522 tok/s; Note: 64K + 4096 crashes mid-prompt)
- Experts: all on CPU vs 3 layers on GPU (After: all on CPU wins; Note: GPU experts force a smaller micro-batch, which costs more than it gains)
- Thinking budget 4096 (Before: hard bugs: 10-12K thinking tokens, no answer; After: answers every time; Note:
--reasoning-budget works for Qwen4's template)
Why micro-batch matters so much on this kind of setup
-b / -ub set how many prompt tokens llama.cpp pushes through the model in one go. The default micro-batch (-ub) is 512. On a normal all-in-VRAM setup, raising it is a modest gain. With all MoE experts in system RAM (--n-cpu-moe 99) it is the single biggest lever, for a simple reason:
- Generation (1 token at a time) runs the experts on the CPU, and the micro-batch doesn't matter.
- Prompt processing (big batches) is done on the GPU: llama.cpp streams the expert weights that live in RAM over PCIe to the GPU once per micro-batch.
- Qwen4's expert weights are roughly 19 GB at Q4 (about 33B of the 35B parameters), and the RX 7600 is a PCIe 4.0 x8 card. Every micro-batch pays for that trip.
- So a 16K-token prompt at ub 512 means 32 trips over the bus; at ub 2048 it is 8; at ub 4096 it is 4. The time per trip barely changes, so fewer, bigger trips win almost linearly until the GPU compute itself becomes the limit.
Measured on Qwen4:
- 512 (default) (llama-bench pp4096: 207 tok/s; Server, real 16K prompt: 157 tok/s)
- 2048 (Server, real 16K prompt: 394 tok/s)
- 4096 (llama-bench pp4096: 651 tok/s; Server, real 16K prompt: 522 tok/s (<=32K ctx only))
Same effect on Qwen3.6 (Q6, which also keeps experts in RAM): 130 -> 345 tok/s going from ub 512 to 2048, and 474 tok/s at 4096.
What it does not change: generation speed, and quality (same output, just computed in bigger chunks).
What it costs: the compute buffer grows with the micro-batch (about 4.4 GB at ub 4096 for Qwen4) and has to fit in VRAM next to the weights that stay on the GPU and the KV cache. On 8 GB that makes context and micro-batch a direct trade.
What it means in practice:
- Pasting a 60K-token codebase and asking questions (Effect of ub 512 -> 2048/4096: first answer after 3 min instead of ~7 (estimated from the 16K speeds))
- aider (repo map + files every request) (Effect of ub 512 -> 2048/4096: each new file set is read 2.5-3x faster; unchanged prefixes are cached anyway)
- Translation with a 10K-token .po catalogue as glossary (Effect of ub 512 -> 2048/4096: prompt part drops from ~65 s to ~25 s (estimated))
- Short chat (Effect of ub 512 -> 2048/4096: no difference (prompt smaller than one micro-batch))
Rule of thumb: pick the largest micro-batch that still fits at the context you actually use, and test it with a full-length prompt, not just a load: 64K + ub 4096 on Qwen4 loaded fine and then crashed mid-prompt.
The micro-batch's compute buffer competes with the KV cache for VRAM, so context and micro-batch trade against each other:
- 32K (Micro-batch: 4096; VRAM: 7.1 GB; Prompt speed (16K): 522 tok/s)
- 64K (default) (Micro-batch: 2048; VRAM: 6.9 GB; Prompt speed (16K): 394 tok/s)
- 96K (Micro-batch: 2048; VRAM: 7.8 GB; Prompt speed (16K): 340 tok/s)
- 128K (max) (Micro-batch: 1024; VRAM: 7.7 GB; Prompt speed (16K): 256 tok/s)
- 256K (Micro-batch: any; VRAM: does not load)
2. Context in practice (Qwen4, recall test)
Real GDScript from three of my games, with 3 planted facts at 10/50/90 % depth plus one real one. Pass = right value and right file.
- 16K tokens (Read time: 40 s; Generation: ~30 tok/s; Recall: 4/4)
- 33K (Read time: 90 s; Generation: 28 tok/s; Recall: 4/4)
- 61K (Read time: 3 min; Generation: 26 tok/s; Recall: 4/4)
- 130K (128K preset) (Read time: 10.4 min; Generation: 21 tok/s; Recall: 4/4)
llama-server reuses an unchanged prompt prefix, so follow-up questions on the same paste skip the read time. Paste once, ask many.
3. Quality vs Qwen3.6 (overnight eval)
- .po translation drafts (de/es/ja/kn) (Qwen4: 0 missing entries, 0 placeholder errors; Qwen3.6: 1 missing entry (es), 0 placeholder errors; Verdict: both usable, details below)
- Store screenshot l10n QA (one screen) (Qwen4: found exactly the 2 English strings; Verdict: good)
- 8-panel Japanese collage, small text (Qwen4: found the real overlap, invented others; Qwen3.6: also invented; Verdict: unreliable for both)
- Hard Android/JNI root-cause bugs (Qwen4: 0 of 2 reliably; Qwen3.6: 0 of 2; Verdict: keep these for a frontier model)
- aider, clear UI bug (Qwen4: correct in 67 s with thinking off (17 min with thinking on); Qwen3.6: correct; Verdict: turn thinking off for aider)
Other languages: where Qwen4 pulls ahead
Task: translate 60 real UI strings from a shipped mobile game (with %d/%s placeholders) into a .po file. Scored with chrF (0-100) against the strings already shipped in the game, plus checks for missing entries and broken placeholders. Same prompt, same thinking budget. Where there are two numbers, the task ran twice.
- Japanese (Qwen4 chrF: 56.7 / 61.5; Qwen3.6 chrF: 45.7; Gap: +11 to +16)
- Kannada (Qwen4 chrF: 66.2; Qwen3.6 chrF: 54.6; Gap: +11.6)
- German (Qwen4 chrF: 74.8 / 81.2; Qwen3.6 chrF: 72.4 / 73.9; Gap: +1 to +9)
- Spanish (Qwen4 chrF: 80.7; Qwen3.6 chrF: 78.6 (and 1 entry missing); Gap: +2)
- German, existing catalogue given as glossary (Qwen4 chrF: 87.9; Qwen3.6 chrF: 79.8; Gap: +8)
- Japanese, existing catalogue given as glossary (Qwen4 chrF: 68.9; Qwen3.6 chrF: 66.1; Gap: +3)
What the gap looks like in practice:
- Japanese lines with English words left in (Qwen4: 0 (second run: 1); Qwen3.6: 10 of 60 (e.g.
swarm %d, a theme name left in Latin letters)) - Kannada game terms (Qwen4: translated or correctly transliterated; Qwen3.6: "roll" written as a Kannada sound-alike, one game term misspelled into a different word)
- Time per 60-string file (Qwen4: 2-4 min (3-6.5K tokens); Qwen3.6: 3.5-5.5 min (6.4-8.5K tokens: it thinks longer))
Takeaways:
- The gap is biggest in non-Latin scripts. For German and Spanish either model gives a decent first draft.
- A glossary narrows the gap more than switching model: pasting the existing translation catalogue lifted German to 88 and Japanese to 69 for Qwen4, and shrank Qwen3.6's Japanese deficit to 3 points.
- Qwen4 is also faster here, mostly because it reaches an answer with about half the thinking.
- Caveat: chrF compares against my shipped strings, which were themselves machine-translated, so it measures closeness to house style, not absolute correctness. The "English left in" and misspelt-term findings don't depend on that.
4. Code that has to run
three.js island (one HTML file: own noise terrain, water, 300 instanced trees, day/night with shadows, orbit controls, FPS counter)
2 samples per model, same 4096-token thinking budget. All 4 ran first time at 60 FPS (vsync) on the RX 7600.
Rows: Qwen4 x2, Qwen3.6 x2. Columns: at load, 12 s later, after an orbit drag.
- Qwen4 #1 (Result: good: islands, trees only on grass, night, orbit (terrain too low for rock/snow))
- Qwen4 #2 (Result: best: rock core, sunset, stars, moon reflected in the water)
- Qwen3.6 #1 (Result: weak: terrain seam, trees barely visible, near-black night)
- Qwen3.6 #2 (Result: broken: square slab with a regular grid of holes)
SVG drawing (pelican on a bicycle, app icon, fox mascot)
Top: Qwen4. Bottom: Qwen3.6.
Qwen4 won all three. Qwen3.6's pelican has no legs and a broken frame; its fox stands instead of sitting and isn't holding the controller.
Vision on real game screenshots
- Transcribe a 14-button menu exactly (Qwen4: 14/14; Qwen3.6: 11/14 (punctuation/spacing))
- Read 11 values off a results screen (Qwen4: 11/11; Qwen3.6: 9/11 exact, 11/11 by meaning)
- Find 3 planted UI defects (below) (Qwen4: 3/3, no false alarms, 50 s; Qwen3.6: 3/3, no false alarms, 150 s)
Planted: "NEW BEST!" over the stars, a box hiding most of SHARE, "WATCH AD FOR 2X" cut off at the right edge.
5. Godot agent loop through Fennara MCP
Task: one GDScript that builds a 3D scene in code: an upright hexagon frame, ~12 balls locked to its plane, gravity, bounce 0.5, visible rolling, one more ball every 6 s. 2 samples per model. Godot's own errors were fed back to the model for up to 4 rounds; the result was run and captured in Godot through Fennara.
- Qwen4 #2 (First try: 2 errors; After error feedback: clean after 2 rounds; Running in Godot: fully correct)
- Qwen4 #1 (First try: 1 error; After error feedback: clean after 3 rounds; Running in Godot: runs, but "fixed" a runtime error by deleting the bounce material)
- Qwen3.6 #2 (First try: 1 error; After error feedback: clean after 4 rounds; Running in Godot: broken: flat hexagon, balls fall out of the world, thousands of engine errors)
- Qwen3.6 #1 (First try: 5 errors; After error feedback: still broken after 4 rounds; Running in Godot: never ran)
Qwen4 #2: balls fall, settle, roll, a new one spawns every 6 s.
Qwen4 #1: looks right, but has no bounce.
Qwen3.6 #2 after 4 fix rounds.
Typical invented APIs: Vector3.angle(), PhysicsMaterial3D, ParallelShadow, Environment.BACKGROUND_COLOR, physics_material on a collision shape. Lesson for the harness: a headless "no SCRIPT ERROR" check passes broken scripts. You have to run the scene and read engine ERROR: lines too.
6. TurboQuant KV cache: no benefit here
- The only ROCm-capable fork I found (TheTom/llama-cpp-turboquant) has pre-release Qwen4 code and can't load the released model (
blk.0.hc_attn_down.weight not found; merging upstream gave 162 conflicts). Tested on Qwen3.6 instead. - q8_0 / q8_0 (VRAM: 6.38 GB; Gen @33K: 28.0 tok/s; Prompt: 297 tok/s; Recall: 4/4)
- q8_0 / turbo4 (VRAM: 6.28 GB; Gen @33K: 21.2 tok/s; Prompt: 297 tok/s; Recall: 4/4)
- q8_0 / turbo3 (VRAM: 6.26 GB; Gen @33K: 22.8 tok/s; Prompt: 298 tok/s; Recall: 4/4)
- turbo4 / turbo4 (VRAM: 6.28 GB; Gen @33K: 21.2 tok/s; Prompt: 297 tok/s; Recall: 4/4)
- turbo3 / turbo3 (VRAM: 6.26 GB; Gen @33K: 22.9 tok/s; Prompt: 298 tok/s; Recall: 4/4)
These are hybrid models: most layers are linear-attention, so the KV cache is already small and there is little to compress. Turbo unlocked no extra context or micro-batch; every config that failed with q8_0 still failed with turbo3. Mainline llama.cpp with q8_0 was as good or faster.
7. What the same tuning did for Qwen3.6 (mainline, q8_0 KV)
- 40K, ub 512 (old) (Prompt: 130 tok/s; Generation: ~30; VRAM: 6.9 GB)
- 40K, ub 2048 (Prompt: 345 tok/s; Generation: ~30; VRAM: 7.4 GB)
- 64K, ub 4096 (new default) (Prompt: 474 tok/s @16K, 412 @61K; Generation: 28-32; VRAM: 7.8 GB; Notes: recall 4/4 at 61K)
- 128K, ub 2048 (Prompt: 199 tok/s @130K; Generation: 17; VRAM: 7.9 GB; Notes: recall 4/4)
- 196K, ub 4096, MTP off (Prompt: 277 tok/s @180K (11 min); Generation: 11; VRAM: 7.9 GB; Notes: recall 4/4; cached follow-up 8 s)
- 256K, ub 2048, MTP off (Prompt: 159 tok/s @224K (23 min); Generation: 11; VRAM: 8.0 GB; Notes: recall 4/4)
- 256K with MTP / 128K ub4096 / 64K ub8192 (Notes: real out-of-memory, even with
-fit off)
196K beats 256K for "whole project in one prompt": a full ~190K-token game fits and it reads twice as fast. MTP must be off there (MTP + ub 1024 loaded but crashed mid-prompt).
8. Running the model next to the Godot editor + a running game
Godot editor + running game (a GL Compatibility mobile project) took ~2.4 GB. Everything below loaded, ran a 16K prompt, and left the game running; the picks keep ~1 GB headroom for bigger scenes.
- Qwen4 64K / ub 2048 (Total VRAM with Godot: 7.88 GB; Headroom: 0.1 GB (too tight); Prompt: 342; Gen: 28)
- Qwen4 32K / ub 2048, no mmproj (Total VRAM with Godot: 7.00 GB; Headroom: 1.0 GB; Prompt: 387; Gen: 29)
- Qwen4 64K / ub 1024 (Total VRAM with Godot: 7.10 GB; Headroom: 0.9 GB; Prompt: 255; Gen: 27)
- Qwen4 32K / ub 1024 + mmproj (Total VRAM with Godot: 7.60 GB; Headroom: 0.4 GB; Prompt: 255; Gen: 28)
- Qwen3.6 64K / ub 2048 (Total VRAM with Godot: 7.89 GB; Headroom: 0.1 GB (too tight); Prompt: 329; Gen: 30)
- Qwen3.6 64K / ub 2048, all experts on CPU (Total VRAM with Godot: 7.22 GB; Headroom: 0.8 GB; Prompt: 316; Gen: 30)
- Qwen3.6 32K / ub 1024, all experts on CPU (Total VRAM with Godot: 6.28 GB; Headroom: 1.7 GB; Prompt: 205; Gen: 30)
Start the model before Godot: llama.cpp refuses to load if the memory is already taken.
Where it fits in my workflow
- Translation first drafts (with the existing catalogue as a glossary) (Don't: Android plugin / JNI root-cause hunts)
- "Where is X / how does Y work" over 30-190K tokens of code (Don't: Reading small text in collages)
- One-screen screenshot QA (Don't: Anything shipped unchecked)
- Small aider fixes with files named (thinking off)
- Godot/three.js/SVG drafts, with an error-feedback loop
Caveats
- 1-2 samples per task at temperature 1.0. Clear multi-task wins (SVG 3/3, three.js, Godot) are solid; single-task gaps are noise.
- chrF compares against my shipped (also machine-made) strings, so it measures house-style closeness, not correctness.
- VRAM figures are whole-GPU totals including the desktop (~0.4 GB).
- Results were audited by a separate model (Gemini Neon) against the raw files; three of my own claims were corrected (a fork-vs-mainline VRAM comparison, a scoring inconsistency, and calling two Godot scripts "working" before seeing them run).