Skip to content

Support DP attention for breakable prefill CUDA graphs - #30185

Closed
merrymercy wants to merge 5 commits into
mainfrom
lmzheng/prefill-breakable-dp-attention
Closed

merrymercy wants to merge 5 commits into
mainfrom
lmzheng/prefill-breakable-dp-attention

Conversation

@merrymercy

@merrymercy merrymercy commented Jul 5, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Enable breakable prefill CUDA graph replay for DP attention batches that include idle ranks.
  • Carry logprob and non-padded-token metadata through prefill graph replay.
  • Clamp prefill CUDA graph capture sizes after the DP chunked-prefill adjustment.
  • Remove the config-time block that disabled breakable prefill CUDA graph when DP attention is enabled.
  • Add a registered e2e KL test for DP attention + breakable prefill CUDA graph that compares prefill/decode cache-hit logprobs against replayed input logprobs.

Testing

  • CUDA_VISIBLE_DEVICES=0,1 LD_PRELOAD=/lib64/libnuma.so.1 uv run --no-sync python test/registered/dp_attn/test_dp_attention_breakable_cuda_graph_kl.py -v
    • Ran 2 tests in 174.246s
    • avg KL: 0.000221
    • KL threshold: 0.002500
  • pre-commit run black-jupyter --files test/registered/dp_attn/test_dp_attention_breakable_cuda_graph_kl.py
  • python3 -m py_compile python/sglang/srt/server_args.py test/registered/dp_attn/test_dp_attention_breakable_cuda_graph_kl.py
  • git diff --check -- python/sglang/srt/server_args.py test/registered/dp_attn/test_dp_attention_breakable_cuda_graph_kl.py

CI States

Latest PR Test (Base): ❌ Run #28822209659
Latest PR Test (Extra): ✅ Run #28822209464

Enable breakable prefill CUDA graph replay for DP attention batches with idle ranks by forcing consistent padding buckets and carrying logprob and non-padded-token metadata through the prefill graph path.

Co-authored-by: Lianmin Zheng <[email protected]>
@merrymercy

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@github-actions github-actions Bot added the run-ci CI: run the baseline test suite on this PR label Jul 5, 2026
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

@Oasis-Git

Copy link
Copy Markdown
Collaborator

Should we remove

# DP-attn × BCG capture/replay not yet validated.
?

@merrymercy
merrymercy force-pushed the lmzheng/prefill-breakable-dp-attention branch 4 times, most recently from 21bfcd7 to 4d199eb Compare July 6, 2026 06:19
@merrymercy
merrymercy force-pushed the lmzheng/prefill-breakable-dp-attention branch from 4d199eb to 8b433be Compare July 6, 2026 06:23
@merrymercy

Copy link
Copy Markdown
Collaborator Author

Should we remove

# DP-attn × BCG capture/replay not yet validated.

?

ok, removed. Do you have more test cases that i can run?

@merrymercy

Copy link
Copy Markdown
Collaborator Author

Removed the DP-attention incompatibility rule for breakable prefill CUDA graph in cc433052a5.

@merrymercy merrymercy added the run-ci-extra CI: also run the extra suite (requires run-ci) label Jul 6, 2026
@Oasis-Git

Copy link
Copy Markdown
Collaborator

The removal of the rule should release all the dp-realted ci test which, however, is a little weak. Previously when I run the bcg set default pr all of them passed as well.

@merrymercy

merrymercy commented Jul 7, 2026 •

Copy link
Copy Markdown
Collaborator Author

Save CI status for the record


CI States

Latest PR Test (Base): ❌ Run #28822209659 (one failed dp attention test)
Latest PR Test (Extra): ✅ Run #28822209464

@merrymercy merrymercy closed this Jul 11, 2026
@merrymercy
merrymercy deleted the lmzheng/prefill-breakable-dp-attention branch August 27, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fastfail run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants