Skip to content

[PD] Fix PD disaggregation decode warmup crash under DP-attention (#30748) - #32187

Closed
whybeyoung wants to merge 1 commit into
mainfrom
fix_pd_warmup_route_dp
Closed

whybeyoung wants to merge 1 commit into
mainfrom
fix_pd_warmup_route_dp

Conversation

@whybeyoung

@whybeyoung whybeyoung commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

motivation

Fix #32182 introduced by PR #30748

PR #30748 changed the PD warmup from a single batched POST to dp_size concurrent single-sequence POSTs (one per DP rank via routed_dp_rank). With enable_dp_attention / enable_dp_lm_head enabled, this leaves every DP rank processing a lone fake req instead of the joint dp_size batch the scheduler used to see, breaking cross-rank batch shape assumptions and crashing on the decode side with:

/pytorch/aten/src/ATen/native/cuda/IndexKernelUtils.cu:16:
vectorized_gather_kernel: Assertion ind >= 0 && ind < ind_dim_size failed

surfaced at result.copy_done.synchronize() in
scheduler_components/batch_result_processor.process_batch_result_decode.

Keep the fan-out (so every DP rank still reliably receives its fake req), but pad each POST body with dp_size aligned fake sequences by sending arrays for sampling_params / bootstrap_host / bootstrap_room / input_ids / routed_dp_rank. This restores the pre-#30748 batch shape seen by each scheduler and keeps DP-attention shapes consistent across ranks.

Also uses well-separated bootstrap_room ids (spaced with the pre-#30748 formula) so they never collide with the 0 reset marker used by DecodePreallocQueue metadata buffers.

CC @hnyls2002 @ShangmingCai @hzh0425


CI States

Latest PR Test (Base): ❌ Run #30071651285
Latest PR Test (Extra): ❌ Run #30071651165

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@whybeyoung
whybeyoung force-pushed the fix_pd_warmup_route_dp branch from 734a6e3 to 7a78e05 Compare July 23, 2026 09:31
@whybeyoung whybeyoung changed the title Fix PD disaggregation decode warmup crash under DP-attention (#30748) [PD] Fix PD disaggregation decode warmup crash under DP-attention (#30748) Jul 23, 2026
@whybeyoung

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@weireweire

Copy link
Copy Markdown
Contributor

hi, thanks for investigating this. About the batch shape issue, even though the old code with batch size dp, the requests are still dispatched to each dp rank so their shape is also 1, isn't it?

PR #30748 changed the PD warmup from a single batched POST to dp_size
concurrent single-sequence POSTs (one per DP rank via routed_dp_rank).
With enable_dp_attention / enable_dp_lm_head enabled, this leaves every
DP rank processing a lone fake req instead of the joint dp_size batch
the scheduler used to see, breaking cross-rank batch shape assumptions
and crashing on the decode side with:

  /pytorch/aten/src/ATen/native/cuda/IndexKernelUtils.cu:16:
  vectorized_gather_kernel: Assertion `ind >= 0 && ind < ind_dim_size` failed

surfaced at result.copy_done.synchronize() in
scheduler_components/batch_result_processor.process_batch_result_decode.

Keep the fan-out (so every DP rank still reliably receives its fake
req), but pad each POST body with dp_size aligned fake sequences by
sending arrays for sampling_params / bootstrap_host / bootstrap_room /
input_ids / routed_dp_rank. This restores the pre-#30748 batch shape
seen by each scheduler and keeps DP-attention shapes consistent across
ranks.

Also uses well-separated bootstrap_room ids (spaced with the
pre-#30748 formula) so they never collide with the 0 reset marker used
by DecodePreallocQueue metadata buffers.
@whybeyoung

Copy link
Copy Markdown
Collaborator Author

closed it as solved in main

@whybeyoung whybeyoung closed this Jul 29, 2026
@Jiminator
Jiminator deleted the fix_pd_warmup_route_dp branch September 14, 2026 04:42
@alexnails
alexnails restored the fix_pd_warmup_route_dp branch September 14, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] [PD] Warmup broken in decode ep32 with dp attention

2 participants