qwen3.8-Flash-DGX README

项目的 README,来自 github.com/blazux/qwen3.8-Flash-DGX。合并为一个 markdown 文件:README.md。

Qwen3.8-Flash-Next on DGX Spark

Run Qwen3.8-Flash-Next on one NVIDIA DGX Spark or ASUS GX10 with vLLM 0.33. The default profile, mtp-fast, serves the NVIDIA hybrid checkpoint at up to 500k tokens. Optional profiles support 1M tokens. The image reads the large PLE embedding table from NVMe via mmap to leave memory for the KV cache.

Quickstart

You need a GB10 system with 128 GB of unified memory, Docker with the NVIDIA runtime, and roughly 140 GB of free disk for the weights plus 13 GB for the hybrid layout. Use NVMe for the weight cache.

git clone https://github.com/blazux/qwen3.8-Flash-DGX.git
cd qwen3.8-Flash-DGX
./flash doctor
./flash setup
./flash serve
./flash wait
./flash test

setup builds the image, downloads the weights and prepares the hybrid layout. The download is resumable. Startup loads roughly 75 GiB of weights and typically takes a few minutes.

The OpenAI-compatible API defaults to http://localhost:18300/v1 with the model name qwen3.8-flash-next.

curl http://localhost:18300/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"qwen3.8-flash-next","messages":[{"role":"user","content":"Explain prefix caching in two sentences."}],"max_tokens":512}'

The server listens on all interfaces without authentication by default. On a shared network, use an authenticated gateway or set vLLM's --api-key. See API connection and TLS.

Choose a profile

What you need Profile
General serving up to 500k tokens default / mtp-fast
Faster greedy and sampled solo decode near 1M dflash-1m
More shared KV capacity at 1M mtp4-1m
Shorter interruptions to active streams during long prefills shared
Previous MTP2 recipe, with reduced draft vocabulary mtp-standard
Opt-in prefix-cache checkpoint workaround at native 262k context prefix-cache-safe
./flash profiles
./flash setup dflash-1m
./flash serve dflash-1m

Profiles share port 18300 by default. ./flash serve recreates the named container. Use NAME and PORT to select a separate instance if the host has enough memory. Environment variables override the profile, and KEY=VALUE arguments override both.

vLLM v0.33 upgrade

mtp-fast is the default profile on vLLM 0.33. Running ./flash serve, ./flash serve default, or ./flash serve mtp-fast selects the same recipe. It uses an NVFP4 copy of the MTP proposal head, three speculative tokens, a 16k prefill batch, BF16 recurrent state, a 13 GiB FP8 KV cache, and a 500k context limit.

GX10 workload vLLM 0.32 MTP3 vLLM 0.33 mtp-fast Change
Cold prefill at 8k 3,153 tok/s 3,516 tok/s +11.5%
Cold prefill at 32k 3,182 tok/s 3,459 tok/s +8.7%
Cold prefill at 100k 3,120 tok/s 3,392 tok/s +8.7%
Sampled decode, one request 35.1 tok/s 42.6 tok/s +21.3%
Sampled decode, eight concurrent requests 111.6 tok/s 128.3 tok/s +15.0%

These measurements used the same NVIDIA hybrid checkpoint on one GB10. The profile passed tool calling, Responses, vision and retrieval checks at 263k and 499k tokens. The larger prefill batch uses more memory. Use ./flash serve BATCH_TOKENS=8192 to reduce the batch budget, or ./flash serve mtp-standard for the previous MTP2 recipe on vLLM 0.33. See the port notes and workload measurements.

After updating the checkout, run ./flash setup, then ./flash serve to recreate the container. Existing prepared hybrid checkpoints can be reused.

Choosing a 1M-context profile

Choose dflash-1m for faster single-stream generation, especially greedy decoding. Choose mtp4-1m when KV capacity matters more, for example when other requests share the server with a long prompt. For workloads within 500k context, start with mtp-fast, the default profile.

GX10 workload mtp4-1m dflash-1m DFlash change
KV capacity 1.52M tokens 1.11M tokens −27%
Cold prefill, 8k 3,132 tok/s 2,751 tok/s −12%
Cold prefill, 512k 2,722 tok/s 2,779 tok/s +2%
Cold prefill, 900k 2,385 tok/s 2,438 tok/s +2%
Greedy decode, one request 36.6 tok/s 46.4 tok/s +27%
Sampled decode, one request, T=0.7 37.0 tok/s 40.2 tok/s +9%
Sampled throughput, eight requests, T=0.7 109.8 tok/s 112.2 tok/s +2%

Both profiles passed retrieval at 990k tokens and a follow-up generation. The matched run used vLLM 0.33, the NVIDIA hybrid checkpoint and 21 GiB of fixed FP8 KV on one GX10. Prefill rates are medians of two cold runs per size, so the small differences at 512k and 900k are indicative. Capacity refers to the shared KV pool. The per-request limit is 1M tokens. PR #66

The flash command

Command Purpose
./flash doctor [profile] Check the host, image, checkpoint and profile prerequisites
./flash setup [profile] Build the image and prepare the selected checkpoint and drafter
./flash serve [profile] [KEY=VALUE…] Recreate the container using the selected recipe
./flash wait and ./flash test Wait for the API and run a smoke test
./flash status and ./flash logs Inspect the server and follow its logs
./flash stop and ./flash start Stop or restart the existing container

For low-memory starts, first check ./flash doctor and the engine log. ./flash serve BATCH_TOKENS=8192 lowers the default batch budget. With published, lower CTX if the engine reports a smaller KV ceiling.

Recent changes

Date Change
2026-11-15 Opt-in prefix-cache checkpoint workaround for vLLM 0.33. Configuration, cache-hit checks and validation limits.
2026-11-04 vLLM 0.33 and mtp-fast by default. Upgrade and measurements.
2026-11-04 1M-context profiles. dflash-1m and mtp4-1m passed retrieval at 990k. Results and profile choice.

Documentation

qwen3.8-Flash-DGX (blazux/qwen3.8-Flash-DGX)

正在搜索数据库…

这是什么?这是一份在单台 NVIDIA DGX Spark(GB10)上用 vLLM 服务约 1760 亿参数 Qwen3.8-Flash-Next 模型的方案(脚本加打过补丁的 Docker 镜像)。它要解决的问题是:126 GiB 的 NVFP4 检查点在 Spark 的 128 GB 统一内存里放不下,还要给可用的 KV 缓存留地方;做法是通过 mmap 从 NVMe 流式读取一张 48 GiB 的查找表,而不是让它常驻内存。
这是独立应用,还是叠在 vLLM 上的补丁?它不是新应用——而是一组 shell 脚本(download-weights.sh、serve.sh、prepare-hybrid.sh)和补丁,用来修改官方 vLLM Docker 镜像并以正确的标志启动;模型仍然通过 vLLM 自己的 OpenAI 兼容 API 提供服务。
怎么让它跑起来?克隆仓库,运行 scripts/download-weights.sh 拉取检查点(可选地运行 scripts/prepare-hybrid.sh 得到更快的混合布局),然后运行 scripts/serve.sh 构建并启动打过补丁的 vLLM Docker 镜像;它会以模型名 qwen3.8-flash-next 暴露一个 OpenAI 兼容 API。
尝试之前需要什么硬件和软件?一台 NVIDIA DGX Spark 或兼容的 GB10(sm121)机器,带 128 GB 统一内存、aarch64、较新的 NVIDIA 驱动、带 NVIDIA container runtime 的 Docker,以及约 140 GB 的高速磁盘(推荐 NVMe,因为查找表会在运行时从它读取)。
有什么不完善的地方需要知道?有几个 GB10 特有的 bug 必须打补丁修复(一个会悄悄破坏前缀缓存命中的 vLLM block-size bug,以及稀疏注意力里一个非确定性的 top-k kernel);另外,只要另一个客户端的提示正在预填充,某个客户端的解码就会明显停顿——那是 vLLM 的 chunked-prefill 行为,不是本仓库的 bug。
这必须要 DGX Spark 那种硬件,还是任意 NVIDIA GPU 都行?它专门针对 DGX Spark / ASUS GX10 里那颗带 128 GB 统一内存的 GB10(sm121)芯片调优;构建是多架构的,所以也能在 x86 Blackwell(sm120,如 RTX PRO 6000)上编译用于测试,但优化目标是 Spark。
什么是 MTP 投机解码,它为什么在这里重要?MTP 用一个小型起草模型提前起草额外的 token,让模型每一步能验证多个 token;在默认 MTP=2 和精简起草词表的设置下,它把单流解码从约 26 tok/s 提到约 37 tok/s,同时不改变经过验证的输出。
它实际能吃下多大的上下文?在模型原生 262k 上下文之上,通过 YaRN 缩放最高到 500k token;在推荐的 0.80 GPU 内存占比下,大约有 580k-630k token 的 KV 缓存可用。
nvfp4 和 hybrid 两种检查点模式有什么区别?MODE=nvfp4 完全按发布原样提供检查点;MODE=hybrid 通过一次性的 prepare-hybrid.sh 脚本,在 NVFP4 专家旁边换入 fp8 侧层,在实测质量相同的前提下,解码快约 20%,KV 缓存多 8%。
默认设置是怎么定下来的?scripts/serve.sh 里的每个默认值,都是在一项内部 17 场景代理锦标赛(工具循环、长上下文提取、多步推理,重复 3 次)中得分最高的设置;那些只提升速度却会丢锦标赛分数的选项,默认保持关闭。
作者
blazux
大小
1.3 MB
星标
537
更新
提交Nov 15
时长
3个月
提交 · 90 天