【实测】RX 7900 XT 20G 小顯存也跑 1M 上下文:Strata × Qwen4-35B-A3B UD-Q4_K_XL + MTP 實測——decode 100 t/s、583K 深度測試與坑全記錄
-

TL;DR
- 機器:.19 — RX 7900 XT(20GB 顯存)+ Ryzen 9 5900XT + 121GB RAM
- 引擎:Strata 0.2.28(build 0.1.75.0/engine 0.1.74.1)× Qwen4-35B-A3B UD-Q4_K_XL + MTP
- 關鍵數字:1M ctx;淺 prompt decode 92–100 t/s;286K–583K 深度 decode 64–68 t/s(MTP 接受率 72–76%);prefill 2,400–3,800 t/s
- 關鍵:20GB 顯存+121GB RAM 的 tiering(expert cache+KV streaming)——小顯存卡上,引擎 tiering 能力比量化档本身更重要
一、機器列表
項目 規格 GPU AMD RX 7900 XT(RDNA3,20GB 顯存) CPU AMD Ryzen 9 5900XT(Zen 3,16C/32T) 記憶體 121GB OS Ubuntu 24.04 ROCm 10.0( /opt/rocm)二、引擎與模型版本
階段 引擎 模型 備註 階段一(探路) llama.cpp b13004(官方 ROCm 預編譯) UD-Q4_K_XL(35GB,2 shards) partial offload 探測 階段二(生產,2026-12-05 起) Strata 0.2.28(build 0.1.75.0,engine 0.1.74.1) UD-Q4_K_XL + MTP 官方 unsloth mtp-Qwen4-35B-A3B-Q8_0.gguf(2.0GB)→ pack 為mtp-rt加測(12-05) Strata(手動 pack) Heretic Q4_K_M + Heretic MTP head 四方對比矩陣 三、部署配置(階段二)
strata launch --model ud-q4_k_xl --family qwen4-35b-a3b --context 1048576 \ --vision on --tune skip --access lan --no-api-key --port 8080 \ --no-tui --yes --restart --drafting mtp --mtp on- MTP draft layer:926 MiB 顯存(experts 816 + dense 66);engine args
--mtp <rt> --spec 3 --spec-min-p 0.5 - Expert cache:5,974 slots/11.62 GiB(RAM tiering)
- 顯存約 19.9/20 GiB;RAM 60/121 GB
四、實測數據
4.1 MTP A/B(128K,engine 0.1.74.1)
場景 suffix --spec 2MTP --spec 3提升 Prefill short decode 66.2 100.5 +52% — 4k decode 65.6 92.5 +41% 3,533 t/s 16k decode 67.6 90.3 +34% 3,818 t/s MTP 接受率:數數 91%(81/89);代價為 draft layer 926 MiB、expert cache 6,444 → 5,974 slots。MTP 的甜頭在可預測輸出(自然文本接受率僅 72–76%)。
4.2 1M vs 131K(同 engine + MTP)
淺 prompt 代價(1M 設定連短 prompt 都變慢):
場景 131K+MTP 1M+MTP 差 short decode 100.5 92.4 -8% 4k prefill/decode 3,533/92.5 2,901/82.2 -18%/-11% 16k prefill/decode 3,818/90.3 3,213/78.0 -16%/-14% 原因:pinned RAM/slot 1.29 → 10.31 GiB、slot VRAM 1.16 → 3.81 GiB、expert cache 被壓縮、THP 碎片(
0 GiB free 2 MiB blocks for 19 GiB arena)。深上下文(131K 直接回 HTTP 400,僅 1M 能做到):
深度 TTFT Prefill Decode MTP 接受率 286K 自然文本 約 96s 約 2,830 t/s 68.4 t/s 76% 583K 自然文本 約 235s 約 2,410 t/s 64.5 t/s 72% 583K 數數 約 235s 約 2,410 t/s 92.0 t/s 96.6%(168/174) Expert cache 命中 83–91%、KV streaming VRAM 命中 90–93%——tiering 在 583K 仍然穩定。
4.3 階段一對照(llama.cpp,同權重)
指標 CPU-only GPU offload(ngl=30) Decode 8.7 t/s 17.5 t/s(2×) Prefill(1K) 約 91 t/s 408 t/s(4–7×) 顯存 0 17.4GB/20GB 全 offload(ngl=99)→ OOM(35GB > 20GB)。llama.cpp 最佳配置:ngl=30、ctx 8192、KV q4_0。
4.4 Heretic Q4_K_M 四方對比(128K,手動 pack)
模型 × Drafter short 4k 16k 4k prefill Sanity UD-Q4_K_XL suffix 66.2 65.6 67.6 3,604 11/12 UD-Q4_K_XL MTP 100.5 92.5 90.3 3,533 10/12 Heretic suffix 69.7 69.2 69.5 2,790 7/12 Heretic MTP 100.7 90.8 88.4 2,718 9/12 Heretic MTP 專項:數數 117.8 t/s(接受率 96%,高於 UD 的 91%——Heretic MTP head 與其自身權重更匹配);自然文本 91.3 t/s(79%)。Heretic prefill 略低(2,718–2,931 vs 3,533–3,925)。
五、坑與注意事項
- Strata 不接受非標準 GGUF 指紋:qwen4exp builds 要求 1224 tensors;Heretic Q4_K_M 僅 882(無 in-file MTP block、PLE 表在檔內)→
strata launch --model-path與models import皆拒絕。需手動 pack:qwen4_split_gguf.py(trunk40 view,剝離 21G PLE 表)→iq_pack.py --compat-bf16→mtp_qwen4_rt.py→ 復用 expert profile →strata serve --profile。 - iq_pack 拒絕 merged tensors:必須餵 trunk40 view,而非原始 GGUF。
- run config 的 model_name 陷阱:名稱不被識別時
build_of_model_name回 None → qwen4_kind 邏輯誤判 MTP rt 目錄「file missing」→ 剝走--mtp跌回--spec 2。解法:config 不放qwen4_mtp*keys,直接將--mtp / --spec / --spec-min-p寫入 args。 - 手動
nohup engine --serve不會 bind port:engine 的 stdin 為控制通道,EOF 被當作 stop。必須經strata serve --profile管理生命週期。 - prefix cache 污染重複量測:同一 prompt 跑兩次 → TTFT 假快、prefill 假高(38,000+ t/s)。深度測試必須使用 unique prompt。
--access lan未加--no-api-key→ 自動生成 API key(LAN 探測 401)。fleet/客戶端直連必須加--no-api-key。- 20GB 顯存塞不下 Q8_0(59.4GB)——UD-Q4_K_XL(35GB)已需 tiering;MTP 接受率隨深度下降(自然文本 72–76%),甜頭主要在可預測輸出。
- THP 碎片:1M 設定下出現
0 GiB free 2 MiB blocks for 19 GiB arena——記憶體碎片拖慢 expert arena 讀取(-8~-18% 代價的成因之一)。
六、結論
20GB 小顯存卡+121GB RAM 足以運行 Qwen4-35B-A3B 的 1M 上下文:Strata 的 tiering(expert cache 5,974 slots+KV streaming 命中 90%+)讓 decode 維持 64–100 t/s、prefill 2,400–3,800 t/s。UD-Q4_K_XL + MTP 為速度角色;Heretic Q4_K_M 需手動 pack 但 MTP 接受率更高(96%)。llama.cpp 路線(ngl=30 partial offload)僅 17.5 t/s——小顯存卡上,引擎 tiering 能力比量化档本身更重要。
量測口徑:engine 0.1.74.1;128K standard-v1 + 深度 streaming 測試;fresh prompt 避免 prefix cache;顯存 19.6–19.9 GiB、GPU busy 94–100%。