Skip to content

[AgentX][vLLM][NVIDIA] chore: tune vLLM DeepSeek v4 agentic B200+B300#2138

Open
cquil11 wants to merge 20 commits into
mainfrom
codex/dsv4-vllm-agentic-tuning
Open

[AgentX][vLLM][NVIDIA] chore: tune vLLM DeepSeek v4 agentic B200+B300#2138
cquil11 wants to merge 20 commits into
mainfrom
codex/dsv4-vllm-agentic-tuning

Conversation

@cquil11

@cquil11 cquil11 commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Apply the requested DeepSeek-V4 vLLM serving flags to the B200 and B300 AgentX launchers, including sparse MLA attention, Mega-MoE, full decode-only CUDA graphs, cuMem/NUMA binding, FP8 KV cache, and fastsafetensors loading.
  • Expand the B200 and B300 vLLM AgentX concurrency matrices so every corresponding SGLang topology/offload point is covered.
  • Add a concise performance changelog entry.

Validation

  • bash -n benchmarks/single_node/agentic/dsv4_fp4_b200_vllm.sh
  • bash -n benchmarks/single_node/agentic/dsv4_fp4_b300_vllm.sh
  • python -m pytest utils/matrix_logic/ -q — 188 passed
  • Focused DSV4 FP4 vLLM AgentX matrix generation — 79 points
  • Programmatic B200/B300 SGLang coverage comparison — no missing points

中文说明

  • 为 B200 和 B300 AgentX 启动脚本加入指定的 DeepSeek-V4 vLLM 推理参数,包括稀疏 MLA 注意力、Mega-MoE、仅解码全量 CUDA Graph、cuMem/NUMA 绑定、FP8 KV Cache 和 fastsafetensors 加载。
  • 扩展 B200 和 B300 vLLM AgentX 并发扫描矩阵,确保覆盖对应 SGLang 配置的全部拓扑、卸载模式和并发点。
  • 添加简洁的性能变更记录。

验证

  • 两个启动脚本均通过 bash -n 语法检查
  • python -m pytest utils/matrix_logic/ -q — 188 项测试通过
  • DSV4 FP4 vLLM AgentX 定向矩阵生成成功 — 共 79 个点
  • B200/B300 SGLang 覆盖对比检查通过 — 无缺失点

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for the contribution! Please reach out to respective companies' CODEOWNER to fill in the latest PR_REVIEW_CHECKLIST.md before pinging core maintainer on Slack for review. In order for the signoff PR check bot to trigger, you must follow the PR_REVIEW_CHECKLIST.md template correctly, including the phrase As a PR reviewer and CODEOWNER, I have reviewed this and have.

For PR verification, add the full-sweep-fail-fast label (strongly recommended) to this PR — the benchmark sweep only runs on labeled PRs. Use full-sweep-enabled only if you need matrix jobs to keep running past a failure.

PR authors are responsible for ensuring that after merging, all GitHub Action jobs fully pass. A lot of the time, failures are just flakes and simply re-running the failed jobs will fix it. See GitHub's docs on re-running failed jobs


感谢你的贡献!请联系相应公司的 CODEOWNER 填写最新的 PR_REVIEW_CHECKLIST.md,然后再在 Slack 上联系核心维护者进行审阅。为了触发 signoff PR 检查机器人,你必须正确遵循 PR_REVIEW_CHECKLIST.md 模板,包括保留英文语句 As a PR reviewer and CODEOWNER, I have reviewed this and have

如需进行 PR 验证,请为此 PR 添加 full-sweep-fail-fast 标签(强烈推荐)— 基准测试 sweep 仅在带有标签的 PR 上运行。仅当需要矩阵任务在失败后继续运行时才使用 full-sweep-enabled

PR 作者有责任确保合并后所有 GitHub Action 任务完全通过。 很多时候失败只是偶发抖动(flake),重新运行失败的任务即可解决。参见 GitHub 关于重新运行失败任务的文档

@cquil11 cquil11 marked this pull request as ready for review July 9, 2026 20:53
@cquil11 cquil11 requested a review from a team July 9, 2026 20:53
@claude

claude Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Claude finished @cquil11's task in 5m 8s —— View job


Review of PR #2138

  • Gather context (diff, commits)
  • Review benchmark scripts (dsv4_fp4_b200_vllm.sh, dsv4_fp4_b300_vllm.sh)
  • Review configs/nvidia-master.yaml changes
  • Verify perf-changelog.yaml entry placement
  • Verify vLLM flags (via repo precedent — see limitations below)
  • Post review feedback

Summary

One issue found, flagged inline in both scripts (🟡): the new --attention-config JSON drops the previously enabled use_fp4_indexer_cache. Every peer DSV4 vLLM recipe in the repo — including the GB200 disagg agentic recipes using the same FLASHINFER_MLA_SPARSE_DSV4 backend — sets it to true, and the scripts still carry the CUTLASS DSL workaround for DSV4 indexer compilation, so this looks unintentional. If it's a deliberate part of the v0.24 recipe, please note it in the PR/changelog.

Everything else checks out:

  • perf-changelog.yaml entry is correctly appended at the end of the file, and master-config changes are documented. ✅
  • vllm/vllm-openai:v0.24.0 is a public Docker Hub reference. ✅
  • Expert parallelism follows the conditional EP_SIZE pattern (EP_ARGS), and server launch commands use per-line argument formatting. ✅
  • Most new flags (--numa-bind, --enable-cumem-allocator, --moe-backend deep_gemm_mega_moe, --compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY","mode":0}', --no-enable-flashinfer-autotune) match existing DSV4 multi-node recipes in this repo. ✅
  • I independently compared the new B200/B300 concurrency lists against the SGLang agentic search spaces: B300 is a full superset; B200 matches except DEP8 conc 16 (both offload modes), which was deliberately dropped in commit 9306947 — note this makes the PR description's "no missing points" claim slightly stale.

Two minor cautions (no inline comment, CI will exercise them): --prefill-schedule-interval and --load-format fastsafetensors have no precedent anywhere in this repo, and fastsafetensors requires the package to be present in the v0.24.0 image (the script pip-installs its other deps but not this one). The PR's validation list has no live serving run, so the full sweep is the first time these flags get exercised — worth watching the first sweep jobs for startup failures.

Review limitations: the vLLM source MCP server was unavailable and python/curl execution wasn't permitted in this run, so I could not verify the new flags against vLLM v0.24 source, re-run the matrix tests, or confirm the v0.24.0 tag exists on Docker Hub — flag validation above is based on in-repo precedent only.

Fix the dropped fp4 indexer cache →

--numa-bind
--enable-cumem-allocator
--compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY","mode":0}'
--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 WARNING: This replaces the previous --attention_config.use_fp4_indexer_cache=True with a full --attention-config JSON that omits use_fp4_indexer_cache, silently reverting the FP4 indexer cache to its default.

Why it matters: Every other DSV4 vLLM recipe in this repo enables it — including the GB200 disagg agentic recipes that use the exact same backend, e.g. benchmarks/multi_node/srt-slurm-recipes/vllm/deepseek-v4/agentic/disagg-gb200-3p2d-tep8-tp8-agentic.yaml:103 sets {"backend": "FLASHINFER_MLA_SPARSE_DSV4", "use_prefill_query_quantization": true, "use_fp4_indexer_cache": true}. This script also still carries the CUTLASS DSL reinstall workaround for DSV4 indexer compilation (lines 69–73), so the indexer path is clearly still active. Dropping the FP4 indexer cache changes KV memory footprint and perf on the very sweep this PR is tuning, and the PR description doesn't mention removing it.

Fix: If the drop is intentional, say so in the PR/changelog; otherwise:

Suggested change
--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true}'
--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true,"use_fp4_indexer_cache":true}'

--numa-bind \
--enable-cumem-allocator \
--compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY","mode":0}' \
--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true}' \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 WARNING: Same as the B200 script — the new --attention-config JSON drops the previously enabled use_fp4_indexer_cache, and the PR description doesn't mention removing it. Peer DSV4 agentic recipes with this backend set "use_fp4_indexer_cache": true (see disagg-gb200-3p2d-tep8-tp8-agentic.yaml:103).

Fix: If intentional, document it; otherwise:

Suggested change
--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true}' \
--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true,"use_fp4_indexer_cache":true}' \

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@cquil11 cquil11 changed the title [codex] Tune DSV4 vLLM AgentX configs / 调优 DSV4 vLLM AgentX 配置 [AgentX][vLM][NVIDIA] chore: tune vLLM DeepSeek v4 agentic B200+B300 Jul 9, 2026
@cquil11 cquil11 changed the title [AgentX][vLM][NVIDIA] chore: tune vLLM DeepSeek v4 agentic B200+B300 [AgentX][vLLM][NVIDIA] chore: tune vLLM DeepSeek v4 agentic B200+B300 Jul 9, 2026
--enable-cumem-allocator
--compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY","mode":0}'
--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true}'
--moe-backend deep_gemm_mega_moe

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 --moe-backend deep_gemm_mega_moe is now added unconditionally to the vllm serve command in both dsv4_fp4_b200_vllm.sh (line 209) and dsv4_fp4_b300_vllm.sh (line 213), but every sibling DSV4 vLLM launcher in benchmarks/single_node/fixed_seq_len/ gates this exact flag on DP_ATTENTION=true. The expanded search space still has pure-TP legs on both B200 and B300 that will now force Mega-MoE outside the DEP recipe — which per perf-changelog PR #1304 has caused CUDA symmetric-memory rendezvous failures during engine startup. Please move the flag into an MOE_ARGS=() array gated on DP_ATTENTION=true to match the fixed_seq_len pattern.

Extended reasoning...

The bug

Both AgentX launchers now emit --moe-backend deep_gemm_mega_moe as an unconditional flag inside VLLM_CMD/vllm serve:

  • benchmarks/single_node/agentic/dsv4_fp4_b200_vllm.sh:209
  • benchmarks/single_node/agentic/dsv4_fp4_b300_vllm.sh:213

However, every sibling DSV4 vLLM launcher in the repo gates this exact flag on DP_ATTENTION=true:

  • benchmarks/single_node/fixed_seq_len/dsv4_fp4_b200_vllm.sh:47-50
  • benchmarks/single_node/fixed_seq_len/dsv4_fp4_b300_vllm.sh:55-58
  • benchmarks/single_node/fixed_seq_len/dsv4_fp4_b200_vllm_mtp.sh:49-53
  • benchmarks/single_node/fixed_seq_len/dsv4_fp4_b300_vllm_mtp.sh:49-51

The b200 MTP variant documents the rationale inline: "Mega-MoE backend and the lower GMU only kick in on the DP-attn path, per the vLLM v0.20.0 DeepSeek-V4-Pro recipe."

Why the gate is load-bearing

Two perf-changelog.yaml entries record why this flag must be conditional:

The multi-node disagg-gb300-1p6d-dep4-tp4-agentic.yaml mirrors the same pattern: the DEP prefill role sets moe-backend: deep_gemm_mega_moe, but the pure-TP decode role omits it entirely.

Impact on the expanded search space

The matrix expansion in this PR keeps several pure-TP rows (no ep, no dp-attn) that will now launch with Mega-MoE forced:

  • B200: { tp: 8, kv-offloading: none, conc-list: [1, 2, 3, 4, 5] } and { tp: 8, kv-offloading: dram, kv-offload-backend: mooncake, conc-list: [8, 10, 16, 32, 40, 44] }
  • B300: { tp: 4, kv-offloading: none, conc-list: [...] }, { tp: 4, kv-offloading: dram, ... }, { tp: 8, kv-offloading: none, conc-list: [1..72] }, { tp: 8, kv-offloading: dram, conc-list: [52] }.

Roughly half of the newly-expanded concurrency points are pure-TP. On those, per PR #1304's history, vLLM engine startup can hit CUDA symmetric-memory rendezvous failures; even when it doesn't, the recipe restricts this backend to DEP layouts so throughput numbers on the TP legs would not be comparable to the intended baseline.

Proof — walk through a concrete sweep point

Take the B300 point { tp: 8, ep: (unset → 1), dp-attn: (unset → false), kv-offloading: none, conc: 40 }:

  1. EP_SIZE defaults to 1 → EP_ARGS=() (line 195) — no --enable-expert-parallel.
  2. DP_ATTENTION defaults to false → PARALLEL_ARGS=(--tensor-parallel-size 8 --data-parallel-size 1) (line 189), and the vLLM router branch is skipped (line 82).
  3. The vllm serve invocation still includes --moe-backend deep_gemm_mega_moe unconditionally (line 213).
  4. Result: an 8-way pure-TP engine is launched with the DEP-only MoE backend — exactly the configuration PR Add DSV4 B300 Dynamo vLLM disagg #1304 flagged as causing symmetric-memory rendezvous failures. In the fixed_seq_len sibling launcher (fixed_seq_len/dsv4_fp4_b300_vllm.sh:55-58) the if [ "${DP_ATTENTION}" = "true" ]; then MOE_ARGS=(--moe-backend deep_gemm_mega_moe); fi guard would have kept MOE_ARGS=() empty for this same point, letting vLLM auto-select the backend.

Suggested fix

Introduce an MOE_ARGS array matching the fixed_seq_len pattern, e.g.:

MOE_ARGS=()
if [ "${DP_ATTENTION}" = "true" ]; then
    MOE_ARGS=(--moe-backend deep_gemm_mega_moe)
fi

and drop the flag from VLLM_CMD / vllm serve, splicing in "${MOE_ARGS[@]}" next to "${EP_ARGS[@]}". This restores the DP-attention-only gate and preserves the intended behavior on the pure-TP legs of the sweep.

--numa-bind
--enable-cumem-allocator
--compilation-config '{"cudagraph_mode":"FULL_DECODE_ONLY","mode":0}'
--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true}'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 The new JSON --attention-config on line 208 (and the matching line 212 in dsv4_fp4_b300_vllm.sh) drops the use_fp4_indexer_cache key that the prior --attention_config.use_fp4_indexer_cache=True flag set, silently disabling the FP4 indexer cache optimization on the very AgentX runs this PR is tuning. Every other DSV4 FLASHINFER_MLA_SPARSE_DSV4 recipe in the repo (multi-node agentic disagg-gb200/gb300 YAMLs, fixed_seq_len B200/B300, speedbench B300) still sets this to true, and neither the PR description nor the perf-changelog notes removing it as intentional. Add "use_fp4_indexer_cache":true to the JSON in both files.

Extended reasoning...

What the bug is. The PR migrates --attention_config.use_fp4_indexer_cache=True (dot-notation) into a single JSON --attention-config blob but only carries backend and use_prefill_query_quantization forward:

--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true}'

use_fp4_indexer_cache is not in the new JSON, so on vllm serve it falls back to the vLLM default (not true). This affects both benchmarks/single_node/agentic/dsv4_fp4_b200_vllm.sh:208 and benchmarks/single_node/agentic/dsv4_fp4_b300_vllm.sh:212.

Why the previous code did not prevent it. Pre-PR both files explicitly enabled the flag via --attention_config.use_fp4_indexer_cache=True. The migration to JSON was a mechanical syntax change — it should have listed all three keys — but only two survived.

Cross-repo consistency shows the intended value is true. Every other DSV4 recipe in the tree that uses FLASHINFER_MLA_SPARSE_DSV4 explicitly sets use_fp4_indexer_cache: true:

  • benchmarks/multi_node/srt-slurm-recipes/vllm/deepseek-v4/agentic/disagg-gb200-2p1d-dep8-dep8-agentic.yaml lines 108 and 131 — the analogous multi-node AgentX recipe, same backend, same use_prefill_query_quantization: true, plus use_fp4_indexer_cache: true.
  • disagg-gb200-3p2d-tep8-tp8-agentic.yaml lines 103 and 122 — same pattern on prefill and decode.
  • disagg-gb300-1p6d-dep4-tp4-agentic.yaml line 92 — same.
  • benchmarks/single_node/fixed_seq_len/dsv4_fp4_b200_vllm.sh and its B300 counterpart still pass --attention_config.use_fp4_indexer_cache True.
  • benchmarks/single_node/speedbench/dsv4_fp4_b300_vllm.sh:243 still passes it.
  • perf-changelog.yaml:1951 documents this as part of the standard DSV4 recipe; perf-changelog.yaml:1750 notes it is only omitted on H200 (no FP4 path).

The PR body says the goal is to "follow the DeepSeek-V4 low-latency vLLM recipe" and match the SGLang/multi-node topology — but the multi-node analog it's supposed to mirror pairs use_prefill_query_quantization: true with use_fp4_indexer_cache: true in the same JSON. So the pattern is not "newer runs drop it."

Step-by-step proof.

  1. git show HEAD^:benchmarks/single_node/agentic/dsv4_fp4_b200_vllm.sh contains --attention_config.use_fp4_indexer_cache=True. The FP4 indexer cache was enabled.
  2. In the PR diff, that line is replaced by --attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true}' — with no use_fp4_indexer_cache key.
  3. When vLLM parses --attention-config, unspecified keys take library defaults. Nothing in the vLLM v0.24.0 release notes indicates the default for use_fp4_indexer_cache flipped to true — and if it had, all the peer recipes shipping alongside the same v0.24.0 bump would not still pass it explicitly. So the effective value on B200/B300 AgentX becomes the non-true default.
  4. The perf-changelog entry (perf-changelog.yaml:4700+) lists sparse-attention, Mega-MoE, cudagraph, cuMem/NUMA, fastsafetensors, and scheduler tuning — no mention of disabling the FP4 indexer cache.

Impact. Silent perf regression on the DSV4 sparse-attention path for the exact B200/B300 AgentX runs this PR is tuning. AgentX numbers will report a partially-applied DSV4 recipe versus the intended one that peer recipes still use.

Fix. Add "use_fp4_indexer_cache":true to both JSON blobs:

--attention-config '{"backend":"FLASHINFER_MLA_SPARSE_DSV4","use_prefill_query_quantization":true,"use_fp4_indexer_cache":true}'

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant