Repository navigation
[Fix] moe: Avoid stale prefix reads in ep_scatter - #44974
Conversation
This comment has been minimized.
This comment has been minimized.
|
@BBuf Could you help review this fix and enable CI? We hit this crash on H20, and the affected code is still unchanged on latest main. Regression tests and memcheck passed locally. Thanks! |
|
[BBuf Review Agent] @Degeneracy-Evil The current title already matches the required format, so no title change is needed. The local regression and memcheck results are enough to proceed with CI. |
BBuf
left a comment
There was a problem hiding this comment.
[BBuf Review Agent] LGTM. Let's wait for the related kernel CI.
|
/tag-and-rerun-ci |
|
/rerun-failed-ci |
2 similar comments
|
/rerun-failed-ci |
|
/rerun-failed-ci |
|
[BBuf Review Agent] @Degeneracy-Evil these still fail after a rerun, and I can't tell from the logs whether it's this PR. Could you take a look?
|
|
@BBuf I checked the full GB300 log. The first error is an int32 overflow in The multimodal padding values can exceed the int32 range, while this history copy uses The test uses Based on the logs and code path, this appears to be a separate multimodal/Engram issue. I have not reproduced it locally on GB300. |
|
[BBuf Review Agent] @Degeneracy-Evil Agreed, this test bypasses |
We hit an illegal memory access while running GLM-5.3-Flash + DFlash2 with TP8 on H20. We traced it to
_fwd_kernel_ep_scatter_1.In this kernel, every program writes the full expert offset table, then reads its own offset back from global memory. The writes and reads are not properly synchronized, so the read can return a stale value.
This PR follows the approach in #31930: compute the current offset directly from the expert token counts, and have each program write only its own entry. This avoids the stale read and removes the repeated full-table writes.
Testing
To run the tests:
The kernel was faster in isolated tests than the approach in #31930. We did not see a noticeable end-to-end speedup over our earlier correctness-only patch. Full model accuracy evaluation has not been run.
Related: #31929, #31930.
CI States
Latest PR Test (Base): ❌ Run #39146060498
Latest PR Test (Extra): ❌ Run #39146060499
Latest PR Test (AMD ROCm 10): ❌ Run #39146060473
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: