localairecipes launch configs for local inference

Qwen3.8-Flash-Next-FP8 4x CMP 170HX — PP4 MTP-4 patched vLLM (g4bwy)

00 upvotes — sign in to vote sign in to vote

community Community submission — verify on your own hardware.

recipe by g4bwy↗ · listed by localai-recipes

revision r9 · commit 0a95eb43fa · updated 44 h ago · license CC-BY-4.0

chat code speculative pipeline-parallel prefix-caching mtp-speculative long-context engram

Recipe by g4bwy. Official Qwen/Qwen3.8-Flash-Next-FP8 on 4x unlocked CMP 170HX (GA100 sm_80, 74 SMs) with PP=4 (partition 13,12,12,11) and MTP-4 speculative decoding on pinned vLLM mainline 6beda2a3ab (2026-11-27, wheel 0.34.1rc1.dev285+g6beda2a3a) plus a 9-patch series via git am (tree must equal 48be8c82fb299dd070d5ee9a78509e1b8505d3e9) that unblocks PP+MTP+PLE on sm_80. 1M context at static YaRN 4.0 with fp8 KV (QSA layers store e4m3 in uint8, decoded in-kernel on sm_80: pool doubles to 4.90M tokens, four 1M streams resident, no prefill price), int8 pipeline handoff (patch 6), 2026-11-08 defaults shipped ON (LPT=2048 prefill threshold, int8 hop), PLE n-gram table in pinned host RAM, Mamba prefix caching with retention 12928 + match-unit 16, NCCL P2P disabled (host-staged wins at PP=4), expandable_segments, 200 W caps, uv venv, no docker. W8A8 int8 arms ship OFF (rolled back 2026-10-26 for tool-call errors). Optional W8A16 int8-dense lane (checkpoint/) +15-20% single-stream.

Launch command

vllm serve Qwen/Qwen3.8-Flash-Next-FP8 --long-prefill-token-threshold 2048 --no-enable-extensible-kv-cache --served-model-name qwen3.8-flash-next-fp8 --port 8000 --gpu-memory-utilization 0.9453 --pipeline-parallel-size 4 --engram-config '{"cpu_offload": true}' --moe-backend humming --enable-prefix-caching --prefix-cache-retention-interval 12928 --block-size 1616 --prefix-match-unit 16 --kv-cache-dtype fp8 --max-model-len 1000000 --hf-overrides '{"text_config":{"max_position_embeddings":1000000,"rope_parameters":{"rope_type":"yarn","factor":4.0,"original_max_position_embeddings":262144}}}' --max-num-seqs 8 --speculative-config '{"method":"mtp","num_speculative_tokens":4}' --compilation-config '{"cudagraph_mode": "FULL_AND_PIECEWISE", "cudagraph_capture_sizes": [1, 2, 3, 4, 5, 6, 7, 8, 10, 15, 16, 20, 24, 25, 30, 32, 35, 40, 48, 56, 64, 72, 80]}' --no-enable-flashinfer-autotune --enable-auto-tool-choice --tool-call-parser qwen3_xml --reasoning-parser qwen3

runtime

env: "CUDA_VISIBLE_DEVICES=0,2,3,1 | VLLM_PP_LAYER_PARTITION=13,12,12,11 | NCCL_P2P_DISABLE=1 NCCL_IB_DISABLE=1 | PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True | VLLM_SAFETENSORS_DROP_CACHE=1 | VLLM_QWEN4EXP_PP_INT8_HOP=1 | VLLM_QWEN4EXP_DRAFT_W8A8=0 VLLM_QWEN4EXP_DENSE_W8A8=0 VLLM_QWEN4EXP_DENSE_W8A8_MIN_M=1 (verbatim from serve-4x-1m.sh @ 76b0add3; default-on knobs since 2026-11-08: LPT=2048 --long-prefill-token-threshold, HOP=1 int8 PP hop, CAPS=1 23-size lattice. HOP opt-out needs BOTH HOP=0 and VLLM_QWEN4EXP_PP_INT8_HOP=0 in the boot shell - the script's unconditional passthrough export re-arms the env otherwise; LPT=0 opts out. SPEC=mtp default; SPEC=suffix is a measurement boot the author marks not-a-promote. opt-in: RUST=1 experimental Rust frontend, PROF=1 capped torch profiler, IKD=bf16|fp8 indexer_kv_dtype; default-off knobs: CAPS=0 engine-auto cudagraph capture sizes, EXT_KV=1 extensible KV cache). | VLLM_MAMBA_CHECKPOINT_BLOCK_PIN=1 (patch 9 promoted @ 4e8e4321c4, re-certified dev1156 @ 5ef9328; BLOCKPIN=0 opts out, single-gated, no passthrough re-arm; retention 12928 legal on both grids, see runtime.notes)"
notes: "serve-4x-1m.sh is the service lane. CUDA_VISIBLE_DEVICES is 0,2,3,1 (changed from 0,1,2,3 at the 2026-10-31 pin) so rank 0 lands on the x16 card and the x4 cards take the inner stages; the partition still binds rank 0 (PLE layer at decoder index 1 costs it 0.80 GiB KV + 2.53 GiB weights) and rank 3 carries the MTP drafter. VLLM_PP_LAYER_PARTITION 13,12,12,11 is worth +2.13% pool at 1M against 12,12,12,12. NCCL P2P measured 2-3% WORSE on prefill at PP=4 (host-staged wins; TP=4 would need NCCL_P2P_LEVEL=SYS and was rejected at 1.74x pool). --kv-cache-dtype fp8 is in the shipped argv: QSA layers store e4m3 bytes in uint8 and decode them in-kernel on sm_80 (upstream #60602 + #60992), so the pool roughly doubles (2.55M -> 4.90M tokens at matched settings) and four 1M streams stay resident where a third used to evict the first; there is no prefill price. VLLM_QWEN4EXP_PP_INT8_HOP=1 is the per-token per-stream int8 pipeline handoff (patch 6 at the 308a3253c6 base) instead of the bf16 4-stream hyper-connection state: halves hop bytes on a link that is the prefill wall. 2026-11-08 same-tree A/B on dev1025 (results.md a28017f/38981ba): at 7 streams it removes the transfer stall - aggregate prefill 1.87x, TTFT 2.7x, whole-cell wall -46% WITH a ~15% per-stream steady-decode cost; at conc-4 a pure win (prefill +14%, wall -12%, decode untouched); conc-1 neutral (69.0 vs 69.1 s; the hop hides under compute). The 15% tax has a 4-to-7-stream threshold. For single-stream steady decode the author says it should stay off. Patches 7-9 add opt-in int8 for the draft head and the dense linears (+3-5% single-stream decode, -5% cold TTFT) but are shipped OFF (VLLM_QWEN4EXP_DRAFT_W8A8=0 / _DENSE_W8A8=0): they were ROLLED BACK 2026-10-26 after elevated tool-call errors on live agent traffic, and the 2026-10-23 gates never measured qwen3_xml validity. Re-enable per-arm only after a synthetic tool-call battery clears it. NOT published as a flag: --max-num-batched-tokens 9728 (fastest prefill measured on this box, 62.7 s cold 1M vs 85.5 s, but its cert battery is outstanding - the flag is documented here and deliberately not published in the argv). YaRN costs VRAM before the pool is sized: the cos/sin cache is 1 GiB per rank at factor 4.0 and comes out of the KV pool. Two failure modes point opposite ways - 'To serve at least one request with the model's max seq len (1000000)' means the pool is too small (raise --gpu-memory-utilization or use 768k), while repeating OOM retries during inference mean transient peaks have nowhere to go (lower --gpu-memory-utilization or drop --speculative-config). 0.9453 is the corrected value: since base 183625d4f9 the memory profiler budgets CUDA graph memory before sizing the pool, and 0.9453 restores the effective pool the old 0.94 had. A Mamba align-mode preemption still replays its whole prompt (~2 min): watch the preempt column, not only capacity. Startup checks: 'Using max model len 1000000' twice (target + Qwen4ExpMTP draft) and 'Maximum concurrency for 1000000 tokens per request' >= 1.0; proof line 'MTP drafter scores a 40000-token draft vocabulary' when checkpoint/ artifacts are present. Cudagraph lattice: --compilation-config is ONE JSON carrying mode plus the 23-size MTP-4 capture lattice (under MTP-4 useful decode rows are multiples of 5, reqs x (1+4); the engine auto list misses 15/25/30/35 and pads a 5-request step to 32 rows, +28% dead work); ON by default, CAPS=0 opts back out to the auto list. Never pass a dotted -cc.field alongside it - the dotted form REPLACES the whole compilation-config JSON regardless of argv order (parser precedence test 2026-11-03; verify knobs against the RESOLVED config dump in the boot log, not the process args). --no-enable-extensible-kv-cache is shipped on by default (probe verdict 2026-11-03: extensible KV VMM page mapping cost ~10% of decode on this lane); EXT_KV=1 opts back in for measurement only. --engram-config is {\"cpu_offload\": true} (host_file_gather pair retired for upstream #59958 disk_offload). Update @ 76b0add3 (2026-11-08 wave): series rebased 28dd9c36b5 -> 308a3253c6 via the interim 4527515cd7 rebase (2026-11-04); humming-kernels[cu13] now 0.1.19; chain delta byte-identical per the author (wt-pristine-1107), and git am was re-verified clean at this base by the ingest itself (9/9 patches, post-am tree exact). LPT=2048 --long-prefill-token-threshold adopted as a serve default the same day (ITL pair results.md ead2c01/76b0add: decode crawl during a concurrent prefill 2795 -> 1244 ms mean; the cost lands only in simultaneous cold-prefill storms - leader first-token 70.5 -> 234.2 s (+164 s), cell wall +12%; single-stream and staggered arrivals untouched by design). The HOP gate the script documents has a trap: an unconditional export line sets VLLM_QWEN4EXP_PP_INT8_HOP=${VAR:-1} BEFORE the gate, so HOP=0 alone does not opt out and a pre-set env is re-armed to 1 by the gate; only setting BOTH HOP=0 and VLLM_QWEN4EXP_PP_INT8_HOP=0 in the boot shell turns the hop off. SPEC gate added at HEAD (SPEC=suffix swaps MTP-4 for suffix decoding at the same K=4 for an apples-to-apples acceptance A/B) - a measurement boot the author marks NOT a promote; the recipe ships SPEC=mtp and publishes no suffix lane. Perf points remain the pre-rebase figures carried forward; the 2026-11-08 rows are ITL/hop/TTFT probes on dev781/dev1025, not the perf grid. UPDATE @ 4e8e4321c4 (2026-11-20, r7): patch 9 (0009-block-pin-3232) promoted after a single-variable A/B (results.md logs/smoke-dev978A/B, same tree both boots): grown-turn recompute 1330->15 tokens at 20k and 6140->2944 at 64k, pool 4,858,695->5,340,298 (5.34x), n7 sust 857 = lane best, cold median 207.1/acc 4.84. Recipe ships the promoted state: VLLM_MAMBA_CHECKPOINT_BLOCK_PIN=1 (serve gate default-ON, BLOCKPIN=0 opts out - audited single-gated @ serve L173-175, no passthrough re-arm) + retention 12928 (4x3232; the un-pinned #65186 checkpoint grid LCMs the mamba page floor to 6464 in align mode - 12928 legal on both grids). Author attribution kept: the 2026-11-19 pool loss was block-tail geometry, NOT graph-memory accounting; a flag's risk class is defined by OUR serve flags (#65186 looked neutral on upstream defaults while this lane runs --mamba-cache-mode align). UPDATE @ 5ef9328 (2026-11-23, r8): serve drops --mamba-cache-mode align - the flag was removed upstream (9a4930a797, #63830) and passing it would fail to parse; align semantics now equal enable_prefix_caching, which our argv keeps setting. The BLOCKPIN gate SURVIVES default-ON verbatim (serve-4x-1m.sh L174-176 @ 5ef9328: BLOCKPIN!=0 arms VLLM_MAMBA_CHECKPOINT_BLOCK_PIN=1) - the flag removal did NOT break the gate. Retention 12928 is legal on BOTH grids: pin armed => scheduler block 3232 (4x3232); pin opted out => the #65186 checkpoint grid LCMs the mamba page floor to 6464 (2x6464). dev1156 cert (0ef7bb7, 2026-11-23): pin survives the cross-stage resolver, pool holds 5,340,298 (5.34x), n7 lane bests (sust 880, in-rate 14,149), grown-turn mean 1479->~697 halved."

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-fp8-4x-cmp-170hx-pp4-mtp-4-patched-vllm-g4bwy.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-fp8-4x-cmp-170hx-pp4-mtp-4-patched-vllm-g4bwy.json

Engine

Install note: Clone vllm, checkout 6beda2a3aba2a03c52eba24f5385fbbebbe77577 (2026-11-27, wheel 0.34.1rc1.dev285+g6beda2a3a), git am --keep-non-patch patches/00*.patch (9 patches, re-touched for dev285); git rev-parse 'HEAD^{tree}' must print 48be8c82fb299dd070d5ee9a78509e1b8505d3e9. uv venv --python 3.12; VLLM_USE_PRECOMPILED=1 VLLM_PRECOMPILED_WHEEL_COMMIT=6beda2a3aba2a03c52eba24f5385fbbebbe77577 VLLM_PRECOMPILED_WHEEL_VARIANT=cu132 uv pip install -e . --torch-backend=auto. Per-commit wheels >= 2026-11-10 publish only cu132 variant paths; nightly/cu130 FROZEN at dev156 (setup.py has no root-variant fallback; %2B encodes + in wheel URLs). Patches are pure Python (no rebuild on re-am). The base pins humming-kernels[cu13] to 0.1.19. Patch 9 carries the mamba checkpoint-grid fix - apply the series as-is, no manual patch 8. serve drops --mamba-cache-mode (flag removed upstream 9a4930a797 #63830; align semantics == enable_prefix_caching). History: r8 base ef687f6179 (dev1147) superseded.

Model

Context

  • max context: 1,000,000 tokens

Performance

Speed by context

ContextConc.PrefillDecodeTTFT
262,14419181 tok/s181.5 tok/s21300 msreported
262,1444—548 tok/s56300 msreported
524,288110038 tok/s184.4 tok/s43700 msreported
1,000,000110138 tok/s183.2 tok/s91900 msreported
1,000,0002—340 tok/s140100 msreported
1,000,0004—325 tok/s239500 msreported

prefill = prompt processing · decode = generation. All decode/prefill figures are shown as reported.

reported

notesclaimed_by=submitter T0 - no run file ingested; import via POST /api/v1/benchmarks to upgrade. All values are g4bwy's own measurements on the 4x CMP 170HX box (200 W caps, 74 SMs, partition 13,12,12,11, draft-vocab head, decode 1024, repetition-task prompts; restored-silicon grid 2026-10-07 + rebase certification 2026-10-13 at base 183625d4f9, benchmark/results.md @ dcd5ba4). The pre-rebase figures below are the LAST grid measured at the certified 9-patch/308a3253c6 base (bf16-KV era, old device order 0,1,2,3) and are carried forward deliberately under CERT PROTOCOL v2.1 (2026-11-13): a re-measure would collide on these (context_len, concurrency) keys rather than add a comparable row. At the dev498/dev506 trees (e72e9cb18b4253e2c36de... + 8 patches, tree cc820822) the author certified dev164 under cold-cert protocol v2 (2026-11-12) and dev506 under v2.1 (2026-11-14) - all gates green, KV pool 5,340,298 IDENTICAL to dev164 despite the KV-spec rewrite, 0 errors; cold median-of-3 fresh-salt reads sust 190/204/204 (median 204 tok/s) and acceptance 4.12/4.88/4.66 (median 4.66) against the carried 1M row 183.2 tok/s / acc 3.85. 2026-11-20 @ 4e8e4321c4 (dev970 base, 9 patches, tree 0ffcebbf): author cert dev979 v2.1 cold median-of-3 sust 206.9 (204-208), acceptance 4.817, MATCH 100x3, pool 5,340,298 (5.34x), n7 @660k sust 783-857; grown-turn A/B (patch 9) 1330->15 tokens @20k. Points remain the pre-rebase carried grid under CERT PROTOCOL v2.1 - these cert rows are the author's own boots, not re-measurements of these cells. 2026-11-23 @ 5ef9328 (dev1147 base ef687f6179, 9 patches, tree 060534be): author cert dev1156 (boot dev1156+g80eae44bc, results.md 2026-11-23) - pin survives the cross-stage resolver, pool HOLDS 5,340,298 (5.34x), cold median-of-3 sust 207.5 / acc 4.848 / MATCH 100x3, n7 @660k sust 880 + in-rate 14,149 lane bests, n7 TTFT 267/316 s, grown-turn mean 1479->~697 halved. Points are NOT re-measured (170HX soak under standing test hold): the pre-date carried grid stands, these are the author's own boots.

Downloads

Revision notes

Community ingest of g4bwy's recipe repo, now @ 01dfaf14 (2026-10-31). Launch argv transcribed verbatim from serve-4x-1m.sh @ 01dfaf14; env exports are part of the script.

UPDATE 2026-10-31 (160 commits from dcd5ba4; series to 11 patches / 90 files, new base 5c1eb11cb3 tree 3cd817fa, patches adopted as commits so they survive rebases): CUDA_VISIBLE_DEVICES 0,1,2,3 -> 0,2,3,1; --kv-cache-dtype fp8 added to the shipped argv; int8 knobs and LPT/IKD passthroughs appeared; engram host_file_gather flags later retired for upstream #59958 disk_offload. The W8A8 pair ships OFF (rolled back 2026-10-26 for tool-call errors; mechanics in config.runtime.notes). The vocab-truncated MTP draft head engages only when checkpoint/ artifacts exist. The int8-dense W8A16 lane (checkpoint/) reads 216-226 tok/s (+15-20% over official FP8 at depth 4) with a 7.3% machine non-reproducibility floor measured and stated. Cards run the amoghmunikote/cmpunlocker module (SM + 64 GB HBM2e + Gen2 + BAR1; PCIe Gen2 mixed x16/x4, ~2 GB/s per pair, NODE); MTP acceptance 4.75-4.9 at depth 4 on pinned salt.

UPDATE 2026-11-06 @ ffd1c78f (19 commits from 01dfaf14; serve-4x-1m.sh launch-lane drift, owner-approved preprod rev 4): --compilation-config consolidated to ONE JSON carrying cudagraph_mode FULL_AND_PIECEWISE plus the 23-size MTP-4 lattice capture list (see --compilation-config), ON by default (CAPS=0 opts out to the engine auto list); the dotted -cc.cudagraph_mode flag is gone (dotted -cc.field replaces the whole JSON - it had silently wiped the sizes).

UPDATE 2026-11-14 @ 0b4971bd (owner-approved preprod r6): series rebased TWICE - 2659051 (11-11) -> 4e3463c874 / wheel dev156: 9->8 patches (rope fix #58094 retired upstream as 083fbac021), tree d9280af4; 3d4cca0 (11-14) -> e72e9cb18b4253e2c36de... / dev498 cu132: tree cc820822, patch files rewritten across the hops, count stayed 8. serve-4x-1m.sh untouched pin->HEAD: argv/env verbatim. Base/wheel/variant switch + dev164 (v2, 11-12) / dev506 (v2.1, 11-14) cert rows in engine install_note and performance notes.

UPDATE 2026-11-27 @ 5ef9328 (owner-approved preprod r8, ENGINE atomic move): series rebased onto ef687f6179 (dev1147, 2026-11-22; wheel 0.34.0rc1.dev1147+gef687f617 cu132 probe 200), 9-patch am-replay 9/9 post-am tree 060534be EXACT (patch 9 renamed 0009-Bugfix-KV-Cache-Decline-a-Mamba-checkpoint-grid, fixture adapted to #63830). serve DROPS --mamba-cache-mode align - flag removed upstream 9a4930a797 (#63830), align semantics == enable_prefix_caching (kept in argv); config.launch loses both tokens. The BLOCKPIN gate survives default-ON (serve L174-176 @ 5ef9328); dev1156 cert (0ef7bb7): pin survives cross-stage resolver, pool holds 5,340,298 (5.34x), n7 lane bests, grown-turn mean halved; boot gates add group-sizes 3232 literal. Perf points NOT re-measured (170HX soak under standing test hold) - carried pre-date grid, dev1156 numbers cited from benchmark/results.md as author boots. Notes trims for the 4000 cap: r7 trim-log meta sentence, duplicated carried-forward disclaimer, upstream-refusal motivation (summary covers it), stale r4/r5 rebase paragraphs, superseded r7 rebase/wheel sentences.

UPDATE 2026-11-28 @ 83d73cb (owner-approved preprod r9, ENGINE atomic move): re-peel onto 6beda2a3ab (dev285, 2026-11-27; wheel 0.34.1rc1.dev285+g6beda2a3a cu132 probe 200), all nine patches re-touched, post-am tree 48be8c82 EXACT, serve.sh untouched - argv byte-identical (BLOCKPIN=1, retention 12928). dev294 cert (dev294+g4fa0e6ac7): pin+pool hold 5,340,298 (5.34x), n7 TTFT 264/305 restored, n7 in-rate 14.69k lane best, QSA CAN-REANCHOR, accept_window race fix 3d7972d. Perf points NOT re-measured (soak hold) - dev294 figures cited from benchmark/results.md. Trims: superseded r7 PATCH-8 note paragraph (header+content), r8 retention-grid sentence.

Revision history

Fork

Sign in to fork this recipe — a fork is your own copy; you own it and only you can update it.

Export

recipe.yaml (raw)