Qwen3.8-Flash-Next IQ3_S + MTP on 1x RTX 4090 — llama.cpp + tandem.cpp MoE expert cache (ewhacc)
00 upvotes — sign in to vote sign in to votecommunity Community submission — verify on your own hardware.
recipe by ewhacc - recipe, patch set and measurements↗, llama.cpp / ggml (MIT)↗, MoE expert-split rule adapted from Strata (Niko1221)↗ · listed by localai-recipes
revision r6 · commit 552ae04e39 · updated 46 h ago · license MIT
chat patch-set cuda single-gpu moe moe-offload gsm8k mtp long-context speculative-decoding expert-cache
MoE expert-cache offload for llama.cpp via tandem.cpp v0.5.2: hot experts stay in a GPU cache, missed experts split between CPU compute and uploads, sized from measured CPU and PCIe speeds; single-user decode is the target. Since v0.5.0 VRAM victims copy back to RAM on a second stream under LLAMA_MOE_ARENA_EARLY=1 / LLAMA_MOE_ARENA_EARLY_EV=1 (both default-on: behaviour moved vs the v0.4.0-era recipe, no flag change), and the CPU/upload split self-tunes and persists to ~/.cache/tandem/share-tune.tsv (delete it or set LLAMA_MOE_SHARE_TUNE=0 to chase a published number). RTX 4090 24 GB rows, one separate profile: IQ3_S+MTP 97.3 greedy / 96.1 sampled (3.3x vs llama.cpp); gpt-oss-120b 51.5/48.0 - author's 2026-11-02 numbers carried through the v0.4.0 pin (decode unchanged), not superseded, pre-dating v0.5.x. v0.5.x also measures it on a 16 GB card (RTX 5070 Ti + 64 GB): 76-77 tok/s over three fresh v0.5.2 runs - a DIFFERENT profile, labeled card numbers in the perf notes, not points rows.
Launch command
'LLAMA_MTP_DRAFT_VOCAB=100000 llama-server -m models/IQ3_S/Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf -ngl 99 -cmoe --moe-cache-mib auto -lm none -np 1 -c 16384 --spec-type draft-mtp -md models/qwen38-mtp-outq4_K-expsq4_K.gguf --spec-draft-n-max 3 --spec-draft-sampling probabilistic -bs -ot '\''^token_embd\.weight=CUDA0'\''' '# Build: bash build.sh (clones llama.cpp @ f5222f25c, applies tandem.patch, cmake -DGGML_CUDA=ON, target llama-server)' '# Weights: hf download ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUF --include '\''IQ3_S/*'\'' --local-dir models; hf download ewhacc/qwen38-mtp-outq4_K-expsq4_K --include '\''*.gguf'\'' --local-dir models' '# -cmoe keeps every expert in host RAM; --moe-cache-mib auto gives leftover GPU memory (after model, KV, compute buffers) minus --moe-cache-margin-mib (default 512 on CUDA / 1024 on ROCm; draft size added) to the expert cache; -lm none reads weights into RAM instead of mmap; -np 1 -c 16384 pins ONE conversation at 16k context (default 4 slots share one small ctx)' '# Less RAM than the model (78 GiB IQ3_S on 64 GB): drop -lm none (mapped file, experts pinned when RAM holds model + 10 GiB). Much less RAM (16 GB): also --cache-ram 0 (prompt cache otherwise evicts experts from page cache)' '# v0.5.x defaults changed behaviour under you: LLAMA_MOE_ARENA_EARLY=1 and LLAMA_MOE_ARENA_EARLY_EV=1 are ON since v0.5.0 (store mode copies VRAM victims back to RAM on a second stream, ordered by GPU events); the CPU/upload split self-tunes and persists per model/GPU/RAM/threads to ~/.cache/tandem/share-tune.tsv since v0.5.1 (LLAMA_MOE_SHARE_TUNE=0 turns it off, LLAMA_MOE_TUNE_FILE=0 disables the file); LLAMA_MOE_STREAM=1 layer-streams long prompts since v0.4.0. No flag change is needed - the same command runs, but arena and tuner behaviour differ from the v0.4.0-era description.'Use this recipe with your agent
Paste this into any agent chat — it fetches and applies the recipe:
Fetch https://localairecipes.com/api/v1/recipes/qwen3-8-flash-next-iq3-s-mtp-on-1x-rtx-4090-llama-cpp-tandem-cpp.json and apply the inference recipe it describes (engine flags, model, quant, context) to my setup. Ask before overwriting any existing config.Or fetch it directly:
curl -fsSL https://localairecipes.com/api/v1/recipes/qwen3-8-flash-next-iq3-s-mtp-on-1x-rtx-4090-llama-cpp-tandem-cpp.jsonDownloads
- Weights https://huggingface.co/ISTA-DASLab/Qwen3.8-Flash-Next-GSQ-RCO-GGUFIQ3_S 78 GiB two-file GGUF @ HF revision ed59f92082b1e93c0e96d60a8b11aab089b52f09 (measured weights)
- Drafter https://huggingface.co/ewhacc/qwen38-mtp-outq4_K-expsq4_KQ4_K MTP head @ HF revision 848c5ad85766f4a212587df40f73ebcbee58de89; Qwen Community License 1.0
- Reference https://github.com/ewhacc/tandem.cpp8d077f9fac33cc5f5646c56115d956fb260e4090 (tandem.patch v0.5.2, build.sh, BASE_COMMIT, bench scripts)
- Reference https://github.com/ggml-org/llama.cppf5222f25c (2026-10-28, BASE_COMMIT) - patched llama.cpp base
Revision notes
Ingested 2026-11-02 from repo b03b0014674576b685d9641f01da1bbccf2d5afc (HEAD verified via git ls-remote; initial commit 60b7b0b dated 2026-11-02, repo <24h old at sweep time, 6 stars, no tags/releases). Patch set over llama.cpp f5222f25c (2026-10-28) recorded in BASE_COMMIT; base commit verified live on GitHub ('cuda: fuse MoE (MUL_MAT_ID) gate/up and GLU in MMQ (#31188)'). Launch argv and flag semantics transcribed verbatim from README at the pinned sha; --moe-cache-mib 'auto' and --moe-cache-margin-mib confirmed in tandem.patch common/arg.cpp; -cmoe, -lm, -np, --spec-type are upstream llama.cpp base flags (patch context). Also surfaced on Reddit r/LocalLLaMA post 1xldent (same author, same numbers, folded into this card). EVIDENCE TIER: claimed - author-self-measured on one consumer box; the Strata comparison row is the author's own; nothing reproduced on-box or by a third party. HF revisions ed59f920/848c5ad8 captured by the scout sweep 2026-11-02. corrections_to_card: thin card t_fac98175 said IQ3_S+MTP vs llama.cpp 29.8 - matches README; twin card claimed no rtx-4090 hardware profile (0 rows) - FALSE: live hardware_profiles id 300 slug rtx-4090 (nvidia, 24GB, device_count 1, generation ada, card_family rtx-4090) + id 301 rtx-4090-x2 exist on preprod DB; the audit checked recipe usage, not the profile table. Twin's scout-format submission JSON (engine.source_type 'git', base_version, hardware object, performance array) re-shaped to the live submission envelope: source_type fork, base pin moved to version+install_note, perf re-keyed to points. | PIN RECONCILE 2026-11-03: repo HEAD moved b03b001467 -> e1acb8877b (2 commits, 9451efd6 and e1acb8877, both 'update readme'), delta = README.md only (+2/-4). Author RETRACTED the '; 7x slower in the author's 12 GB test' claim on the --cache-ram flag bullet and DELETED the 'Little RAM ... 56.9 tok/s vs Strata 34.1' paragraph; expanded the oversized-model known-issue bullet to 'about level with llama.cpp for Qwen3.8 IQ3_S on a 32 GB PC with a 16 GB card (16.5 against 15.8 tok/s), slower in the consumer-PC DeepSeek row'. No code change: tandem.patch/build.sh/BASE_COMMIT (llama.cpp f5222f25c) byte-identical across the two shas, so no launch-arg/engine delta and no revalidation needed. AUTO-APPLIED r3: /config/launch[4] retracted claim removed; the deleted 12 GB table was never transcribed into this recipe. Pin bumped to e1acb8877b (engine.pinned_commit + artifacts[2]).
| TANDEM REBASE 2026-11-28 @ 8d077f9 (t_47121871, owner GO; replaces the superseded v0.4.0-era TANDEM PIN paragraph): 8 commits pin..HEAD, BASE_COMMIT f5222f25c byte-identical, no re-peel; HF pins ed59f920/848c5ad8 re-verified at write; tandem.patch recount 15010 insertions over 46 files. v0.5.0: early copy-back default-on (LLAMA_MOE_ARENA_EARLY=1, LLAMA_MOE_ARENA_EARLY_EV=1 - store mode copies VRAM victims back to RAM on a second stream, ordered by GPU events) and SSD-backed layer streaming. v0.5.1: self-tuning CPU/upload split persisted per model/GPU/RAM/threads to ~/.cache/tandem/share-tune.tsv. v0.5.2: same share setting every fresh start. BEHAVIOUR MOVED UNDER THE READER: both arena knobs default-on since v0.5.0 - a v0.5.2 build differs from the v0.4.0-era description with no flag change. PERF RE-DATED, NOT REPLACED: 97.3/96.1 (gpt-oss 51.5/48.0) stay the RTX 4090 24 GB b03b001467 rows on a separate hardware profile (different card, not a contradiction); the v0.5.x 16 GB figures (RTX 5070 Ti + 64 GB, 16 GB-card numbers detailed in summary + metrics.notes) are labeled text there, NOT points rows. SHARE-TUNE CAVEAT: the tuned split persists to ~/.cache/tandem/share-tune.tsv and is reused - reproducibility reduced, not zero; delete the file or set LLAMA_MOE_SHARE_TUNE=0 for a from-rule run. launch[3] re-dated (margin default 512 on CUDA / 1024 on ROCm confirmed in the patch @ 8d077f9); launch[5] knob summary added. Perf points carried unchanged (claimed tier).
Revision history
- ab68ce1019 recipe: sync 20 from preprod (wave 15 — 7 NEW: maya strix-halo x2, iq2xs strata 170hx, inkling-2-mini dspark, crucible strix-halo, wombat tep4 monitoring, hibana fast-vision; 13 revision bumps: morrowmake-9slg engine train + radiance train + hyperflare-20261116 + tandem v0.4.0 + theogravity diffbot + g4bwy rebase + asgard n6p + others — owner go 2026-11-19, sync 2026-11-21) 13 d ago diff
- 300f519273 recipe: update qwen3-8-flash-next-iq3-s-mtp-on-1x-rtx-4090-llama-cpp-tandem-cpp (r4: /engine, /provenance/notes, /artifacts/2, /config/launch) 29 d ago diff
- e08c4335ab recipe: update qwen3-8-flash-next-iq3-s-mtp-on-1x-rtx-4090-llama-cpp-tandem-cpp (r3: /engine, /artifacts, /provenance/notes) 29 d ago diff
- e7172979ab remove stray hardware profile line to match preprod bytes 32 d ago diff
- 211b530d94 recipe: create qwen3-8-flash-next-iq3-s-mtp-on-1x-rtx-4090-llama-cpp-tandem-cpp 32 d ago
Fork
Sign in to fork this recipe — a fork is your own copy; you own it and only you can update it.