跳到主内容
@wquguru
精选88MarkTechPost(RSS)技巧与观点

NVIDIA展示DGX Spark上Ling-3.0-flash推理加速三件套

NVIDIA Shows 3 Ways to Speed Up MoE Inference on DGX Spark, Lifting Ling-3.0-flash Throughput 42.5%

原文
发到 X
推荐理由

针对MoE模型推理优化的硬核工程实践,给出了具体的内核替换、量化策略与投机解码配置细节,开发者可直接参考复现。

NVIDIA’s latest technical blog shows how to speed up mixture-of-experts (MoE) inference on one DGX Spark. The test model is Ant Group inclusionAI’s Ling-3.0-flash, a 124B-parameter MoE with 5.1B active parameters. NVIDIA stacked three optimizations: a new MoE kernel backend, an FP8 output layer and built-in speculative decoding. On all 1,319 GSM8K questions, decode throughput rose 42.5% with no statistically detectable accuracy change.

NVIDIA 的最新技术博客展示了如何在单台 DGX Spark 上加速混合专家(MoE)推理。测试模型是蚂蚁集团 inclusionAI 的 Ling-3.0-flash,这是一个拥有 124B 参数、5.1B 激活参数的 MoE 模型。NVIDIA 堆叠了三项优化:新的 MoE 内核后端、FP8 输出层以及内置推测解码。在全部 1,319 道 GSM8K 问题上,解码吞吐量提升了 42.5%,且未检测到统计显著的精度变化。

So why is it relevant for Devs? DGX Spark is a desktop system, not a data center node. NVIDIA’s results show a 124B MoE serving single-user requests faster on that desk-side box. The technical post also shows where MoE decode time goes, and how to cut it.

那么,这对开发者为何相关?DGX Spark 是一款桌面系统,而非数据中心节点。NVIDIA 的结果表明,在该桌面设备上,124B MoE 能以更快的速度服务单用户请求。该技术文章还展示了 MoE 解码时间的去向以及如何削减它。

TL;DR

  • Size: Ling-3.0-flash-fp4: 124B total, 5.1B active per token; 256K native context.
  • Runs on: One NVIDIA DGX Spark (GB10, 128 GB unified memory, 273 GB/s), batch size one.
  • Performance: Three stacked optimizations lift GSM8K decode throughput from 37.81 to 53.89 tokens/s.
  • Best: +42.5% throughput and -24.5% mean latency, with accuracy flat (96.89% vs 96.82%).
  • Lagging: Synthetic gains (+185.1%) shrink on GSM8K as MTP acceptance drops from 3.90 to 2.68.
  • 规模:Ling-3.0-flash-fp4:总计 124B,每 token 激活 5.1B;原生上下文长度 256K。
  • 运行环境:一台 NVIDIA DGX Spark(GB10,128 GB 统一内存,273 GB/s),批处理大小为 1。
  • 性能:三项堆叠优化将 GSM8K 解码吞吐量从 37.81 提升至 53.89 tokens/s。
  • 最佳表现:吞吐量提升 +42.5%,平均延迟降低 -24.5%,精度持平(96.89% vs 96.82%)。
  • 滞后表现:合成数据上的收益(+185.1%)在 GSM8K 上缩水,因为 MTP 接受率从 3.90 降至 2.68。

Why is MoE decoding on DGX Spark memory-bound?

为什么 DGX Spark 上的 MoE 解码受内存限制?

DGX Spark is NVIDIA’s desktop system built on the GB10 Grace Blackwell Superchip. It offers 128 GB of unified memory and 273 GB/s of memory bandwidth. Peak compute is up to 1 petaFLOP of sparse FP4. NVIDIA rates it for inference on models up to 200B parameters.

DGX Spark 是 NVIDIA 基于 GB10 Grace Blackwell Superchip 构建的桌面系统。它提供 128 GB 统一内存和 273 GB/s 的内存带宽。峰值计算能力高达 1 petaFLOP 稀疏 FP4。NVIDIA 将其定位为支持最高 200B 参数模型的推理设备。

In the NVIDIA technical post, the NVIDIA team profiled Ling-3.0-flash-fp4 at batch size 1. Decoding was memory-bound: reading model weights drove execution time. Two operations stood out, the MoE computation and the LM head that scores the vocabulary. That points to two levers: move fewer bytes per decode step, and generate more tokens per verification round.

在 NVIDIA 的技术文章中,NVIDIA 团队对 batch size 为 1 的 Ling-3.0-flash-fp4 进行了分析。解码过程受内存限制:读取模型权重主导了执行时间。两项操作尤为突出,即 MoE 计算和用于评分词表的 LM head。这指向了两个杠杆点:减少每次解码步骤传输的字节数,以及在每次验证轮次中生成更多 token。

The baseline followed the official W4A8 recipe. It used FlashInfer MXFP4 MoE kernels, CUTLASS dense GEMM and an FP32 LM-head path. On a synthetic 32K-input, 2K-output test, it ran at 27.71 ms per token (36.09 tokens per second).

基线遵循官方 W4A8 配方。它使用了 FlashInfer MXFP4 MoE 内核、CUTLASS 密集 GEMM 以及 FP32 LM-head 路径。在包含 32K 输入和 2K 输出的合成测试中,其每个 token 耗时 27.71 ms(每秒 36.09 个 token)。

What are the 3 optimizations?

那三项优化是什么?

1. Humming MXFP4 MoE kernels: NVIDIA swapped FlashInfer’s MoE backend for Humming, an independent kernel library. Humming uses NVRTC to compile kernels at runtime for the actual matrix shapes, data types and GPU. That includes the narrow 768-wide expert layer. Each kernel compiles in seconds. The FlashInfer CUTLASS path compiles 97 targets with ninja, on the order of tens of minutes. Throughput rose 9.3% to 39.45 tokens per second.

1. Humming MXFP4 MoE 内核:NVIDIA 将 FlashInfer 的 MoE 后端替换为 Humming,这是一个独立的内核库。Humming 使用 NVRTC 针对实际的矩阵形状、数据类型和 GPU 在运行时编译内核。这包括窄小的 768 宽专家层。每个内核只需几秒即可完成编译。FlashInfer 的 CUTLASS 路径使用 ninja 编译 97 个目标,耗时数十分钟。吞吐量提升了 9.3%,达到每秒 39.45 个 token。

2. Online FP8 LM head: The LM head is a 157,184 x 2,560 matrix stored in BF16. Every generated token reads all of it. Quantizing only this layer to FP8 at load time halves those reads. Setting SGLANG_ENABLE_FP8_LM_HEAD=1 enables it. It cannot be combined with the baseline –enable-fp32-lm-head option. Combined with Humming, throughput reached 43.94 tokens per second. That is 21.7% over baseline and 11.4% over Humming alone.

2. 在线 FP8 LM 头:LM 头是一个存储为 BF16 的 157,184 x 2,560 矩阵。每个生成的 token 都会读取该矩阵的全部内容。仅在加载时将这一层量化为 FP8,可将读取次数减半。设置 SGLANG_ENABLE_FP8_LM_HEAD=1 即可启用此功能。它不能与基线 –enable-fp32-lm-head 选项结合使用。结合 Humming 后,吞吐量达到每秒 43.94 个 token。这比基线高出 21.7%,比单独使用 Humming 高出 11.4%。

3. MTP speculative decoding with NEXTN: Ling-3.0-flash ships with a built-in NEXTN prediction layer, so no extra draft model is needed. It drafts three tokens, and the model verifies four positions at once. Verification costs about 2.26x a normal decode step. The main cost is MoE, not attention. Verifying four tokens can activate up to 32 experts instead of 8. On the synthetic test, an average of 3.90 tokens were accepted per round. Throughput jumped to 102.88 tokens per second, up 185.1%.

3. 使用 NEXTN 的多步推测解码(MTP):Ling-3.0-flash 内置了 NEXTN 预测层,因此无需额外的草稿模型。它生成三个 token 的草稿,模型一次性验证四个位置。验证成本约为正常解码步骤的 2.26 倍。主要开销来自 MoE,而非注意力机制。验证四个 token 最多可激活 32 个专家,而不是 8 个。在合成测试中,平均每轮接受 3.90 个 token。吞吐量跃升至每秒 102.88 个 token,增幅达 185.1%。

The three techniques do not overlap. Humming and the FP8 LM head cut the cost of each step. MTP cuts the number of steps.

这三种技术互不重叠。Humming 和 FP8 LM 头降低了每一步的成本,而 MTP 减少了步骤数量。

The integration trap: Stacking these is not automatic. With FP8 LM head and MTP both on, the draft must share the full LM-head module. Otherwise the framework silently falls back, and the draft interprets FP8 weights as BF16. Accept length drops to 1.00, and throughput falls below the unoptimized baseline. The NVIDIA team advises checking at startup that each optimization is active. NVIDIA points to the Ling cookbook notebook for enabling both together.

集成陷阱:叠加这些优化并非自动完成。当同时启用 FP8 LM 头和 MTP 时,草稿模型必须共享完整的 LM 头模块。否则,框架会静默回退,导致草稿模型将 FP8 权重误读为 BF16。接受长度降至 1.00,吞吐量低于未优化的基线水平。NVIDIA 团队建议在启动时检查每项优化是否已激活。NVIDIA 指出,Ling cookbook 笔记本提供了同时启用这两项功能的指南。

What happens on a real workload?

在实际负载下会发生什么?

Synthetic tests flatter speculative decoding, so the NVIDIA team also ran all 1,319 GSM8K questions. It used 5-shot prompting with chain-of-thought, temperature 0.6, top_p 0.95 and top_k 29. With all three optimizations, time per output token fell from 26.45 ms to 18.56 ms. Decode throughput rose 42.5%, from 37.81 to 53.89 tokens per second. Mean latency dropped 24.5%, from 15.21 to 11.49 seconds. Accuracy moved from 96.89% to 96.82%, a change NVIDIA calls statistically undetectable.

合成测试往往高估推测解码的效果,因此 NVIDIA 团队还运行了全部 1,319 道 GSM8K 题目。测试采用 5-shot 提示并配合思维链(chain-of-thought),温度设为 0.6,top_p 为 0.95,top_k 为 29。在启用所有三项优化后,每个输出 token 的处理时间从 26.45 毫秒降至 18.56 毫秒。解码吞吐量提升了 42.5%,从每秒 37.81 个 token 增至 53.89 个 token。平均延迟下降了 24.5%,从 15.21 秒降至 11.49 秒。准确率从 96.89% 变为 96.82%,NVIDIA 称这一变化在统计上不可检测。

Accept length here was 2.68, versus 3.90 on synthetic data. The NVIDIA team gives three reasons for the gap. Synthetic outputs are more repetitive, so drafts are accepted more often. The synthetic test used greedy decoding, while GSM8K used sampling. GSM8K answers are also short, with a median near 310 tokens versus a fixed 2K.

此处接受的长度为 2.68,而合成数据为 3.90。NVIDIA 团队给出了差距的三个原因:合成输出更具重复性,因此草稿被接受的频率更高;合成测试使用了贪婪解码(greedy decoding),而 GSM8K 使用了采样(sampling)。GSM8K 的答案也较短,中位数约为 310 个 token,而固定值为 2K。

What is Ling 3.0, and why does it suit DGX Spark?

什么是 Ling 3.0,它为何适合 DGX Spark?

Ling-3.0-flash belongs to Ant Group inclusionAI’s Ling 3.0 family, released under the MIT license. The open-weight lineup also includes Ling-3.0-tiny, a 7.9B MoE with 1.3B active parameters. Both come with base checkpoints and FP8, INT4 and GGUF builds; flash also has FP4. OpenRouter also lists inclusionAI’s vision-language, finance and health variants built on Ling 3.0 Flash.

Ling-3.0-flash 属于蚂蚁集团 inclusionAI 的 Ling 3.0 系列,以 MIT 许可证发布。开源权重阵容还包括 Ling-3.0-tiny,这是一个拥有 13 亿活跃参数的 79 亿参数 MoE 模型。两者均提供基础检查点以及 FP8、INT4 和 GGUF 构建版本;flash 版本还包含 FP4。OpenRouter 还列出了基于 Ling 3.0 Flash 构建的 inclusionAI 视觉语言、金融和健康变体。

Ling-3.0-flash is built to keep per-token cost low:

Ling-3.0-flash 旨在保持每个 token 的成本低廉:

  • Sparse MoE: Each MoE layer routes a token to 8 of 512 routed experts, along with 1 shared expert. About 4.1% of the weights are active per token.
  • Hybrid linear attention: 35 Kimi Delta Attention (KDA) layers and 7 Gated MLA layers alternate 5:1. KDA, from Moonshot AI’s Kimi Linear paper, keeps a fixed-size state instead of a growing KV cache. The layout is native from the start of pretraining.
  • Built-in MTP: The model was trained with multi-token prediction. That NEXTN layer is the draft model NVIDIA used.
  • Agent focus: inclusionAI team reports 10,000+ interactive training environments for coding, general and deep-research agents. NVIDIA notes the native 256K context expands to 1M tokens.
  • 稀疏 MoE:每个 MoE 层将 token 路由到 512 个专家中的 8 个,加上 1 个共享专家。每个 token 约有 4.1% 的权重处于激活状态。
  • 混合线性注意力:35 层 Kimi Delta Attention (KDA) 和 7 层 Gated MLA 层以 5:1 交替排列。KDA 源自月之暗面(Moonshot AI)的 Kimi Linear 论文,它保持固定大小的状态,而不是不断增长的 KV 缓存。该布局从预训练开始就是原生的。
  • 内置 MTP:模型采用多 token 预测(multi-token prediction)进行训练。那个 NEXTN 层正是 NVIDIA 使用的草稿模型。
  • Agent 聚焦:inclusionAI 团队报告称拥有超过 10,000 个用于编码、通用和深度研究 Agent 的交互式训练环境。NVIDIA 指出原生 256K 上下文可扩展至 1M tokens。

How strong and efficient is Ling-3.0-flash?

Ling-3.0-flash 的性能和效率如何?

On its model card, inclusionAI reports 56.6 on SWE-Bench Pro and 72.4 on SWE-Bench Multilingual. It also reports 93.2 on MathArena AIME 2026 and 87.0 on HMMT Feb 2026. Artificial Analysis results shown on OpenRouter list 85.5% on GPQA Diamond and 55.4% on Terminal-Bench 2.1. The hardest reasoning tests remain tough: Humanity’s Last Exam scores 22.7 self-reported and 23.7% independently.

在其模型卡片上,inclusionAI 报告 SWE-Bench Pro 得分为 56.6,SWE-Bench Multilingual 得分为 72.4。它还报告 MathArena AIME 2026 得分为 93.2,HMMT Feb 2026 得分为 87.0。OpenRouter 上显示的 Artificial Analysis 结果显示 GPQA Diamond 准确率为 85.5%,Terminal-Bench 2.1 准确率为 55.4%。最难的推理测试依然艰难:Humanity’s Last Exam 自报得分为 22.7,独立评估得分为 23.7%。

API pricing: Artificial Analysis lists InclusionAI’s API at $0.075 per 1M input tokens and $0.22 per 1M output tokens. That blends to about $0.05 per 1M tokens, using its 7:2:1 cache-hit, input and output mix. It measured output speed at 231.7 tokens per second, third of 26 models in its class. On OpenRouter, Novita and DeepInfra list $0.06 input and $0.18 output.

API 定价:Artificial Analysis 列出 InclusionAI 的 API 价格为每百万输入 token 0.075 美元,每百万输出 token 0.22 美元。结合其 7:2:1 的缓存命中、输入和输出比例,平均价格约为每百万 token 0.05 美元。其测得的输出速度为每秒 231.7 个 token,在同类 26 个模型中排名第三。在 OpenRouter 上,Novita 和 DeepInfra 的定价为输入 0.06 美元,输出 0.18 美元。

Against peers: Artificial Analysis lists higher blended prices for comparable models. Step 3.7 Flash is $0.18, Gemini 3.5 Flash-Lite $0.33 and GPT-5 (medium) $1.34. These figures compare price only; they are not quality-adjusted.

与同行对比:Artificial Analysis 列出了可比模型更高的混合价格。Step 3.7 Flash 为 $0.18,Gemini 3.5 Flash-Lite 为 $0.33,GPT-5 (medium) 为 $1.34。这些数据仅比较价格;未进行质量调整。

Quantization costs little quality: inclusionAI’s quantization table compares BF16, FP8, INT4 and FP4. FP4 scores 83.68 on GPQA-diamond versus 84.97 in BF16. IFBench moves from 74.49 to 73.87, and ArcPrize from 68.75 to 68.06. SciCode shows the largest drop, from 41.24 to 38.43. The FP4 checkpoint is the one NVIDIA ran on DGX Spark.

量化对质量影响甚微:inclusionAI 的量化表比较了 BF16、FP8、INT4 和 FP4。在 GPQA-diamond 上,FP4 得分为 83.68,而 BF16 为 84.97。IFBench 从 74.49 降至 73.87,ArcPrize 从 68.75 降至 68.06。SciCode 下降幅度最大,从 41.24 降至 38.43。该 FP4 检查点是 NVIDIA 在 DGX Spark 上运行的版本。

Key Takeaways

关键要点

  • NVIDIA lifted Ling-3.0-flash GSM8K decode throughput 42.5% on 1 DGX Spark.
  • Humming kernels and an FP8 LM head cut the cost of each decode step.
  • Built-in MTP speculative decoding cuts the number of decode steps.
  • Stacking FP8 LM head and MTP requires a shared LM-head module.
  • Ling-3.0-flash activates 5.1B of 124B parameters per token, under MIT.
  • NVIDIA 在 1 台 DGX Spark 上将 Ling-3.0-flash GSM8K 解码吞吐量提升了 42.5%。
  • 优化的内核和 FP8 LM 头降低了每个解码步骤的成本。
  • 内置 MTP 推测解码减少了解码步骤的数量。
  • 堆叠 FP8 LM 头和 MTP 需要共享的 LM-head 模块。
  • Ling-3.0-flash 每个 token 激活 124B 参数中的 5.1B,采用 MIT 许可证。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件