Skip to content

OperatorX: H200 dp>1 MoE rows show more than 100% of peak bandwidth; dp ranks likely time the same tokens / OperatorX:H200 上 dp>1 的 MoE 数据行显示超过 100% 峰值带宽,各 dp rank 可能在计时同一批 token #4996

Closed

Description

@positronAI

Describe the bug

I noticed that on the official OperatorX MoE page, H200 at T=8 shows more than 100% of peak memory bandwidth and of roofline in four rows. All four are in data-parallel (dp>1) splits. The other H200 dp T=8 rows are at 70% to 100% of roofline. TP8, TP4 and 1 GPU stay far below peak (27% to 56%). The public harness code suggests why: under CUDA-graph timing, every dp rank runs the same tokens, while the roofline counts dp distinct batches.

Observed on the page (Roofline hover cards, read 2026-11-11 UTC; H200 dp and TP rows from run 36460297119, 2026-09-28; the H200 1 GPU row from run 36292840239, 2026-09-27):

View H200, T=8 TB/s % of peak bandwidth % of roofline
V4-Pro-0813, DP8 [1] topk 5.45 110% 120%
V4-Pro-0813, DP8 [1] hash 5.05 110% 110%
V4-Pro, DP4 · EP4 [2] hash 5.15 110% 110%
V4-Pro, DP8 · EP8 [3] hash 4.82 100% 100%
V4-Pro, TP8 [4] topk 1.31 27% 28%
V4-Pro, TP4 [5] topk 1.88 39% 39%
V4-Pro, 1 GPU [6] topk 2.68 56% 56%
  1. https://inferencex.semianalysis.com/opx/moe?workload=moe%3ADeepSeek-V4-Pro-0813&parallel=dp8
  2. https://inferencex.semianalysis.com/opx/moe?workload=moe%3ADeepSeek-V4-Pro&parallel=dp4%C2%B7ep4
  3. https://inferencex.semianalysis.com/opx/moe?workload=moe%3ADeepSeek-V4-Pro&parallel=dp8%C2%B7ep8
  4. https://inferencex.semianalysis.com/opx/moe?workload=moe%3ADeepSeek-V4-Pro&parallel=tp8
  5. https://inferencex.semianalysis.com/opx/moe?workload=moe%3ADeepSeek-V4-Pro&parallel=tp4
  6. https://inferencex.semianalysis.com/opx/moe?workload=moe%3ADeepSeek-V4-Pro

The GPU specs page (https://inferencex.semianalysis.com/infx/gpu-specs) lists "H200 SXM 141 GB 4.8 TB/s". The page rounds to two significant figures; the public CSV feed gives the exact roofline_share of the first four rows: 1.152, 1.069, 1.080 and 1.013. They are the only rows above 1 in any split of the V4-Pro, V4-Pro-0813 and V4.1-Flash MoE workloads. All four have cuda_graph=true (as do the TP and 1 GPU rows; the graph path matters only when dp>1). MI355X never exceeds peak, but its V4-Pro topk T=8 bandwidth in dp splits (DP8 · EP8 72%, DP4 · EP4 82%) is far above its TP values (TP8 15%, TP4 24%). At T=256 every dp case is at 19% to 45% of peak bandwidth.

Cause in the public code (observed)

Permalinks: InferenceX 8d9a592 (main on 2026-11-11; the cited files are unchanged at current main and byte-identical at the run's head commit c4b765e on branch hbarclay/operatorx).

  1. The contract: parallel.py#L6 says dp: D groups each bring their own batch.
  2. moe.py#L398 calls torch.manual_seed(routing["seed"]) with no rank term. All 46 cases in moe_parallel.json use seed 0.
  3. moe.py#L419-L422 builds a per-dp-rank x. But the graph is captured on xp, a fresh torch.randn from the default generator (linear.py#L300). Its replay (#L321-L322) is what nvidia/runner.py#L50-L51 and amd/runner.py#L40-L42 time. The per-rank x feeds only the untimed check and the eager path.
  4. Hash routing draws input_ids from a CPU generator seeded only with the routing seed (moe.py#L200, #L203). Every forward uses input_ids[:T] (#L286-L287).
  5. The roofline counts T × dp distinct tokens: describe.ts#L495-L500 calls touchedExperts(e, k, t * dp, a.routing), then divides the resulting expert bytes by dp to get a per-rank figure.

Inferred (not observed in a run)

Every rank seeds the default generator the same way and makes the same draws before linear.py#L300. So xp is likely identical on all ranks, and the node touches the experts of T tokens, not T × dp. For natural routing the app expects e * (1 - (1 - k / e) ** t) experts (describe.ts#L430-L443). With E=384, top6: t=64 (T=8 × dp8) gives about 244; t=8 gives about 45. The gap is largest at small T, as on the page. I did not check whether vLLM internals draw from the default generator differently per rank.

To Reproduce

  1. Open links [1] to [3] and hover the H200 T=8 points on the Roofline chart. The topk and hash routing points overlap, so check both. In [2] and [3] the hash routing point is the one above peak.
  2. Or read roofline_share in the CSV feed: https://inferencex.semianalysis.com/api/v1/views/operatorx?op=moe&workload=moe%3ADeepSeek-V4-Pro-0813&parallel=dp8&status=all&format=csv

Expected behavior

No row above 100% of peak bandwidth or roofline. Each dp rank times its own tokens, as parallel.py#L6 and moe.py#L419 state.

Suggested fix

  1. Graph path: build xp from the per-rank generator, or copy ctx["x"] into its first rows. _launcher is shared with GEMM (linear.py#L325), so MoE prepare could supply it.
  2. Draw hash input_ids per dp rank, e.g. with the seed at moe.py#L421.
  3. Re-run the 14 dp>1 cases in moe_parallel.json.
  4. Meanwhile, flag dp>1 rows with cuda_graph=true on the page.

Screenshots

[1] H200, DeepSeek-V4-Pro-0813 DP8, T=8, topk: 5.45 TB/s, 110% of peak bandwidth, 120% of roofline

[1] H200, DeepSeek-V4-Pro-0813 DP8, T=8, topk: 5.45 TB/s, 110% of peak bandwidth, 120% of roofline

[2] H200, DeepSeek-V4-Pro DP4 · EP4, T=8, hash: 5.15 TB/s, 110% of peak bandwidth, 110% of roofline

[2] H200, DeepSeek-V4-Pro DP4 · EP4, T=8, hash: 5.15 TB/s, 110% of peak bandwidth, 110% of roofline

[3] H200, DeepSeek-V4-Pro DP8 · EP8, T=8, hash: 4.82 TB/s, 100% of peak bandwidth, 100% of roofline

[3] H200, DeepSeek-V4-Pro DP8 · EP8, T=8, hash: 4.82 TB/s, 100% of peak bandwidth, 100% of roofline

[4] Contrast: H200, DeepSeek-V4-Pro TP8, T=8, topk: 1.31 TB/s, 27% of peak bandwidth, 28% of roofline

[4] Contrast: H200, DeepSeek-V4-Pro TP8, T=8, topk: 1.31 TB/s, 27% of peak bandwidth, 28% of roofline

[6] Contrast: H200, DeepSeek-V4-Pro 1 GPU, T=8, topk: 2.68 TB/s, 56% of peak bandwidth, 56% of roofline

[6] Contrast: H200, DeepSeek-V4-Pro 1 GPU, T=8, topk: 2.68 TB/s, 56% of peak bandwidth, 56% of roofline

Desktop / Smartphone

N/A (harness and data issue).

中文

问题描述

在官方 OperatorX MoE 页面上,H200 在 T=8 时有四行数据显示超过 100% 的峰值内存带宽和超过 100% 的 roofline。这四行都出现在数据并行(dp>1)切分中。其余 H200 dp T=8 数据行为 70% 至 100% 的 roofline。同一模型在 TP8、TP4 和 1 GPU 下都远低于峰值(27% 至 56%)。从公开的 harness 代码看,原因可能是:在 CUDA graph 计时路径下,所有 dp rank 跑的是同一批 token,而 roofline 按 dp 份互不相同的 batch 计算。

页面观测值(Roofline 图悬停卡片,2026-11-11 UTC 读取;H200 的 dp 和 TP 数据来自 run 36460297119(2026-09-28),1 GPU 数据来自 run 36292840239(2026-09-27)):V4-Pro-0813 DP8 topk 为 5.45 TB/s、110% 峰值带宽、120% roofline;hash 为 5.05 TB/s、110%、110%。V4-Pro DP4 · EP4 hash 为 5.15 TB/s、110%、110%;DP8 · EP8 hash 为 4.82 TB/s、100%、100%。对照:TP8 为 1.31 TB/s(27%),TP4 为 1.88 TB/s(39%),1 GPU 为 2.68 TB/s(56%)。GPU 规格页列出 H200 带宽为 4.8 TB/s。页面百分比按两位有效数字取整;CSV feed 中这四行的精确 roofline_share 分别为 1.152、1.069、1.080、1.013,是 V4-Pro、V4-Pro-0813 和 V4.1-Flash 三个 MoE 工作负载所有切分中仅有的大于 1 的数据行,且均为 cuda_graph=true(TP 和 1 GPU 数据行同样如此;graph 路径只在 dp>1 时产生影响)。MI355X 没有超过峰值,但其 V4-Pro topk T=8 在 dp 切分下的带宽(DP8 · EP8 72%、DP4 · EP4 82%)明显高于 TP(TP8 15%、TP4 24%)。在 T=256 时,所有 dp 用例的峰值带宽占比都只有 19% 至 45%。

代码中的原因(已观测)

parallel.py#L6 约定每个 dp 组带来自己的 batch。moe.py#L398 的 torch.manual_seed(routing["seed"]) 不含 rank 项,moe_parallel.json 中全部 46 个用例的 seed 都是 0。moe.py#L419-L422 构造了按 dp rank 区分的 x,但 CUDA graph 实际捕获的是 linear.py#L300 用默认生成器新建的 xp,计时的正是这个 graph 的 replay。x 只用于不计时的校验和 eager 路径。hash 路由的 input_ids 来自只用路由 seed 初始化的 CPU 生成器,每次前向都取 input_ids[:T]。而 describe.ts#L495-L500 按 T × dp 个不同 token 估算被访问的专家,再将所得专家字节数除以 dp 作为每个 rank 的值。(代码链接见上方英文部分。)

推断(未在运行中验证)

各 rank 默认生成器的 seed 和抽样顺序相同,因此 xp 很可能在所有 rank 上一致,整个节点只访问 T 个 token 对应的专家,而不是 T × dp 个。按 app 的公式 e * (1 - (1 - k / e) ** t),E=384、top6 时,t=64 约为 244 个专家,t=8 约为 45 个。小 T 时差距最大,与页面现象一致。尚未确认 vLLM 内部是否在各 rank 上以不同方式使用默认生成器。

复现步骤

  1. 打开上方链接 [1] 至 [3],在 Roofline 图上悬停 H200 T=8 的数据点。topk 与 hash 路由的数据点几乎重叠,请两者都查看。在 [2] 和 [3] 中,超过峰值的是 hash 路由的数据点。
  2. 或者在 CSV feed 中查看 roofline_share:https://inferencex.semianalysis.com/api/v1/views/operatorx?op=moe&workload=moe%3ADeepSeek-V4-Pro-0813&parallel=dp8&status=all&format=csv

预期行为

任何数据行都不应超过 100% 的峰值带宽或 roofline。按照 parallel.py#L6 和 moe.py#L419 的约定,每个 dp rank 应计时各自的 token。

建议修复

  1. graph 路径改用按 rank 的生成器构造 xp,或把 ctx["x"] 拷贝到其前几行。_launcher 与 GEMM 共用(linear.py#L325),因此可以由 MoE 的 prepare 提供该输入。
  2. hash 的 input_ids 按 dp rank 生成,例如使用 moe.py#L421 的 seed。
  3. 重新运行 moe_parallel.json 中 14 个 dp>1 用例。
  4. 在此之前,在页面上标注 dp>1 且 cuda_graph=true 的数据行。

截图见上方英文部分。

环境

不适用(harness 与数据问题)。

Activity

  1. positronAI commented on Nov 11, 2026

    @positronAI
    Author

    Follow-up on the open point in the issue ("I did not check whether vLLM internals draw from the default generator differently per rank"). I have now read that code for the H200 V4-Pro and V4-Pro-0813 dp rows.

    Result (from code, not observed in a run): every rank makes the same draws from the default generator between moe.py#L398 and linear.py#L300, so xp should be identical on every rank for top-k as well as hash.

    • Version. At the run's head c4b765e3, these H200 shards use vllm/vllm-openai:nightly-cd10ed6f… (containers.toml#L1-L2); the shard job names in run 36460297119 match ci.py's hash of that image. That is vllm-project/vllm@cd10ed6f.
    • The only default-generator draws in that window are the harness's own: _fill (moe.py#L366-L368, linear.py#L154-L164) and, for hash cases, moe.py#L372. Their order and shapes follow vLLM's local parameter shapes, which differ by rank only if E % ep ≠ 0 (expert_map_manager.py#L67-L69). Every dp case has E=384 with ep 4 or 8, or no ep.
    • vLLM draws nothing and reseeds nothing on this path: layer build, process_weights_after_loading, the allgather/reducescatter prepare-finalize and the untimed check run. The nearby draws (DeepGEMM warmup, FlashInfer autotuner) run only under kernel_warmup (gpu_worker.py#L807), which the harness never calls. The routing simulator runs only if VLLM_MOE_ROUTING_SIMULATION_STRATEGY is set (router_factory.py#L119-L125), and even then every rank would draw the same shapes.
    • Also checked: the MI355X V4-Pro dp rows (nightly-rocm100-3df4ae15, AITER) show no rank-dependent draw either. Not traced: B300 V4-Pro-0813 dp8, MI355X V4-Pro-0813 dp8 and the V4.1-Flash dp rows. CUTLASS DSL, cuBLAS/NCCL and torch internals were not read.

    Other explanations ruled out: cache reuse (the NVIDIA runner zeroes an L2-sized buffer before every timed iteration, runner.py#L35-L40, #L51); routing collapse (the score-correction bias is zeroed at moe.py#L369-L370, and in the feed 1-GPU top-k latency stays within 0.85-1.11x of hash latency at every T on H200, MI355X and B300); and uneven expert sharding.

    Correction to the issue: comparing MI355X dp (72-82% of peak bandwidth) with TP (15-24%) overstates the gap, because TP rows move 3.4-5.5x fewer bytes per GPU. Against MI355X's 1-GPU row (49%), the dp top-k rows are 1.5-1.7x. The same caveat applies to the TP rows in the H200 table; its 1-GPU row (56%) is the fair contrast. The H200 rows above 100% of peak are unaffected.

    Cheap check to settle it. Add a temporary print right after linear.py#L300 and run case 13 (0-based) of moe_parallel.json (V4-Pro dp8·ep8, T=8, topk):

    if hasattr(ctx["layer"], "gate"):  # MoE only; _launcher is shared with GEMM
        import hashlib
        from vllm.distributed import get_dp_group
        h = lambda t: hashlib.sha256(t.contiguous().cpu().numpy().tobytes()).hexdigest()[:16]
        ids = torch.topk(xp.float() @ ctx["layer"].gate.weight.float().T, 6).indices  # router's top-k up to rounding (bias 0, sqrtsoftplus monotonic)
        print(get_dp_group().rank_in_group, h(xp.view(torch.int16)), h(ids))

    If all eight ranks print the same hashes, they time the same tokens.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions