Downloads · 30 days
0
pocharlies/gb10-dgx-spark-llm-optimizations
gb10-dgx-spark-llm-optimizations is a machine learning model from pocharlies. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Optimized NVFP4 checkpoints and reproducible recipes for serving Qwen3.6-class and DeepSeek-V4-class models on NVIDIA GB10 (DGX Spark, sm121, 119.6 GiB unified memory) with vLLM.
Downloads · 30 days
0
Access
Public
Updated Aug 19, 2026
Repo size
—
Likes
0
Public
Click a slice to open those files.
.md28.5 KB · 58%
From the Hugging Face model README
Optimized NVFP4 checkpoints and reproducible recipes for serving Qwen3.6-class and DeepSeek-V4-class models on NVIDIA GB10 (DGX Spark, sm_121, 119.6 GiB unified memory) with vLLM.
Everything here was measured on real hardware — a 2-node GB10 cluster running production agentic workloads (tool-calling agents, coding CLIs, chat). Numbers are single-stream decode with 512 output tokens unless stated, validated against vLLM's Prometheus counters.
| Model | What it is | License |
|---|---|---|
| Ornith-1.0-35B-NVFP4-MTP-graft | Agentic-coding MoE (35B-A3B, 256 exp / 8 active) + grafted MTP head + 4-bit lm_head + fixed tool-call chat template | MIT |
| Qwen3.6-27B-uncensored-heretic-v2-NVFP4-lmheadW4 | Uncensored dense 27B with lm_head re-quantized to NVFP4 W4A16 — +47% decode | Apache-2.0 |
| context | Ornith + MTP-graft + lm_head-W4 | plain nvidia/Qwen3.6-35B-A3B-NVFP4 | Ornith before optimization |
|---|---|---|---|
| 1K | 174 tok/s | ~63 | 63.5 |
| 8K | 170 tok/s | 155 | 59.1 |
| 131K | 133 tok/s | ~88 | 27.1 |
Prefill @131K: 47.8 s (was 518 s → 10.8× faster). TTFT cached @131K: 1.9 s.
| model | decode @8K | @16K | @32K | prefill @8K |
|---|---|---|---|---|
| uncensored + lm_head-NVFP4 (ours) | 41.2 | 40.6 | 39.5 | 2155 |
nvidia/Qwen3.6-27B-NVFP4 (dense baseline) | 35.7 | 35.2 | 34.3 | 777 |
uncensored heretic-v2, BF16 lm_head | 28 | — | — | 2101 |
| uncensored AEON-Ultimate + DFlash draft | 26 | 24.5 | 22.6 | 1740 |
The optimized uncensored 27B decodes faster than the stock dense 27B — the entire gap was the lm_head.
lm_head. Community fine-tunes almost always leave it in BF16 (1–2.5 GB over a 248,320-token vocab). It is read every decode step, so on bandwidth-bound hardware it dominates. Quantizing it to 4-bit was worth +47% on the 27B and was the last piece to beat the dense model. NVIDIA's own NVFP4 checkpoints already ship it 4-bit — that is why they decode fast.
Tip: quantize the lm_head standalone (load only that tensor, ~21 GB peak) — a full-model re-quantization OOMs on GB10's unified memory (the pack step alone transiently wants 18.95 GB).config.json but publish no mtp.* tensors, silently disabling speculative decoding. Copying the 19 mtp.* tensors from an architecture-identical base restores it: ~100% acceptance at K=3, roughly 2.8× decode. Draft and verify share the target's weights, so fine-tune behaviour is preserved.fp8, never nvfp4. See hardware limits below.VLLM_NVFP4_GEMM_BACKEND=marlin, VLLM_MARLIN_USE_ATOMIC_ADD=1), --enable-prefix-caching, --enable-chunked-prefill.temperature 0 does not make tool-calling deterministic-and-safe, it causes degradation and infinite repetition loops. Use temperature 0.7, top_p 0.8, top_k 20, presence_penalty 1.5 (the penalty is the recommendation for quantized checkpoints)./tokenize, cached + uncached passes, decode/prefill separated, every run validated against vLLM's Prometheus counters, max-of-clean-runs methodology, SHA-256 recorded per result ledger. Contexts: 1K / 8K / 16K / 32K / 131K (and a 245K pass).lm_head did not break retrieval).lm_head W4 (343/370 before → within noise). Strong on chains/structured/schema discipline; weakest at NL inference of tool+args (76%).lm_head re-quant), coherence probes, upstream Heretic abliteration KL ≈ 0.0021 (minimal-damage abliteration preferred over heavier "uncensored" tunes, which measured worse on quality).mtp.* tensors in the safetensors index, lm_head precision, license, published benchmarks) to decide whether a better tooling base existed. Conclusion: none clearly better than the RL-post-trained Ornith for agentic tool use; plain re-quants of the same base are equivalent, and uncensored/roleplay/reasoning-distill variants are worse on the tooling axis.DeepSeek-V4-Flash-0731 ships text-only. Bolting on a community vision stack (FlyCockpit's DeepEncoderV2 tower + adapter, served via a vLLM plugin) works on 2× GB10 — but the wrapper class breaks speculative decoding in two ways, one of which is completely silent:
isinstance(model, SupportsEagle3) runs against the top-level class, now the
wrapper. One missing Protocol member aborts rank 1 — and in multi-node TP the traceback lands
in the worker's log while the head just says Failed core proc(s): {}.lm_head: dspark/utils.py reads it with getattr() off the top-level object. The
checkpoint sets has_own_lm_head=False, so the drafter must borrow the target's head. Without
the attribute the sharing is skipped and the drafter keeps an unloaded head: acceptance
1.2%, ~10 tok/s, zero errors anywhere.Both fixed by delegating to the backbone. Full write-up, measurements and the patch:
deepseek-v4-flash-vision-gb10.md ·
dsv4_vision_wrapper_speculative_patch.py
| KV memory | KV tokens | acceptance | mean accept len | |
|---|---|---|---|---|
| text only | 14.66 GiB | 1,258,343 | 0.5731 | 3.866 |
| with vision | 12.86 GiB | 1,119,093 | 0.551 | 3.755 |
The tower costs 1.8 GiB of KV permanently; it does not run on text-only requests
(_execute_mm_encoder early-exits). Served at 384K context, TP=2, DSpark k=5.
Unsloth's August 2026 GGUFs (Qwen3.8-27B Dynamic v3.0, DeepSeek-V4-Flash-0731 Dynamic 2.0 + a DSpark drafter GGUF) raise the obvious question: should the "lossless" UD-Q8_K_XL replace the native checkpoint served over vLLM TP=2? No — ~97% of DeepSeek-V4-Flash-0731 (all routed experts, 296.35B of 304.18B params) is natively MXFP4 and Unsloth repacks those bits identically, so Q8 has no quality headroom over the official safetensors this stack already serves; and llama.cpp's multi-node path (rpc-server, plain TCP) would give up the nvfp4_ds_mla KV pool, prefix caching, DSpark and the RoCE fabric. Where the GGUFs do win: a single-node fallback quant, and one-file mmproj vision — though for video, vLLM's native multimodal path has no llama.cpp equivalent. Full comparison with measured numbers: unsloth-gguf-vs-vllm-gb10.md
--kv-cache-dtype nvfp4 is impossible on GB10. FlashInfer requires sm100f (Blackwell datacenter); GB10 reports sm_121 and the engine aborts at startup. fp8 is the floor and the ceiling for KV on this hardware. Halving the KV pool via 4-bit KV is simply not available here.lm_head is the #1 hidden decode tax on quantized community checkpoints.mtp.* before assuming speculative decoding works — config.json declaring MTP is not evidence.isinstance() and getattr(). A wrapper that delegates the forward pass correctly can still fail those probes — and getattr-based capability sharing fails open, so the engine degrades to ~1% draft acceptance without logging anything. Assert the interfaces at build time, not at deploy time.chat_template.jinja (the conditional that strips stale <think> from history was deleted, while its last_query_index computation was left behind), verified by hashing it against the byte-identical canonical templates from Qwen/ and nvidia/. Details in the Ornith repo card.Recipes, flags and env vars are documented in each model card so they can be reproduced end-to-end. Questions and corrections are welcome via the repo discussions.