lifeidle/Qwen4-35B-A3B-5090-Laptop-24GB
About
Qwen4-35B-A3B UD-IQ4_XS GGUF 本地部署 / local benchmark on RTX 5090 Laptop 24GB: llama.cpp b12973 CUDA, 3.4-4.0k tok/s prefill, 157 tok/s decode, MTP + engram offload, OpenAI API, 中文双语图表, one-click launcher.
Developer ToolsMeasured star growth
- in 24h
- Collecting history
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.en.md
OriginalQwen4-35B-A3B on RTX 5090 Laptop 24GB — local deployment & measurements
Auto language page · 中文完整版 · Bilingual home
Key facts (at a glance)
| Item | Result |
|---|---|
| Model | Qwen4-35B-A3B · UD-IQ4_XS (Unsloth Dynamic GGUF, 2 shards, ~30 GB) |
| Engine | llama.cpp b12973 (nightly, Windows x64, CUDA 13.5) |
| Hardware | RTX 5090 Laptop 24GB (24,463 MiB) + 63.4 GiB RAM |
| VRAM | 20,960 / 24,463 MiB (85.7%) |
| Prefill | 3,391–4,033 tok/s (2K–16K); 3,766 tok/s at 30K |
| Decode | Short chat 84–90 tok/s; code/reasoning 133–157 tok/s |
| Best | 157.3 tok/s, 611 tokens in 4.05 s (code task, reasoning_high) |
| MTP gain | +22.5% (148.6 vs 121.3 tok/s, same task on/off) |
| Concurrency | 1 / 2 / 4 requests → 123 / 147 / 156 tok/s aggregate |
| API | http://127.0.0.1:8082/v1 (OpenAI-compatible) |
Charts
1. Environment & model
GPU NVIDIA GeForce RTX 5090 Laptop, 24,463 MiB, driver 617.42, CUDA UMD 13.4
RAM 63.4 GiB
OS Windows 11 x64
Model D:\models\Qwen4-35B-A3B-GGUF\UD-IQ4_XS\
00001-of-00002.gguf (20 GiB) + 00002-of-00002.gguf (11 GiB)
Parsed GGUF header: general.architecture = qwen4exp, 911 tensors, 41 blocks, 256 experts / 8 routed, nextn_predict_layers = 1 (the MTP drafter is packed into shard 1), native context 1,048,576, PLE/engram table in shard 2.
Qwen4-35B-A3B is more than "35B": besides 35B MoE weights (3B active per token) it carries a ~20B n-gram lookup table (engram/PLE) and a ~2B MTP draft head. Each token reads only 16 engram rows, so the table can stay in host RAM or on SSD — that is how a 24GB card can run it.
2. Why UD-IQ4_XS
| Quant | Download | Weights with engram offloaded | Unsloth eval accuracy | Fits 24 GB |
|---|---|---|---|---|
| UD-IQ3_XXS | 28.7 GB | 17.2 GB | 94.8% | yes, lower quality |
| UD-IQ4_XS | 32.0 GB | 20.5 GB | 95.2% | yes — chosen |
| UD-Q4_K_XL | 36.2 GB | 24.7 GB | 95.0% | too tight |
| UD-Q6_K / Q8_K_XL | 51–62 GB | 29–40 GB | 95.3% / 94.8% | no |
(Unsloth's 300-question internal eval; BF16 = 95.3%; differences within ~1 point are noise.)
- It is the quant Unsloth officially recommends for 24GB devices (RTX 4090 / 5090 laptop class). Measured 20.96 GiB matches the ~20.5 GB estimate.
- Nearly no quality loss: 95.2% vs BF16 95.3%; also the smallest quant Unsloth recommends for image input.
- The engram is separable: shard 2 is the PLE table;
-ot per_layer_token_embd=CPU --lazy-mode onkeeps it in host RAM and reads rows on demand. - The MTP head is packed into shard 1, so no separate drafter download is needed.
3. Why llama.cpp
| Engine | Location | Outcome |
|---|---|---|
| Strata | D:\Strata, engine 0.1.55 |
Incompatible. Its tools built a Qwen4 pack, but the engine aborts with native experts: expert geometry is not whole blocks. Strata's native expert path needs whole-block experts; UD-IQ4_XS is dynamic. |
| Basalt | D:\Strata\basalt-win\basalt-v0.3.3-windows-x64 |
Engine present, but the Windows archive ships no tools/convert/convert.py — cannot convert the GGUF locally. |
| Bundled llama.cpp | ~/.unsloth/llama.cpp, b10840 (2026-09) |
Too old; Qwen4 landed in PR #33626 on 2026-12-03. |
| Official llama.cpp b12973 | downloaded to runtime/bin |
Works. First nightly with Qwen4; Unsloth's own guide uses llama.cpp. |
llama.cpp also provides an OpenAI-compatible server, Jinja chat template with reasoning control, Q8 KV cache, and MTP speculative decoding — exactly the switches this model needs.
4. Quick start
Double-click scripts/start-qwen4-24g.bat, then open http://127.0.0.1:8082. API base URL: http://127.0.0.1:8082/v1.
llama-server.exe ^
-m "D:\models\Qwen4-35B-A3B-GGUF\UD-IQ4_XS\Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf" ^
-ngl 999 -fa on --jinja -c 32768 ^
--load-mode mmap --lazy-mode on -ot per_layer_token_embd=CPU ^
--cache-type-k q8_0 --cache-type-v q8_0 ^
--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0 ^
--spec-type draft-mtp --spec-draft-n-max 1 ^
--host 127.0.0.1 --port 8082
| Flag | Purpose |
|---|---|
-ngl 999 |
Offload all 40 layers + MTP layer to VRAM |
-fa on |
Flash attention, less KV scratch memory |
--jinja |
Use the GGUF's embedded chat template (thinking aware) |
-c 32768 |
32K context; native 1M is impractical on 24GB |
--load-mode mmap --lazy-mode on |
Do not eagerly materialize the engram table |
-ot per_layer_token_embd=CPU |
Keep the ~11.5GB PLE/engram tensor in host RAM |
--cache-type-k/q8_0 |
8-bit KV cache: half the VRAM, negligible quality loss |
--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0 |
Qwen4 official thinking-mode sampling |
--spec-type draft-mtp --spec-draft-n-max 1 |
Use the embedded 2B MTP head; depth 1 is conservative |
--host 127.0.0.1 |
Local-only server, no API key needed |
5. Measurements
Numbers come from llama-server's timings; one run per scenario, expect ±5–10%. Raw data: benchmarks/results.json.
Short chat
| Scenario | Prompt tok | Completion tok | Prompt tok/s | Decode tok/s | Wall |
|---|---|---|---|---|---|
| Cold first request | 38 | 99 | 126.6 | 89.8 | 1.43 s |
| Warm, 26-token prefix cached | 30 | 31 | 50.6 | 84.2 | 0.50 s |
Prompt-length scaling
| Prompt tokens | Prompt tok/s | Completion tok | Decode tok/s | Wall |
|---|---|---|---|---|
| 2,127 | 3,390.8 | 127 | 112.9 | 1.81 s |
| 8,275 | 4,032.7 | 14 | 79.5 | 2.29 s |
| 16,438 | 4,008.7 | 128 | 90.9 | 5.62 s |
| 30,059 | 3,765.7 | 128 | 96.3 | 9.55 s |
Reasoning effort (same code question)
reasoning_effort |
Completion tok | Decode tok/s | Wall | Observation |
|---|---|---|---|---|
off |
345 | 133.4 | 2.88 s | Direct answer |
low |
398 | 148.6 | 2.89 s | Short internal reasoning |
high |
611 | 157.3 | 4.05 s | Longer reasoning, 6k±1 optimized code |
Send reasoning_effort as a top-level field to avoid the "Conflicting thinking settings" HTTP 500 described in Unsloth's guide.
Concurrency
| Requests | Total output tok | Aggregate tok/s | Per-request tok/s | Wall |
|---|---|---|---|---|
| 1 | 158 | 122.7 | 139.6 | 1.29 s |
| 2 | 283 | 146.5 | 99.0 / 90.6 | 1.93 s |
| 4 | 444 | 156.3 | 57.4 / 30.7 / 65.4 / 67.5 | 2.84 s |
MTP on vs off
| Scenario | MTP on (depth 1) | MTP off | Gain |
|---|---|---|---|
Code task, reasoning_low |
148.6 tok/s | 121.3 tok/s | +22.5% |
| Very short Chinese sentence | 84.2 tok/s | 94.5 tok/s | noisy (31–92 output tokens) |
Draft acceptance was 193/204 (~95%). With --spec-type none, llama.cpp logs unused blk.40.* warnings — expected, because that block is the MTP draft layer.
VRAM
Steady at 20,960 MiB / 24,463 MiB (85.7%) across all scenarios, leaving ~3.4 GiB headroom.
6. Quality observations
- Chinese chat, bilingual explanation and code generation were coherent and correct.
judge_primeused 6k±1 trial division and correctly reported O(√n) / O(1). reasoning_effortworks:offanswers immediately,low/highemit a<think>block,highproduced the best implementation.- A 30K-token technical prompt was answered correctly with no repetition or context loss.
- Vision not tested:
mmproj-BF16.ggufis absent. UD-IQ4_XS is the minimum quant Unsloth recommends for image input, so adding the projector later is viable.
7. Caveats
- Only 30K tokens were tested; native 1M context cannot fit a full KV cache on 24GB.
- Single runs,
n_threads=24, ±5–10% variance. - No API key and bound to 127.0.0.1 — do not expose publicly without authentication.
- MTP depth 2 may be faster but was not tested to preserve VRAM headroom.
- Accuracy figures are Unsloth's published eval, not local perplexity/GSM8K tests.
8. Files
README.md bilingual landing page (key facts + charts)
README.zh-CN.md full Chinese README
README.en.md this file
docs/quantization.md why this quant
docs/engine-selection.md engine trials and exact errors
docs/benchmarks.md methodology and raw data
docs/faq.md FAQ (bilingual)
assets/charts/*.svg 8 comparison charts (light/dark themes)
tools/generate_charts.py chart generator
benchmarks/run_bench.py reproducible benchmark script
benchmarks/results.json raw measurements
scripts/start-qwen4-24g.bat one-click launcher
9. Credits
- Model: Qwen/Qwen4-35B-A3B (Apache-2.0), unsloth/Qwen4-35B-A3B-GGUF
- Runtime: ggml-org/llama.cpp b12973
- Official guide: Unsloth — Qwen4 35B-A3B: How to Run Locally
10. Search phrases
Qwen4-35B-A3B 24GB VRAM local deploymentQwen4 UD-IQ4_XS llama.cpp benchmarkQwen4 GGUF RTX 5090 tokens per secondUD-IQ4_XS vs UD-Q4_K_XL accuracyQwen4 engram PLE VRAM optimizationllama-server draft-mtp speculative decoding benchmarkQwen4 OpenAI-compatible API local
Explore related projects
Loading…