[diffusion] Validate attention backend for Ring Attention in USPAttention#21828
Merged
mickqian merged 1 commit intosgl-project:mainfrom Apr 4, 2026
Merged
[diffusion] Validate attention backend for Ring Attention in USPAttention#21828mickqian merged 1 commit intosgl-project:mainfrom
mickqian merged 1 commit intosgl-project:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a validation check to ensure that Ring Attention is only used with FlashAttention or SageAttention backends when the ring parallel world size is greater than one. Feedback suggests replacing the assert statement with a RuntimeError to ensure the check is always performed even when Python optimizations are enabled, along with a suggestion to refine the error message for better readability.
…tion Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
7692c58 to
1c01e79
Compare
2 tasks
Collaborator
|
/tag-and-rerun-ci |
Collaborator
|
/tag-and-rerun-ci |
Collaborator
|
/rerun-failed-ci |
sundar24295s
pushed a commit
to sundar24295s/sglang
that referenced
this pull request
Apr 4, 2026
…Attention (sgl-project#21828) Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
JustinTong0323
pushed a commit
to JustinTong0323/sglang
that referenced
this pull request
Apr 7, 2026
…Attention (sgl-project#21828) Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Fridge003
pushed a commit
that referenced
this pull request
Apr 7, 2026
…Attention (#21828) Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
xiezhq-hermann
pushed a commit
to antgroup/sglang
that referenced
this pull request
Apr 7, 2026
…Attention (sgl-project#21828) Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
5 tasks
yhyang201
pushed a commit
to yhyang201/sglang
that referenced
this pull request
Apr 22, 2026
…Attention (sgl-project#21828) Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Found this issue in a
MUSAcontainer whereMATEis not installed. Although the validation inServerArgs._adjust_attention_backend()checks at the string level and will pickfafor Ring Attention (if attention backend is not set), when actually resolving the attention backend viaget_attn_backend(), Torch SDPA could still be selected as it is the fallback solution. This leads to silent incorrect behavior or confusing errors downstream.Modifications
Validate attention backend for Ring Attention in USPAttention.
Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci