📚 More on this topic: Best way to run Qwen 3.6 35B MoE locally · Qwen 3.8 Flash-Next on a 3090 and a 3060 · DFlash vs MTP on an RTX 3090 · llama.cpp’s MoE cache on a 3060 · InsiderLLM Benchmarks

You’ve got a 24 GB or a 12 GB card, a new “35B” model came out on December 3, and the Q4 download is 35 GB. That’s the first surprise with Qwen 4 35B-A3B, Alibaba’s new mixture-of-experts model (35B parameters, about 3B active per token). The name doesn’t count its n-gram embedding: a 20B-parameter lookup table of word pairs and triples. In Unsloth’s GGUFs that table is its own 11.52 GB file. With it, UD-Q4_K_M weighs 35.18 GB, where Qwen 3.6 35B-A3B at the same quant label is 22.13 GB. The licence is Apache 2.0.

The model card says the table adds quality “without extra compute or accelerator memory overhead”. The idea is that a lookup table doesn’t need to be on the GPU. So the questions for a home rig are where the table should live, what each choice costs, and whether everything else still fits.

I ran it the day after release on two machines: an RTX 3090 (24 GB, PCIe 4.0) and an RTX 3060 (12 GB, 32 GB of RAM, PCIe 3.0). Both used the same llama.cpp build. Before running anything I locked a pre-registration with 12 scored predictions and their pass bands. Eight passed and four missed. The misses are the useful part.

Image: Bar chart of Qwen 4 35B-A3B decode speed on an RTX 3090 by n-gram table placement. Qwen 3.6 control 173.2 tok/s; Qwen 4 Q4 with the table in RAM 126.6; table read lazily from NVMe 123.5; table and all experts in RAM 41.6; IQ1_S with the table in RAM 138.8; IQ1_S lazy 135.5; IQ1_S with the table forced onto the GPU 2.25

The short version

RTX 3090 (24 GB)RTX 3060 (12 GB, 32 GB RAM)
Fits at UD-Q4_K_M?Yes, every layer on the GPU, table in RAM: 22.3 GiB VRAMWith -ncmoe 24 (experts of 24 layers in RAM): 11.3 GiB VRAM
Decode, empty context126.6 tok/s33.7 tok/s
vs Qwen 3.6 35B-A3B, same settings0.73× (173.2 tok/s)0.86× (39.4 tok/s)
Prefill, 512 tokens4,614 tok/s (0.78× Qwen 3.6’s 5,891)not measured at pp512; 2,343-token prompt in the server: 403 tok/s
Table lazy from NVMe instead of RAM123.5 tok/s decode (0.98× table in RAM), prefill 0.78×lazy is the better choice: table in RAM starts at 7.1 tok/s and settles below lazy’s 24.7 (exploratory, see below)
Table forced onto the GPU2.25 tok/s (IQ1_S; Q4 doesn’t fit at all)not tried
MTP speculative decodingslower: 0.82× to 0.98× of MTP offnot tried

All decode figures are llama-bench tg128, mean of three invocations. Every ratio names its baseline in brackets or in the row label.

What “35B” means for your memory

PieceFile (GB)Where it can live
The model proper (UD-Q4_K_M shard 1)23.66GPU, or GPU plus expert offload
The n-gram table (shard 2, IQ4_NL)11.52GPU, system RAM, or read on demand from disk
MTP head (Q8_0, optional)2.01GPU
Qwen 4 UD-Q4_K_M total35.18
Qwen 3.6 35B-A3B UD-Q4_K_M22.13

The table file is byte-identical across every Unsloth quant from UD-IQ1_S to UD-Q4_K_XL, so dropping to a smaller quant shrinks only the model proper. In llama.cpp the table is one tensor, per_layer_token_embd.weight, and llama.cpp’s v1.1.1 release reads it from disk on demand by default (--lazy-mode on for tensors over 4 GiB).

On a 3090: 127 tok/s, and Q4_K_M does fit

Unsloth’s docs say to “start with UD-IQ4_XS on 24GB devices”. I predicted Q4_K_M would fit with the table off the card, and it did. With -ngl 99 -fa 1 -lzm off (every layer on the GPU, table resident in system RAM), llama-bench ran through 8,192 tokens of context with a VRAM peak of 22,846 MiB (22.3 GiB). In the MTP server runs at -c 32768 the peak was 22.5 GiB with MTP off, so a 32K context fits as well.

Qwen 4 UD-Q4_K_M on the 3090Decode tok/s (d=0 / 4K / 8K)Prefill pp512 tok/s (d=0 / 4K / 8K)VRAM peak
Table in RAM (-lzm off)126.6 / 122.0 / 120.74,614 / 4,353 / 4,12522.3 GiB
Table lazy from NVMe (-lzm on)123.5 / 119.1 / 118.33,585 / 3,462 / 3,34822.3 GiB
Table in RAM, all experts in RAM (-ncmoe 40)41.6 / 41.1 / 41.0610 / 677 / 6733.5 GiB
Qwen 3.6 35B-A3B UD-Q4_K_M (control)173.2 / 170.4 / 166.85,891 / 5,501 / 5,19221.2 GiB

Qwen 4 decodes at 0.73× Qwen 3.6’s speed (126.6 against 173.2) and prefills at 0.78× (4,614 against 5,891). Both landed inside my bands, which I’d set at 0.70–0.95 and 0.60–1.00. The MoE shape is the same as Qwen 3.6’s, so this is the cost of the new attention and the n-gram lookup on the same card.

Table in RAM versus lazy is close for decode (lazy is 0.98× of RAM). Prefill is where lazy costs you: 3,585 against 4,614 tok/s, or 0.78× of table in RAM. If you have the system RAM to spare, -lzm off is the better setting on a 3090. The table takes about 11 GB of page cache either way once it’s warm. If you run from a cold page cache, lazy decode drops to 117.2 tok/s, 0.95× of warm lazy, for the first run.

Power limit for all of this was 420 W, our card’s default. The reference 3090 is 350 W, and our power-limit tests put the cost of a lower cap on decode.

Don’t force the n-gram table onto the GPU

This is the one to remember. If you put the table on the card with -ot per_layer_token_embd=CUDA0, decode collapses.

At Q4 it can’t even load. llama.cpp tried to allocate 32,644 MiB (31.9 GiB) on a 24 GB card and failed. To measure the effect anyway, I used UD-IQ1_S, the smallest quant, where the model proper is 9.75 GB and the table plus model does fit:

Qwen 4 UD-IQ1_S on the 3090Decode tok/sPrefill pp512 tok/sVRAM peakSystem RAM used
Table forced onto the GPU2.2587920.3 GiB13.5 GiB
Table in RAM (-lzm off)138.83,5369.5 GiB2.7 GiB
Table lazy from NVMe135.52,9039.5 GiB2.7 GiB

With the table on the card, decode is 61.8× slower than with it in RAM. My prediction was that keeping the table in RAM would cost little against having it on the GPU (a ratio of 0.95–1.02). That missed by a mile, in the opposite direction from the one the card’s wording warns about.

Why: my working explanation, which I checked after scoring, is that the table crosses the PCIe bus on every forward pass. The table is stored as IQ4_NL, and in this llama.cpp build the CUDA backend declines to do a row lookup (GET_ROWS) on IQ4_NL. So llama.cpp’s scheduler runs the lookup on the CPU and copies the whole 11 GB tensor back from the card to do it. Two things fit that:

  • In an exploratory run with nvidia-smi dmon, the card was sending about 28,700 MB/s to the host for the whole of generation with the table forced on. With the table in RAM the bus was close to idle. The forced-GPU run also used 13.5 GiB of system RAM against 2.7 GiB, which is about the size of a host-side copy of the table.
  • 2.25 tokens a second times an 11.5 GB table is about 26 GB/s, roughly what a PCIe 4.0 x16 link moves in practice.

That’s consistent with one full copy per token. I haven’t traced it in the scheduler, so treat it as the likely mechanism, not a proven one. A future llama.cpp build that adds IQ4_NL row lookups to CUDA could change the result.

The practical rule is simpler than the mechanism: leave the table where llama.cpp puts it by default, or use -lzm off to keep it in RAM. Don’t send it to the GPU with -ot. Also watch for the opposite trap: in v1.1.1, lazy mode silently overrides -ot for this tensor unless you also pass -lzm off. So a command that looks like it puts the table on the GPU might not, which is exactly what happened in my first run (see “How this was run”).

The card’s memory claim does hold. With the table off the card, its on-card cost was nil: IQ1_S peaked at 20,739 MiB with the table forced on and 9,732 MiB with it in RAM, a gap of 11,007 MiB against a table of 10,987 MiB.

MTP doesn’t help yet

Qwen 4 ships a multi-token prediction (MTP) head, a small extra layer that drafts tokens for the main model to check. The Qwen 4 blog post reports generation 22% faster with MTP on an Apple M5 at Q4. I don’t have a Mac, so that’s vendor-reported. I predicted a 1.10–1.45× decode gain on the 3090. Instead MTP made decode slower in every case:

llama-server, 3 rounds, temperature 0Short prompt (512 tokens out)Long prompt (4K in, 256 out)
MTP off122.1 tok/s118.2 tok/s
MTP, built-in head (--spec-type draft-mtp --spec-draft-n-max 3)101.7 (0.83× off)116.2 (0.98× off)
MTP, separate Q8_0 head (-md)100.3 (0.82× off)109.7 (0.93× off)
Draft tokens accepted33%45%

All three modes fit on the card with no expert offload (-ncmoe 0), peaking at 22.5–22.9 GiB with a 32K context. The acceptance rate is the problem. With a third to under half of drafted tokens accepted, the drafting costs more than it saves. MTP on Qwen 3.6 27B was a different story on the same card. This is day-two llama.cpp support, so check again after a few releases.

On a 3060: 33.7 tok/s at -ncmoe 24

The 3060 can’t hold the model proper, so the routed experts of some layers go to system RAM with -ncmoe N. I predicted Qwen 4 would need more offload than Qwen 3.6’s -ncmoe 24, somewhere in 27–33. It didn’t. The search stepped down by 2 from 36. Every value down to 24 completed at 4K context, and 22 ran out of memory. So the fit point is 24, the same as Qwen 3.6. (23 wasn’t tested; the protocol stepped by 2.)

On the 3060 (UD-Q4_K_M, table lazy from NVMe)Decode tok/s (d=0 / 4K)VRAM peak
Qwen 4, -ncmoe 2433.7 / 33.311.3 GiB
Qwen 3.6, -ncmoe 24 (control)39.4 / 39.210.0 GiB
Qwen 4, -ncmoe 40 (all experts in RAM)24.8 / 24.63.3 GiB
Qwen 3.6, -ncmoe 40 (control)28.4 / 28.22.7 GiB

At the fit point Qwen 4 decodes at 0.86× Qwen 3.6. With all experts in RAM it’s 0.87× (24.83 against 28.44), inside my 0.75–1.00 band. In the server with a 2,343-token prompt, Qwen 4 at -ncmoe 24 prefilled at 403 tok/s and decoded at 34.3 tok/s (warm runs). Qwen 3.6 did 405 and 38.6. A cold start, with nothing in the page cache, cost Qwen 4 about 4% decode on the first request (33.0).

Where the table should live: NVMe, RAM or HDD

On a 32 GB machine, keep the table lazy. Holding it in RAM with -lzm off sounds faster, but the table and the model proper together come to 35.2 GB and the box has 31 GiB. Something has to give, and what gives is the model proper’s page cache. I predicted the RAM setting would overcommit memory outright, meaning more than 256 MiB of swap, a failed load, or MemAvailable under 1 GiB. It didn’t: swap stayed at 185–225 MiB and MemAvailable never went below 29 GiB, because the pressure lands on cached file pages, not on anything the kernel counts as used.

The scored run had one RAM-resident rep. So after scoring I ran three more of each setting, alternating them, with the cached fraction logged before each run. These are exploratory numbers with no band:

3060, -ncmoe 40, 3 runs each (exploratory)Decode, d=0Decode, d=4KShard 1 cached at startRead from the HDD per run
Table lazy from NVMe (default)24.7 tok/s24.4 tok/s100%under 0.01 GB
Table in RAM (-lzm off)7.1 tok/s23.2 tok/s86%27–28 GB

With the table pinned, each run started with 14% of the model proper evicted and re-read 27–28 GB from the hard drive holding it. Inside one run the first three decode passes went 2.7, 6.1 and 11.6 tok/s as those pages came back. Once it settled, at 4K context, it ran at 23.2 tok/s, still 0.95× of lazy. Lazy decode didn’t wobble at all. On this box the model proper sits on an HDD, so an NVMe copy would shorten that slow start, but it wouldn’t remove it.

The table’s disk matters far more than RAM versus lazy. With the table on a hard drive instead of the NVMe system drive, 3060 decode at -ncmoe 40 fell to 10.45 tok/s, 0.42× the NVMe figure (24.83). From a cold page cache it was 8.75 against 23.98, 0.36×. A lazy table means random row reads every token, which suits an SSD and punishes spinning rust. Put the table file on an SSD.

Table read from (3060, -ncmoe 40)Warm decodeCold decode (first run)
NVMe24.8 tok/s24.0 tok/s
HDD10.5 tok/s8.8 tok/s

Which setup to use

  • 24 GB card: UD-Q4_K_M, -ngl 99 -fa 1 -lzm off. That’s about 127 tok/s with 32K context to spare. You need about 12 GB of free system RAM for the table. Short on RAM? Leave lazy mode on (the default) with the table file on an NVMe drive, and expect prefill around 0.78× of that.
  • 12 GB card with 32 GB of RAM: -ncmoe 24, lazy mode left on (the default), table file on an SSD. About 34 tok/s. Don’t use -lzm off here: the table crowds the model out of the page cache.
  • Either card: don’t put per_layer_token_embd on the GPU. Skip MTP for now.
  • Already happy with Qwen 3.6 35B-A3B? Qwen 4 runs at 0.73× of its decode on a 3090 and 0.86× on a 3060 at the fit point, and needs 13 GB more disk. I didn’t test quality, so speed alone doesn’t make the case for switching.

How this was run

  • I locked 12 scored predictions with pass bands before any scored run. The bands were set at 10:01 PT on 12-04 and locked at 15:19. Hits: Q4 fits the 3090 (P1), forced Q4 placement OOMs (P2), the table off the card frees its memory (P3b), lazy costs little decode (P3c), the decode and prefill ratios against Qwen 3.6 (P4, P5) and the 3060 host-bound ratio (P8). Misses: the forced-GPU table speed (P3), MTP (P6), the 3060 fit point (P7: 24, with 23 untested because the protocol stepped by 2) and RAM overcommit on the 3060 (P10).

  • Amendment A1 (15:22): the first scored 3090 run showed the “all-GPU” arms weren’t all-GPU. In llama.cpp v1.1.1, lazy mode overrides -ot for the table unless you pass -lzm off. The run was stopped, -lzm off was added to those two arms, and the 3090 run restarted with no band moved. To diagnose this I ran a short VRAM-only check, and it revealed three things before the scored run:

    • P2’s outcome: the forced Q4 placement runs out of memory.
    • The IQ1_S all-GPU VRAM peak, 19,940 MiB, which bears on P3b.
    • One P1 probe, which completed at 8K context at 22,846 MiB.

    P1, P2 and P3b were still scored from the restarted run.

  • Amendment A2 (16:10): the lock stated the table’s memory test two ways. One was the P3b row’s thresholds. The other was a “≤ 256 MiB on-card cost” line in the claims table. A2 scores P3b both ways and calls it ambiguous if they disagree. It was written after the IQ1_S all-GPU peak and the other P3b inputs had been seen. It also chose the formula for the second reading and how to average peaks across reps. Both readings pass, and the three reps never differed by more than 2 MiB.

  • The exploratory checks came after scoring and have no bands. They all ran within 45 minutes once the bench was done: the PCIe measurement on the 3090, the 3060 RAM-versus-lazy reruns, and a page-cache check on the 3060.

  • The build is llama.cpp v1.1.1, commit 1579b025 (b12977), built from source on each rig (sm_86, CUDA 12.4 on the 3090 box, 12.8 on the 3060 box). Files: Unsloth Qwen4-35B-A3B-GGUF at revision 85a51187, sha256-checked against the canonical copies.

  • llama-bench settings were -ngl 99 -fa 1 -p 512 -n 128 -d 0,4096,8192 -r 5 on the 3090 and -p 0 -n 128 -d 0,4096 -r 3 -t 4 -lm mmap on the 3060. Each arm ran three times in a rotated order. Before each run, the arm’s files were evicted from the page cache and one warm-up run was thrown away.

  • The 3090 box has a Ryzen 7 5700X, 64 GB of DDR4-3000 and PCIe 4.0 x16, at 420 W. The 3060 box has an i7-7700, 32 GB of DDR4-2133 and PCIe 3.0, at 170 W. The two boxes differ in RAM speed and PCIe generation, so cross-rig comparisons are directional.

Limits

  • I measured speed only. I didn’t test whether the n-gram table improves quality, which is the card’s main claim for it.
  • It’s one llama.cpp build, and support is two days old. The forced-GPU result depends on CUDA lacking IQ4_NL row lookups in this build.
  • The 3060 box is short on RAM for this model. It has 31 GiB and the Q4 files total 35.2 GB, so some “warm” runs started with part of a file evicted. Every warm run’s cached fraction is logged in the record. Four Qwen 3.6 control runs started 81–98% cached. Their decode was within 2% of the fully cached runs. In an exploratory check the 80% figure came back when the control was warmed right after a Qwen 4 lazy run, but not after a full eviction or after a RAM-resident run. That points at the previous run’s cached pages rather than the benchmark’s own memory, which was under 100 MiB. One sample per case isn’t enough to call it.
  • I have one card of each. The 3090 ran at 420 W, so a 350 W card will decode somewhat slower.

Everything is in the record: qwen4-35b-a3b-2026-12. It has the pre-registration with both amendments, every llama-bench JSON, the per-invocation memory and cache logs, the scoring script and the exploratory runs.