Skip to content

[Fix] Size the prefill delayer's gather buffer to its TP group - #41809

Merged
ch-wan merged 1 commit into
mainfrom
cheng/hot-fix/prefill-delayer-cp-gather
Sep 30, 2026
Merged

ch-wan merged 1 commit into
mainfrom
cheng/hot-fix/prefill-delayer-cp-gather

Conversation

@ch-wan

@ch-wan ch-wan commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

This PR is part of a stack (oldest at bottom):

Motivation

The prefill delayer all-gathers one info row per rank over the TP group, but sizes the receive buffer (dp, attn_tp_size, 5). The TP group is dp * attn_cp_size * attn_tp_size wide. With attention context parallelism the buffer is attn_cp_size times too small, and the first gather takes the scheduler down.

Modifications

  • Size the buffer (dp, attn_cp_size * attn_tp_size, 5), the layout the MLP sync batch info uses. [:, 0, :] still selects the first rank of each DP group. Without attention CP the shape is unchanged.
  • test_prefill_delayer_gather.py runs _gather_info against an all-gather that enforces what all_gather_into_tensor does (the output holds one input per rank of the TP group). It checks that each DP group's first rank comes back across TP, attention CP, DP attention, and DP attention with attention CP.

Accuracy Tests

H200, Qwen3-30B-A3B-FP8, --tp-size 4 --moe-dp-size 1 --ep-size 4 --attn-cp-size 2 --enable-prefill-cp --cp-strategy zigzag --cuda-graph-backend-prefill=disabled, GSM8K 200 questions:

--enable-prefill-delayer without
parent commit scheduler dies (ProcessGroupGloo::allgather: invalid tensor size)
this PR 0.920 0.895

test/registered/unit at this PR's head, compared with main: no new failures.

Speed Tests and Profiling

Not applicable.

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): 🚫 Run #36772605288
Latest PR Test (Extra): 🚫 Run #36772604827
Latest PR Test (AMD ROCm 10): 🚫 Run #36772605125

@ch-wan
ch-wan force-pushed the cheng/hot-fix/dflash-lilicorr-draft-scope branch from e0a6a7c to e25092f Compare September 30, 2026 04:24
@ch-wan
ch-wan force-pushed the cheng/hot-fix/prefill-delayer-cp-gather branch from 54c6abe to defe8e8 Compare September 30, 2026 04:24
@ch-wan
ch-wan force-pushed the cheng/hot-fix/dflash-lilicorr-draft-scope branch from e25092f to 0b5ba8c Compare September 30, 2026 05:05
@ch-wan
ch-wan force-pushed the cheng/hot-fix/prefill-delayer-cp-gather branch from defe8e8 to 3284778 Compare September 30, 2026 05:05
@ch-wan
ch-wan force-pushed the cheng/hot-fix/dflash-lilicorr-draft-scope branch from 0b5ba8c to 57f0511 Compare September 30, 2026 20:25
Base automatically changed from cheng/hot-fix/dflash-lilicorr-draft-scope to main September 30, 2026 20:25
The prefill delayer all-gathers one info row per rank over the TP group,
but sized the receive buffer `(dp, attn_tp_size, 5)`. The TP group is
`dp * attn_cp_size * attn_tp_size` wide, so with attention context
parallelism the buffer was `attn_cp_size` times too small, and the first
gather took the scheduler down.

Size it `(dp, attn_cp_size * attn_tp_size, 5)`, the same layout the MLP
sync batch info uses. `[:, 0, :]` still selects the first rank of each DP
group. Without attention CP the shape is unchanged.

The new test runs `_gather_info` against an all-gather that enforces what
`all_gather_into_tensor` does -- the output holds one input per rank of
the TP group -- and checks that each DP group's first rank comes back,
across TP, attention CP, DP attention, and DP attention with attention CP.
@ch-wan
ch-wan force-pushed the cheng/hot-fix/prefill-delayer-cp-gather branch from 3284778 to 2ea8e58 Compare September 30, 2026 20:26
@ch-wan
ch-wan merged commit a659e64 into main Sep 30, 2026
8 of 18 checks passed
@ch-wan
ch-wan deleted the cheng/hot-fix/prefill-delayer-cp-gather branch September 30, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant