Followup: Mystery Solved: 4x Spark, GLM-5.2-nfp4, 24tp/s, 128k ctx, no REAP

Follow-up: GLM-5.2 NVFP4 on four DGX Sparks — the MTP mystery is solved, and it’s now ~24 tok/s at 128K context

This is a follow-up to my earlier post about running GLM-5.2 NVFP4 on 4x DGX Spark at 128K context. Short version of that post: 128K worked at ~15 tok/s with MTP1, and there was a painful tradeoff where you could have 128K context OR ~23 tok/s (DCP1 at 32K), but not both. I also flagged that MTP2/MTP3 acceptance collapse at DCP4 “really looks buggy” but that 30 hours of digging hadn’t cracked it.

It was buggy. It’s cracked. The tradeoff is gone.

TL;DR

old post (DCP4/128K/MTP1) now (DCP4/128K/MTP3) now (DCP4/128K/MTP4)
decode, short codegen (hot) 14.5-15.2 tok/s 22-23 tok/s 23.7-24.2 tok/s
MTP acceptance per position 0.74 (MTP1 only) 0.90 / 0.79 / 0.67 0.91 / 0.81 / 0.69 / 0.58
context 131,072 131,072 131,072 (same 132,096-token KV fit)
hardware 4x GB10 Spark + MikroTik RoCE unchanged unchanged

Edit: prefill still ~475 tps; bs=3 decode =~48 tps.

Yes, MTP4 — the recursively-reused single MTP layer is still conditionally accepting at ~0.84 by position 4, which mirrors what I see on my RTX 6000 Pro box where MTP4 is also the peak. One config gotcha: MAX_CUDAGRAPH_CAPTURE_SIZE needs headroom above num_speculative_tokens + 1 (the draft derives a smaller cap than the target; exactly N+1 fails startup with “No valid cudagraph sizes”). I run 10 for MTP4. I’ve seen occasional runs sag when host paging churns — MTP3 is my conservative default, MTP4 the peak config.

Same machines, same switch, same checkpoint, same 1.81 GB/rank KV budget. The entire gain is one missing line of configuration plumbing in vLLM, plus rebasing onto a newer upstream branch. The DCP1/32K compromise config is now pointless: DCP4 at full context beats it outright.

What the bug actually was

In my original post I wrote that acceptance looked like 0.9, 0.75^4, 0.6^4 and guessed at some rank-intersection effect. The exponent intuition was pointing at something real (the damage does scale with DCP world size), but the mechanism was better-hidden than that — and the reason it survived 30+ hours of ablations is genuinely evil:

SpeculativeConfig.create_draft_parallel_config() builds the draft model’s parallel config by copying fields from the target config — and decode_context_parallel_size is not one of the fields it copies. It silently defaults to 1. On the code path my stack uses, that value is consumed verbatim.

So under TP4/DCP4, the MTP draft layer’s KV cache, metadata, and sparse-indexer state were all DCP-sharded (the writer side runs under the target config), while the draft’s attention thought it wasn’t under DCP at all: no query all-gather, no LSE merge, and the global top-k indices were consumed as if the local quarter-cache were the whole cache. Tensor dumps showed draft forwards where three of four ranks selected nothing and emitted literal all-zero attention for their 48 of 64 heads.

Here’s the evil part: the very next op after attention is o_proj, which is row-parallel — its TP all-reduce sums the four inconsistent per-rank results into one hidden state that is bit-identical on every rank. Every cross-rank divergence check I ran in the original investigation came back clean, because the corruption is laundered into consensus one op after it happens. And because the draft gets the target’s hidden state as input, single-step MTP1 mostly survives on that signal (~0.75 acceptance), while the recursive steps 2-3 compound the garbage and die. That’s the collapse curve from my first post.

It also explains why the bug shrugged off every knob: KV interleave size, ag_rs vs a2a DCP comm backend, global vs rank-local top-k, CUDA graphs vs eager — none of them touch how the draft’s parallel config is constructed. I tested all of them (identical acceptance curves to two decimal places) before giving up on config space and building a tensor tap instead.

How it got found

Method notes:

  1. Rebased the stack onto a much newer upstream branch (see below). Capacity reproduced exactly; MTP3 still collapsed. That killed “it’s fixed upstream” and “it’s my old fork.”
  2. Burned four more boots falsifying the remaining config hypotheses (interleave/comm-backend/top-k-mode/eager). All identical. At that point the bug had to be in the compute, not the config surface.
  3. Wrote a small env-gated tap into the MLA decode path that dumps, per draft-layer forward: the post-allgather query, the top-k indices actually consumed, per-rank partial output + LSE, the merged output, the metadata, and the raw fp8 KV pages.
  4. Calibrated the tap at DCP1: an fp64 reference attention over the dequantized fp8_ds_mla cache reproduced the kernel’s outputs at cosine ≥ 0.9999 on every forward. So the instrument was trustworthy.
  5. Ran the same probe at DCP4 and read the dumps: impl.dcp_world_size == 1 on every rank, merged output byte-identical to the pre-merge partial (i.e., no merge ever ran), DCP-local sequence lengths (6/6/5/5 for a global 22) feeding a non-DCP attention, zero-output ranks. From there the config trace back to create_draft_parallel_config took about twenty minutes.

The fix is ~10 lines mirroring logic that upstream already has on their newer runner path (which is why big SM120 rigs never saw this — they run the code path that has the fix; my stack runs the one that doesn’t). PR with the fix, three companion patches for GLM-routed checkpoints, and the full evidence is up as a draft:

The updated recipe

Everything is in the same repo as before, same recipe directory:

  • github.com/m9e/blackwell-llm-docker → recipes/4x-spark-cluster/glm52-b12x-spark/
  • New production entry point: start-glm52-production.sh (DCP4 / MTP3 / 128K, diagnostics off)
  • The image is now built from a much newer upstream base (local-inference-lab/vllm eldritch line, June 29 + b12x) with a 5-file overlay on top: the Spark Ray-startup fix and post-load malloc_trim from the original post, plus the DCP draft fixes. Build scripts in the recipe dir.
  • ELDRITCH_REBASE_NOTES.md in the recipe dir has the whole investigation written up — every falsified hypothesis with numbers, the dump evidence, and the memory ledger.
  • One embarrassing find worth flagging if you followed the original post: the NCCL channel narrowing (NCCL_MAX/MIN_NCHANNELS=4, pinned NCCL_IB_HCA) that I described as part of the memory win had never actually made it into the committed launch scripts — it was applied by hand during the original campaign. It’s committed now. If you cloned the recipe before, you were running default channel counts and leaving memory on the table. (You could NOT afford that memory)

Everything else from the original post still applies: the aggressive OS/Ray pruning, host networking, fp8_ds_mla KV, the hybrid checkpoint assembly script (you still need the real model.layers.78.* MTP layer), and IB/RDMA on over the Spark fabric. The hardware section is unchanged down to the switch.

What I’d revise from the original post:

  • “MTP2/MTP3 are research territory” → wrong, they were just broken. MTP3 is the production default now.
  • “This setup has exactly one MTP layer, so MTP1 is the clean production point” → the one-layer recursion works fine once the draft can actually see the context it’s drafting from. Position-3 acceptance is 0.67, which for a recursively-reused single-step head is honestly better than I expected.
  • The 409/512 prefill oscillation from the original post: still there, still unexplained, still doesn’t matter much.

Open threads

  • A clean long-context decode measurement on the fixed stack (my first depth probe ran during host paging churn and isn’t fair to report; the old MTP1 baseline was ~13 tok/s post-TTFT at 32K-112K, and acceptance doesn’t decay much with depth, so I expect high teens — will follow up in comments with a clean number).
  • A b12x-MoE-for-the-draft A/B and a DCP2 retest on the fixed stack, mostly for the config matrix’s sake.
  • The fp8_ds_mla quality question from the original post still deserves its own writeup.

And to be clear, if you went deep on sparks, this is good stuff: every number in this post is the full 256-expert checkpoint at 131,072 context. You don’t have to prune this model to make four Sparks fast anymore.

If you have Sparks and were sitting on the 15 tok/s config: rebuild from the recipe, or wait for the PR to land upstream and rebuild from theirs. Four Sparks now run a 744B-class model at 128K context at ~24 tok/s, and the only thing that changed since last week is that the speculative decoder is no longer being fed a shredded view of its own cache.

incredible find

Great work! Do you think there’s any chance we could have a larger context window?

Hey Matt I’m super close to getting this running dropped context to 98k because we couldn’t get the 128k working without OOM. This is what my Agent said and maybe you can send me a reply back to get this fixed

From Agent - Hey — huge thanks for the “mystery solved” writeup + the glm52-b12x-spark recipe. I’ve reproduced almost all of it on 4× GB10 DGX Sparks and I’m ~1-2 GB of unified memory short of your 128K result, so I wanted to ask what I’m missing.

Setup: your MTP3 128K profile (glm52-spark4-dcp4-mtp3-128k.env) — GMU 0.89, --kv-cache-memory-bytes 1.81e9, fp8 KV, DCP4 ag_rs, seqs 1, cudagraph-cap 4, VLLM_DCP_SHARD_DRAFT=1 + KZ_TRIM. Weights load fine, but at KV profiling I hit NVRM NV_ERR_NO_MEMORY (unified-mem OOM). Your logs show 128K fitting with ~2.7 GB free (106.93 weights + 1.81 KV + 0.64 graph in a 112.11 pool); I tip over right at that step.

I think the gap is the image base. I couldn’t reproduce glm-eldritch-b12x:20260702-arm64-spark4 exactly — it’s FROM your 20260701 base via spark-vllm-docker/build-and-copy.sh (not in the public repo), on local-inference-lab/vllm @ 2226f261 (head66 branch) + voipmonitor/b12x @ 9cd63a72, and the 6 overlay files are whole-file copies from your private vllm-eldritch tree. My closest reconstruction is on the older eldritch-final base (fcc6141 / 0.11.2.dev) + hand-ported overlays — and that base seems to carry a bigger resident footprint, which is exactly the ~1-2 GB I’m over.

Three questions if you have a minute:

1. Is the head66 base (2226f261) itself the memory win vs eldritch-final, or is there a separate env/knob that reclaims the last ~1-2 GB?

2. Any chance you could share (or point me to) overlay files 2-5 — the gpu_worker KZ_TRIM hook, the DCP topk_scores buffers, the build_for_drafting fixup — plus your exact build-and-copy invocation, so I can rebuild your base 1:1?

3. Could you share your per-rank memory breakdown at 128K serving (weights / KV / cudagraph / free)? That’d show me exactly where my extra 1-2 GB is going.

Running your 98K fallback in the meantime and it’s happy. Appreciate anything you can share — incredible work getting the full no-REAP model up at 128K on these boxes.

You can’t get a longer context window unless you:

  1. prune experts
  2. quantize kv more (absolutely insanely bad idea)
  3. quantize more aggressively (will pay in pain)

If you were REALLY hungry for context you could do a very, very light prune (say 256->248) in a REAP but I just don’t recommend that unless you know the workload and can prune accordingly. 128k to me was good enough.

Tony - glad you have it working! I’ve appreciated some of your posts so happy to contribute.

It is, of course, incredibly tight. I was watching paging carefully to make sure no live memory swaps happened during inference (although of course if it happened non-incidentally you’d see it in the numbers)

Nice repro work — you’re closer than you think. Answers in order, then the two things I’d bet your missing 1-2 GB is actually hiding in. Here’s an agent response from my side to help:

1) Is the head66 base the memory win? Partly. eldritch-final (0.11.2.dev/fcc6141) is an older, fatter line; I built from local-inference-lab/vllm @ 2226f261 (codex/eldritch-head66-dspark-tp4-native-20260629) + voipmonitor/b12x @ 9cd63a72, and I’d rebase before chasing anything else. But the base alone isn’t 1-2 GB — the knobs below matter more.

2) All the files are public now, nothing is private anymore:

  • m9e/vllm branch spark4-overlay = the exact six overlay files as commits on top of 2226f261: the draft-DCP config fix + the three glm4_moe enablers (same content as local-inference-lab/vllm PR #72), plus the two Spark-specific ones you’re missing — the gpu_worker VLLM_KZ_TRIM_AFTER_LOAD hook and the VLLM_DISABLE_TP_MQ_BROADCASTER gate. Whole files, no hand-porting needed.

  • Overlay build script is committed in the recipe dir (build-glm52-eldritch-overlay-image.sh).

  • Base build invocation, verbatim:

    ./build-and-copy.sh -t glm-eldritch-b12x:20260701-arm64 --gpu-arch 12.1a -j 8 \
      --vllm-repo https://github.com/local-inference-lab/vllm.git \
      --vllm-ref codex/eldritch-head66-dspark-tp4-native-20260629 \
      --vllm-commit 2226f261e9a6befef7a344997fb3b6769baa3bf7 \
      --b12x-repo https://github.com/voipmonitor/b12x.git \
      --b12x-ref 9cd63a726e9b188701f3dff0e6b95d7814c42fc5 \
      --b12x-commit 9cd63a726e9b188701f3dff0e6b95d7814c42fc5
    

3) Per-rank at 128K serving on my boxes: ~121.7 GiB unified pool visible per rank; ~106.9 GiB weights after load; 1.81 GB explicit KV; ~0.5-0.6 GB cudagraphs; ~2.5-2.7 GB free at steady state. Your quoted shape is right.

Where I’d bet your 1-2 GB is:

  • The trim hook isn’t firing. This is the big one on unified memory. After weight load and before profiling you should see VLLM_KZ_TRIM_AFTER_LOAD completed host=... malloc_trim=1 on every rank (it’s in the Ray worker logs, not just the API log). Two failure modes: the hand-ported hook isn’t in the code path your build actually runs, or the env var never reaches the Ray worker containers — it has to be in the docker run -e list of the ray containers (see launch-ray.sh), not just the serve environment. Without it, profiling sees the loader’s dirty allocator state and you’re 1-2 GB over. Your NVRM OOM at exactly the profiling step is this bug’s signature.
  • NCCL narrowing. If you cloned the recipe before commit fc63720, your launch-ray.sh doesn’t have NCCL_IB_HCA pinned + NCCL_MAX_NCHANNELS=4 / NCCL_MIN_NCHANNELS=4 — that was embarrassingly only applied by hand on my cluster until this week (it’s flagged in the follow-up post). Default channel counts cost real memory per rank on this fabric. Pull latest.
  • Sanity items: MAX_NUM_BATCHED_TOKENS=1024 (profiling peak scales with it — don’t raise it), swap drained + caches dropped right before launch (swapoff -a && swapon -a; echo 3 > drop_caches — the launcher does the latter), vm.swappiness=1, the OS prune actually applied on all four nodes (GUI/gnome bits off, snapd/fwupd/etc masked), Ray started with the slim flags, and nothing else resident on the head node — my own head node carries dev tooling and it cost me ~0.4 GB of guard headroom until I evicted it.

Do those in order — trim hook first — and I’d expect 128K to fit with room to spare. And once you’re up: pull latest anyway, the current default profile is MTP4 with MAX_NUM_SEQS=4 (24 tok/s solo, ~40 tok/s aggregate at 4 concurrent, same 132,096-token fit). Report back — happy to compare KV-profiling logs if it still tips over.


I’ll add beyond what it said, don’t miss the general memory trimming. I brutally cut every random thing: cupsd, avahi, etc. Don’t leave old codex/claude sessoins hanging around, etc. The NCCL narrowing I assume you have but it is critical; I was SHOCKED at home much the default NCCL channels were costing.

Thank you so much Matt, going to get this up now will report back soon. I spent ALL DAY restarting the Sparks because of OOOM Fable couldn’t get this working.

Still cannot get this ■■■■ to load man. OOM everytime. I can get it to abou 50% then it dies, where is your memory sitting at while it loads ? I sit at about 115gb then it will randomly just shoot up and OOM.

Here’s nvidia-smi while running:

Sat Jul  4 03:17:13 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.159.03             Driver Version: 580.159.03     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GB10                    On  |   0000000F:01:00.0 Off |                  N/A |
| N/A   48C    P0             11W /  N/A  | Not Supported          |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A          269331      C   ray::RayWorkerProc.run                11259... |
+-----------------------------------------------------------------------------------------+

meminfo

matt@relic:~$ head -30 /proc/meminfo
MemTotal:       127600748 kB
MemFree:         1467208 kB
MemAvailable:    1470424 kB
Buffers:          164096 kB
Cached:          1859896 kB
SwapCached:      1044736 kB
Active:          2530224 kB
Inactive:        2165040 kB
Active(anon):    1884416 kB
Inactive(anon):  1552016 kB
Active(file):     645808 kB
Inactive(file):   613024 kB
Unevictable:       22736 kB
Mlocked:           22736 kB
SwapTotal:      16777212 kB
SwapFree:       11578964 kB
Zswap:                 0 kB
Zswapped:              0 kB
Dirty:              2248 kB
Writeback:             0 kB
AnonPages:       2666164 kB
Mapped:          1008420 kB
Shmem:            761232 kB
KReclaimable:     321648 kB
Slab:            2854904 kB
SReclaimable:     321648 kB
SUnreclaim:      2533256 kB
KernelStack:       25616 kB
ShadowCallStack:    6476 kB
PageTables:        52248 kB

hopefully helpful!

Try to reproduce this but hanging at above 4k prefill on 8x cluster…

Ok Matt this is where Codex is at lol

Matt, quick update and a few questions. We reproduced your GLM-5.2 NVFP4 hybrid on 4x Spark as closely as we can:

  • Image rebuilt from local-inference-lab/vllm @ 2226f261 + b12x @ 9cd63a
  • spark4 overlay present: KZ trim hook, TP MQ broadcaster gate, PR #72 files
  • CUTLASS pinned/importing
  • model hybrid verified, layer 78 MTP tensors present
  • fabric fixed on all 4 nodes: 192.168.192.1/2/3/4
  • Ray worker env verified inside containers:
    VLLM_KZ_TRIM_AFTER_LOAD=1
    NCCL_IB_HCA=rocep1s0f0
    NCCL_MAX_NCHANNELS=4
    NCCL_MIN_NCHANNELS=4
    VLLM_DCP_GLOBAL_TOPK=1
    VLLM_DCP_SHARD_DRAFT=1
    VLLM_DISABLE_TP_MQ_BROADCASTER=1
  • MTP4 profile:
    max_model_len=131072
    max_num_seqs=4
    max_num_batched_tokens=1024
    kv_cache_memory_bytes=1810000000
    kv_cache_dtype=fp8
    num_speculative_tokens=4

The auto/safetensors path gets to about 23/46 shards, then one worker drops with NVIDIA driver NV_ERR_NO_MEMORY before VLLM_KZ_TRIM_AFTER_LOAD ever fires. So this is pre-trim load pressure, not KV/cudagraph/profile.

We also tried a RunAI streamer image:

  • installed runai-model-streamer 0.16.0
  • launched with load_format=runai_streamer
  • passed model_loader_extra_config:
    {“distributed”:true,“concurrency”:1,“memory_limit”:1903165440}
  • confirmed vLLM received the config

That did NOT OOM by config, but it was worse in practice: it started “Loading safetensors using Runai Model Streamer” and by only ~1% tensor progress, nodes collapsed to sub-300MB available and then went unresponsive.

Questions:

  1. On your successful 128K MTP4 run, were you definitely using load_format=auto/hf, or fastsafetensors/runai/something else?
  2. During weight load, before KZ trim, how low did MemAvailable get per rank?
  3. Did you ever see NV_ERR_NO_MEMORY during shard load before the trim hook?
  4. Are you using any loader envs we are missing, like SAFETENSORS_FAST_GPU behavior, fastsafetensors queue size, allocator knobs, or a patched safetensors/loader path?
  5. Does your KZ trim hook fire only after all weights load, or did you patch any earlier trim/GC during shard load?
  6. Any chance your working image avoids the pre-trim memory peak with a loader patch that is not obvious in the public recipe?

Our current best diagnosis: the model can’t survive the pre-trim weight load peak on our boxes. The actual serving profile may fit after trim, but we never reach trim.

GLM-5.2 (unpruned Int4-Int8Mix not NVFP4) serving 640K context on 4× DGX Spark — DCP4 + MTP3,
decode flat to 524K

I ported this public vLLM branch
(local-inference-lab/vllm @e232d26 + voipmonitor/b12x @9cd63a7) onto the unpruned
QuantTrio GLM-5.2-Int4-Int8Mix
(full 256 experts, compressed-tensors w4a16/w8a16) on
4× GB10 over 100G RoCE. TP4 + DCP4 (KV sharded 4-way) + MTP k=3, B12X_MLA_SPARSE,
fp8_ds_mla, 0.90 gmu.

Headline: 655,360-token context window, single boot, no pruning — KV pool 730K
tokens at ~9 GiB/rank (fp8_ds_mla 54.7 KB/tok ÷ 4).

llama-benchy (coherent corpus, pp2048/tg1000, runs 2)

test t/s peak t/s
pp2048 442.08
tg1000 21.63 33.00
tg1000 @ d32768 20.57 31.50
tg1000 @ d131072 22.47 30.00
tg1000 @ d245760 24.94 31.00
tg1000 @ d524288 21.72 29.00

Decode is FLAT from 0 to 524K tokens of context (coherence PASSED at every depth —
that’s half a million tokens on an unpruned model). MTP acceptance stays healthy under
DCP: per-position 0.88/0.66/0.49, ~0.90 overall on a 5-domain greedy corpus.

The context-vs-prefill dial (same stack, one flag)

config ctx pp2048 sustained tg
no DCP 143K ~716 25.5
DCP2 320K ~610 25.3
DCP4 655K ~442 23.6

Prefill cost is ~linear in DCP degree (it’s the per-layer LSE all-gather +
reduce-scatter, confirmed by py-spy). DCP2 is a sweet spot: crown-class decode at 2.5×
the context (DCP2-320k, 610 prefill, 25.3tps).

proof complete — coherence PASSED, decode held to the very edge of the 655k
window:

model test t/s peak t/s ttfr (ms)
glm-5.2 pp2048 437.67 ± 0.00 3897.68 ± 0.00
glm-5.2 tg1000 21.16 ± 0.00 33.00 ± 0.00
glm-5.2 pp2048 @ d131072 431.05 ± 0.00 273768.94 ± 0.00
glm-5.2 tg1000 @ d131072 22.25 ± 0.00 29.00 ± 0.00
glm-5.2 pp2048 @ d262144 423.62 ± 0.00 552847.00 ± 0.00
glm-5.2 tg1000 @ d262144 25.71 ± 0.00 31.00 ± 0.00
glm-5.2 pp2048 @ d524288 407.72 ± 0.00 1144640.03 ± 0.00
glm-5.2 tg1000 @ d524288 21.75 ± 0.00 31.00 ± 0.00
glm-5.2 pp2048 @ d638976 400.23 ± 0.00 1419759.84 ± 0.00
glm-5.2 tg1000 @ d638976 19.56 ± 0.00 32.00 ± 0.00

19.6-25.7 t/s decode (peaks 29-33) from zero to
638,976 tokens of context — flat — prefill only sagging 438→400 (−9%) across the entire range, coherent at every depth.
Best single number: 25.7 t/s at 262k depth. TTFT at the 639k edge is 23.7 min

Awesome results, can you share the dockerfile and serve comand, please? I had issues with the voip dcp enabled image, it stopped working over 4k context, maybe I was missing somerhing. Thank you!

No Dockerfile needed — I don’t rebuild anything. The fork’s delta vs upstream vLLM is
pure Python, so we overlay its changed files onto a stock vLLM image
(0.23.1rc1.dev-era, aarch64/CUDA13) and pip-install the b12x fork. That’s it.

First: your “breaks past 4k” — if you’re running AWQ/GPTQ (any int quant), it’s
likely this one-line vLLM bug.
4096 = the default chunk size; past it, the chunked-prefill
context path casts activations to the marlin weight dtype (int32) → garbage from chunk
2 onward. NVFP4 is unaffected (uint8 is excluded), which is why the fork’s author never
saw it. Fix in model_executor/layers/attention/mla_attention.py (~line 2120):

# before:
) and _kv_b_proj_w_dtype != torch.uint8:
# after:
) and _kv_b_proj_w_dtype not in (torch.uint8, torch.int32):

Test: temp-0 prompt at 8-10k tokens. Sentences = fixed, gibberish = something else
(then tell me your quant + log).

Setup:

git clone https://github.com/local-inference-lab/vllm
cd vllm && git checkout codex/dcp-globaltopk-sharddraft-defaults-20260622
# copy its changed vllm/*.py over your site-packages (pure-python delta)
git clone https://github.com/voipmonitor/b12x && cd b12x && git checkout 9cd63a72
pip install --no-deps --force-reinstall .   # PyPI b12x is missing the sparse-MLA
kernels

Env (every node):

export CUTE_DSL_ARCH=sm_121a   # NOT sm_120a on GB10 (error 209)
export VLLM_USE_V2_MODEL_RUNNER=1 VLLM_USE_B12X_SPARSE_INDEXER=1 VLLM_DCP_SHARD_DRAFT=1
export NCCL_MAX_NCHANNELS=4 NCCL_MIN_NCHANNELS=4 CUDA_DEVICE_MAX_CONNECTIONS=32
export TORCH_CUDA_ARCH_LIST=12.1a VLLM_ALLOW_LONG_MAX_MODEL_LEN=1
sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'   # before every boot

Serve (our standing 640K config, 4× GB10 TP4+DCP4, unpruned Int4-Int8Mix):

The serve command is a working reference, not gospel. Load-bearing (needed):
–attention-backend B12X_MLA_SPARSE, --decode-context-parallel-size 4 + ag_rs, the mtp
speculative-config, --kv-cache-dtype fp8_ds_mla, and V2-runner/shard-draft envs. The
rest (kv-bytes, max-model-len, gmu, batching) is sizing you adapt to your own
boxes.

vllm serve /models/GLM-5.2-Int4-Int8Mix \
  --quantization compressed-tensors \
  --tensor-parallel-size 4 --decode-context-parallel-size 4 --dcp-comm-backend ag_rs \
  --attention-backend B12X_MLA_SPARSE \
  --speculative-config '{"method":"mtp","num_speculative_tokens":3}' \
  --kv-cache-dtype fp8_ds_mla --kv-cache-memory-bytes 9000000000 \
  --max-model-len 655360 --max-num-batched-tokens 4096 --max-num-seqs 4 \
  --compilation-config '{"cudagraph_mode":"FULL_AND_PIECEWISE","custom_ops":["all"]}' \
  --max-cudagraph-capture-size 32 --async-scheduling --long-prefill-token-threshold
2048 \
  --gpu-memory-utilization 0.88 \
  --hf-overrides '{"index_topk_pattern":"FFFSSSFSSSFSSSFSSSFSSSFSSSFSSSFSSSFSSSFSSSFSSS
FSSSFSSSFSSSFSSSFSSSFSSSFSSSFSSS"}'

Expect GPU KV cache size: 657,664 tokens at boot. Sanity: temp-0 coherent at 2k AND
10k; /metrics per-position acceptance ~0.85/0.6/0.45 (0.3/0.07 collapse = draft not
sharding); decode flat with depth (we get 20-25 t/s from 0 to 639K).

Notes: k=4 loses (pos-4 accept 0.26); a2a is ~5% worse than ag_rs; DCP2 = ~610 pp/320K
ctx if you want prefill over context. Compressed-tensors quants need 2 extra small
draft-loading fixes — ask if relevant

Thank you!

Since you mentioned it, would you be so kind as to share this too? This is great research and helpful for pushing GLM 5.2 deploys forward.

From FABLE - @davedgd @Zatz — chased this one down on our end (unpruned QuantTrio Int4-Int8Mix, DCP4 + MTP3 on 4× DGX Spark) and hit the exact KeyError: model.layers.78.mtp_block.self_attn.kv_a_proj_with_mqa.weight_packed. Here’s what it was, in case it’s one of the two Zatz mentioned:

The MTP draft layer builds its quant config via get_draft_quant_config(), which hands back a fresh CompressedTensorsConfig with an empty packed_modules_mapping. The target model (DeepseekV2ForCausalLM) registers fused_qkv_a_proj → [q_a_proj, kv_a_proj_with_mqa], but the draft never gets that mapping — so compressed-tensors can’t match the fused module, silently builds it unquantized (.weight instead of .weight_packed), and load_weights then KeyErrors looking for the packed tensor.

Fix is to register the same fused mappings on the draft config. In deepseek_mtp.py, right after the quant_config = _maybe_disable_unserialized_modelopt_fp4_nextn(...) line:

if quant_config is not None and hasattr(quant_config, "packed_modules_mapping"):

quant_config.packed_modules_mapping.setdefault("gate_up_proj", ["gate_proj", "up_proj"])

if getattr(config, "q_lora_rank", None) is not None:

quant_config.packed_modules_mapping.setdefault(

"fused_qkv_a_proj", ["q_a_proj", "kv_a_proj_with_mqa"]

)

Boots clean after that — 655K + MTP3, acceptance ~3.0 (per-position ~0.88/0.66/0.49, matching your numbers). Huge thanks @Zatz for the DCP recipe + the int32 chunked-prefill fix — that got us 90% of the way. Full write-up + patches here if useful: GitHub - tonyd2wild/GLM-5.2-655K-MTP-4x-DGX-Spark · GitHub GitHub - tonyd2wild/GLM-5.2-655K-MTP-4x-DGX-Spark · GitHub

Curious if this matches your second fix or if there’s another one lurking 👀

Yep - that’s my fix #2 (the packed_modules_mapping one), nice confirmation. And turns
out there ISN’T another one lurking.. I went back and verified my “fix 1” with a
meta-device draft build: the mapping fix alone builds every draft linear packed - the
entries fix 1 touches are inert for compressed-tensors. So one fix, not two - your
version is complete. Like the q_lora_rank guard too.

Took the indexer block-table +1 from you in return - I’d only ever tested 2 concurrent
so never hit it. Applied and just validated 4-concurrent clean on my cluster, thanks!

One heads-up on your repo: the patch regex is single-line-only and the cdiv( call is
split across lines in this tree, so as shipped it exits “anchor not found” - anchor on
the multi-line text and it’ll work for others like it did for you by hand.

I will pass this along, do you have a REPO ? I am always about making sure you get full credit if you got one link it here or DM me so I can add it to mine