Skip to content

Qwen4-35B-A3B on 2x 3060 12GB - 128k context fully on GPU, 58-90 tok/s

Spent the morning getting Qwen4 going on my two 3060s, posting numbers since I couldn't find any for 12GB cards yet.

UD-IQ4_XS fits completely in 24GB at 128k. The catch is you can't offload anything to CPU, more on that below.

Box: 2x 3060 12GB (no NVLink, and one of them is in a chipset x4 slot), 3900XT, 64GB DDR4-3200. Running in a Proxmox LXC, driver 595, CUDA 13.2. Model lives on a pair of SATA SSDs (ZFS mirror).

llama.cpp built from master on 4 Dec, you need the qwen4 PR (#33626) so older builds won't load it. Unsloth's UD-IQ4_XS is a 32GB download, 20.5GB of weights plus an 11.5GB engram shard.

What I ended up running:

llama-server -m Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf \
  -c 131072 -np 1 -sm layer -fa on -ctk q4_0 -ctv q4_0 -ub 256 -b 1024 \
  --load-mode none --lazy-mode off -ot per_layer_token_embd=CPU \
  --spec-type draft-mtp --spec-draft-n-max 2 --jinja \
  --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0

Speeds (prompt filled to ~80% of the context, needle at 40% depth, reasoning off):

Split Context Prompt tok/s Output tok/s Needle
layer 8k 1,190 89.9 found
layer 32k 1,194 81.5 found
layer 128k 1,129 58.5 found
tensor 8k 1,015 85.9 found
tensor 32k 1,091 81.6 found
tensor 128k 1,011 70.2 found

VRAM hardly changes between 8k and 128k (about 11.1/10.8GB on layer, 11.6/11.6 on tensor), the full attention layers use compressed KV so long context is cheap. 256k wouldn't load with either split though.

Also ran HumanEval and a 100 question MMLU-Pro sample with the same harness I've used on this box before, temp 0:

Qwen4 UD-IQ4_XS (llama.cpp, tensor) Qwen3.8-Flash-Next IQ3_XXS (Strata) qwen3-coder:30b Q4_K_M (Ollama)
HumanEval (pass@1) 162/164 159/164 150/164
MMLU-Pro 100 85/100 82/100 -

Stuff that tripped me up:

  • First attempt I offloaded experts for just 4 of the 40 layers with --n-cpu-moe 4 to make room. Output went from 77 to 12 tok/s. CPU pegged at 1000%, GPUs sitting at 10%. Don't do it.
  • What actually fixed the OOM was a smaller batch. Default -ub 512 -b 2048 ran the first card out of memory on an 8k prompt, -ub 256 -b 1024 was fine and prompt speed barely moved.
  • Unsloth's example uses --load-mode mmap --lazy-mode on for the engram. On ZFS that was hitting the SSD constantly (my ARC is small), 55 tok/s. Loading it into RAM with --lazy-mode off --load-mode none got me 77. Uses about 12GB of system RAM.
  • --fit is no use here, it bails if you set -ot and doesn't support tensor split at all. You're sizing it by hand.
  • MTP is built into the GGUF so turn it on, I was getting 50-68% acceptance at depth 2.

Layer vs tensor split was the bit I was most curious about. With no P2P and one card on x4 I figured tensor split would be pointless, since it has to sync both cards a couple of times per layer for every token. What I actually saw:

  • Output speed holds up much better with context on tensor. Layer drops from 90 to 58 tok/s going 8k to 128k (about 35%), tensor only drops from 86 to 70 (about 18%). Same speed up to 32k, tensor ~20% ahead at 128k.
  • Layer is consistently ~10% faster at reading prompts, at every size. So for big pastes with short answers layer still wins.
  • Memory is more even on tensor (11.6/11.6GB vs 11.1/10.8 on layer, where the first card always ends up fuller), but it uses more in total because some tensors get copied to both cards. q8_0 KV at 128k was ~150MB short on tensor, q4_0 fits with ~650MB spare. Layer has 1.1-1.5GB of headroom.
  • Tensor turns flash attention on automatically, moves sampling to the CPU, and --fit won't run with it. It's still marked experimental and I haven't had it crash, but I've only done benchmark runs on it so far.

My take: layer for general use, tensor if you live in long contexts (agents, big codebases) and mostly care about output speed.

For reference, Qwen3.8-Flash-Next IQ3_XXS on Strata on the same machine does ~1,400 tok/s prompt but only 52-53 out. Strata streams most experts from pinned RAM so it's a different beast.

1 points0 comments
Open on Reddit
About this post
Posted
Archived
Score
1 · 100% up
Kind
Text
ID
1yd1ggc

Author

1
posts
0
comments
0
media
View profile

1 comment

Nice I also have a dual 3060 setup. I’ve been tuning the same Unsloth UD-IQ4_XS on 2× RTX 3060 12 GB with 112 GB RAM, running Windows. I got 128K working with Q8_0 KV for both the model and the MTP draft on a layer split. All 42 model layers and the KV caches are on the GPUs. The Engram table is lazy-mapped on the CPU side, and the BF16 vision projector is loaded on CPU.

The biggest improvement for me was --spec-draft-n-ubatch. Going from 1 to 32 cut prefill on the same 130,560-token prompt from 6:37 to about 3:11. That was just the draft microbatch change. The target batch and microbatch stayed at 256/64. A draft microbatch of 64 loaded but ran out of VRAM on the first generation.

Here’s what I see with the final settings. These are actual input token counts in a 131,072-token slot, using an uncached code-review prompt and 256 tokens of greedy output:

Prompt tokens Prefill Decode

8,192 ~800 tok/s ~70 tok/s

130,560 678–688 tok/s 39.5–41.7 tok/

Here are some more details:

llama-server -m Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf \

--mmproj mmproj-BF16.gguf --no-mmproj-offload \

-c 131072 -np 1 -ngl 99 -sm layer -ts 46,54 -fa on --fit off \

-b 256 -ub 64 -ctk q8_0 -ctv q8_0 -ctkd q8_0 -ctvd q8_0 \

--load-mode mmap --lazy-mode on \

-ot 'per_layer_token_embd=CPU,^blk\.20\.ffn_down_exps\.weight$=CUDA0' \

--spec-type draft-mtp --spec-draft-n-max 2 --spec-draft-n-ubatch 32 \

--no-context-shift --jinja --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.