-
-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[BugFix][DP/EP] Fix CUTLASS MLA hang under load #26026
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BugFix][DP/EP] Fix CUTLASS MLA hang under load #26026
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request addresses a potential hang in the CUTLASS MLA kernel under load. The changes are mostly stylistic, involving code re-indentation. However, there is one critical bug fix that changes a cutlass::arch::NamedBarrier::arrive()
call to arrive_and_wait()
. This change correctly resolves a race condition that could lead to a deadlock between compute
and load
warps, which is the likely cause of the hang. My review confirms this fix is correct and critical.
csrc/attention/mla/cutlass_sm100_mla/kernel/sm100_fmha_mla_tma_warpspecialized.hpp
Show resolved
Hide resolved
TODOs (follow-up)
|
746ef1a
to
a36b036
Compare
Co-authored-by: Robert Shaw <robshaw@redhat.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
a36b036
to
3a8a634
Compare
(kNumComputeWarps + kNumLoadWarps) * NumThreadsPerWarp, | ||
kNamedBarrierEpilogue | ||
).arrive(); | ||
).arrive_and_wait(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note for reviewer --- this is the line that fixes the deadlock
Co-authored-by: rshaw@neuralmagic.com <rshaw@neuralmagic.com> Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com>
Failing tests are known on main and being resolved. Blackwell tests are green, merging |
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Robert Shaw <robshaw@redhat.com> Co-authored-by: rshaw@neuralmagic.com <rshaw@neuralmagic.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Robert Shaw <robshaw@redhat.com> Co-authored-by: rshaw@neuralmagic.com <rshaw@neuralmagic.com> Signed-off-by: simon-mo <simon.mo@hey.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Robert Shaw <robshaw@redhat.com> Co-authored-by: rshaw@neuralmagic.com <rshaw@neuralmagic.com>
Signed-off-by: Lucas Wilkinson <lwilkins@redhat.com> Co-authored-by: Robert Shaw <robshaw@redhat.com> Co-authored-by: rshaw@neuralmagic.com <rshaw@neuralmagic.com> Signed-off-by: yewentao256 <zhyanwentao@126.com>
The early return in
compute(
calls arrive:but didn't have any barrier before looping around and calling it again causing a deadlock when the load warps waits on:
Co-authored-by: Robert Shaw robshaw@redhat.com