Prhub

#29486 [Cookbook] GLM-5.2: tune GB300 NVFP4 recipes + fill benchmarks

原始 PR 作者 zijiexia 合并时间 2026-06-27 16:01 文件变更 2 提交数 3 评论 2 代码增减 +68 / -12

执行摘要

GLM-5.2 NVFP4 食谱与基准数据更新

PR Body 明确说明 "Builds on the GB300 NVFP4 scaffolding already in main (#29380 + #29466) with the newly-measured single-node 4×GB300 (TP4) recipes and benchmark numbers for nvidia/GLM-5.2-NVFP4"。目的是为 GB300 NVFP4 提供实测优化后的部署配置和性能数据,填补原有占位符,并统一移除 --trust-remote-code 标志以与其他量化方式保持一致。

该 PR 属于文档/配置更新,技术深度较低,但可作为 Cookbook 配置维护的参考案例。值得关注的设计决策包括:balanced 策略中根据并发度选择较短 MTP 序列(2-1-3 vs 5-1-6)的权衡依据,以及 DP-Attention 在高吞吐场景下的应用。

讨论亮点

无实质 review 评论。PR 获得 Fridge003 的快速批准(state: APPROVED),仅有一个 Mintlify 自动预览部署的 bot 评论和一个 Gemini Code Assist 的每日配额警告,没有设计或实现层面的技术讨论。

实现拆解

  1. 更新食谱文件 (glm-5.2.jsx):修改 GB300 NVFP4 的 low-latency 策略,将 mem-fraction-static 从 0.8 提升至 0.85;为 balanced 策略添加 --dp 4--enable-dp-attention,调整 MTP 参数为 2-1-3,mem-fraction-static 提升至 0.92,并设置 max-running-requests 256;新增 high-throughput 策略,配置 --dp 4--enable-dp-attentionmax-running-requests 512mem-fraction-static 0.92。同时从所有 B300 和 GB300 NVFP4 单元格中移除 --trust-remote-code 标志。
  2. 填充基准数据文件 (glm-5.2-benchmarks.jsx):为 GB300 NVFP4 的三种策略(low-latency、balanced、high-throughput)填写了实测的 TTFT、TPOT 和 tokens_per_sec_per_gpu 数据,覆盖 ISL/OSL 8192/1024 的不同并发度(1, 16, 64, 256, 1024)。
  3. 更新 AIME25 得分:最终提交中将 GB300 NVFP4 的 AIME25 得分从 91.04 修正为 89.58%,与 FP8/BF16 变体的默认值 87.7% 相当,并注明在 AIME25 运行间方差范围内。
文件 模块 状态 重要度
docs_new/src/snippets/configs/zai-org/glm-5.2.jsx Cookbook modified 6.21
docs_new/src/snippets/configs/zai-org/glm-5.2-benchmarks.jsx Cookbook modified 5.79

关键源码片段

docs_new/src/snippets/configs/zai-org/glm-5.2.jsx core-logic

核心食谱文件,包含 GB300 NVFP4 三种部署策略的完整配置参数变更,是部署者直接引用的关键配置源。

// ====================================================================
// NVFP4 (Blackwell Ultra) — nvidia/GLM-5.2-NVFP4 (Model Optimizer). TP4.
// B300: low-latency + balanced (the 4-GPU GB300 node fits the ~381 GB build).
// GB300: low-latency / balanced / high-throughput measured on a single 4xGB300
// node — balanced & high-throughput add DP-Attention (dp4); low-latency uses MTP 5-1-6.
// ====================================================================
{
  match: { hw: "gb300", variant: "default", quant: "nvfp4", strategy: "low-latency", nodes: "single" },
  verified: true,
  env: [],
  flags: [
    "--model-path {{MODEL_NAME}}",
    "--tp 4",
    "--quantization modelopt_fp4",
    "--speculative-algorithm EAGLE",
    "--speculative-num-steps 5",
    "--speculative-eagle-topk 1",
    "--speculative-num-draft-tokens 6",
    "--chunked-prefill-size 8192",
    "--mem-fraction-static 0.85", // 从 0.8 提升至 0.85,充分利用 GB300 显存
    "--host {{HOST_IP}}",
    "--port {{PORT}}",
  ],
},
{
  match: { hw: "gb300", variant: "default", quant: "nvfp4", strategy: "balanced", nodes: "single" },
  verified: true,
  env: [],
  flags: [
    "--model-path {{MODEL_NAME}}",
    "--tp 4",
    "--quantization modelopt_fp4",
    "--dp 4", // 新增 DP-Attention 以提升并发吞吐
    "--enable-dp-attention",
    // 较短的 MTP 2-1-3:在此并发度下,长 MTP 的验证开销超过接受长度收益
    "--speculative-algorithm EAGLE",
    "--speculative-num-steps 2",
    "--speculative-eagle-topk 1",
    "--speculative-num-draft-tokens 3",
    "--chunked-prefill-size 8192",
    "--mem-fraction-static 0.92", // 更高显存利用率
    "--max-running-requests 256",
    "--host {{HOST_IP}}",
    "--port {{PORT}}",
  ],
},
{
  match: { hw: "gb300", variant: "default", quant: "nvfp4", strategy: "high-throughput", nodes: "single" },
  verified: true,
  env: [],
  flags: [
    "--model-path {{MODEL_NAME}}",
    "--tp 4",
    "--quantization modelopt_fp4",
    "--dp 4", // DP-Attention 用于高吞吐场景
    "--enable-dp-attention",
    "--chunked-prefill-size 8192",
    "--mem-fraction-static 0.92",
    "--max-running-requests 512", // 最大并发请求数 512
    "--host {{HOST_IP}}",
    "--port {{PORT}}",
  ],
},
docs_new/src/snippets/configs/zai-org/glm-5.2-benchmarks.jsx core-logic

基准数据文件,提供了 GB300 NVFP4 三种策略在不同并发度下的实测性能数据(TTFT、TPOT、吞吐量),是用户评估部署性能的关键参考。

// ---- GB300 + NVFP4 ---- (4-GPU single node, TP4; nvidia/GLM-5.2-NVFP4 via --quantization modelopt_fp4,
// measured on the lmsysorg/sglang:dev-glm52-nvfp4 preview image, flush-cache every run.
// tokens_per_sec_per_gpu = total server output tok/s / 4 GPUs (337→84, 1248→312, 1162→291, 1695→424, 1730→433).
// aime25 overrides the variant default (87.7 → 89.58, measured on this NVFP4 build); gsm8k inherits the default.)
{
  match: { hw: "gb300", variant: "default", quant: "nvfp4", strategy: "low-latency", nodes: "single" },
  sglang_version: "dev-glm52-nvfp4",
  accuracy: { aime25_pct: 89.58 },
  speed: [
    { workload: { dataset: "random", isl: 8192, osl: 1024, max_concurrency: 1 },
      ttft_ms: 238, tpot_ms: 2.23, tokens_per_sec_per_gpu: 84 },
    { workload: { dataset: "random", isl: 8192, osl: 1024, max_concurrency: 16 },
      ttft_ms: 315, tpot_ms: 11.9, tokens_per_sec_per_gpu: 312 },
  ],
},
{
  match: { hw: "gb300", variant: "default", quant: "nvfp4", strategy: "balanced", nodes: "single" },
  sglang_version: "dev-glm52-nvfp4",
  accuracy: { aime25_pct: 89.58 },
  speed: [
    { workload: { dataset: "random", isl: 8192, osl: 1024, max_concurrency: 64 },
      ttft_ms: 1169, tpot_ms: 58, tokens_per_sec_per_gpu: 291 },
    { workload: { dataset: "random", isl: 8192, osl: 1024, max_concurrency: 256 },
      ttft_ms: 6389, tpot_ms: 167, tokens_per_sec_per_gpu: 424 },
  ],
},
{
  match: { hw: "gb300", variant: "default", quant: "nvfp4", strategy: "high-throughput", nodes: "single" },
  sglang_version: "dev-glm52-nvfp4",
  accuracy: { aime25_pct: 89.58 },
  speed: [
    { workload: { dataset: "random", isl: 8192, osl: 1024, max_concurrency: 1024 },
      ttft_ms: 156000, tpot_ms: 321, tokens_per_sec_per_gpu: 433 },
  ],
},

评论区精华

没有提炼出高价值讨论线程

当前评论区没有形成足够清晰的争议点或结论,后续有更多讨论时会体现在这里。

风险与影响

本 PR 仅修改文档/配置片段文件(.jsx),未涉及任何运行时 Python/CUDA 代码。主要风险来自配置错误导致的部署失败或性能下降,但所有配置均已标注为 verified: true,且基于实测数据调整,风险较低。移除 --trust-remote-code 可能影响模型加载,但 PR 说明 GLM-5.2 模型已原生集成,且其他量化方式未使用该标志,因此回归风险可控。

  • 用户:使用 GLM-5.2 NVFP4 的部署者可根据食谱直接采用优化后的参数,获得已验证的基准性能数据作为参考。
  • 系统:无运行时影响,仅影响 Cookbook 文档页面的展示。
  • 团队:为后续模型部署配置提供可复现的优化模板,减少重复调优工作。
配置变更 无测试覆盖

关联 Issue

未识别关联 Issue

当前没有检测到明确关联的 Issue 链接,后续同步到相关引用后会出现在这里。

完整报告

参与讨论