Sync upstream through PR #441: fix Mega MoE scheduler ordering - #16
Merged
Merged
Conversation
* Public release 26/09 * Update News
Import the task-info slot release ordering fix at 78b6900 and update the sync documentation. Resolve prior-release conflicts by preserving the fork tree from PR #15, verified identical to its original merge at 38eb89f, then applying the exact upstream delta since PR deepseek-ai#432.
There was a problem hiding this comment.
Risk: medium. Left a non-blocking comment; no approval and no reviewers assigned. This CTA acquire/release fence in Mega MoE release_task_info is a GPU scheduler ordering change that exceeds the low-risk auto-approve threshold, so human review is needed. Bugbot completed with no findings; Cursor Security Agent was not present.
Sent by Cursor Approval Agent: Pull Request Approver
yanzunh
approved these changes
Sep 15, 2026
yanzunh
left a comment
There was a problem hiding this comment.
Do we usually add unit tests for these
Author
|
this is just a copy of the upstream. should be fine. |
This was referenced Sep 20, 2026
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.


The Mega MoE scheduler could release a task-info slot before its metadata reads finished, allowing the scheduler to overwrite metadata still in use. Sync with upstream
mainat78b69000794d0937b47ae3387eff7663410264d1(deepseek-ai/DeepGEMM#441), which adds a CTA acquire/release fence before signaling slot reuse. Both BF16 and FP8/FP4 Mega MoE use this scheduler.The runtime diff is exactly upstream’s seven-line fix; all existing fork changes are preserved. Update the sync documentation to record PR deepseek-ai#441.
History
The previous sync (#15) was squash-merged. Its tree is identical to the original sync merge
38eb89f, which already contains upstream through deepseek-ai#432. Resolve the resulting prior-release conflicts by retaining that integrated fork tree and applying only the upstream delta since deepseek-ai#432. Both the current forkmain(8d785f7) and upstreammainare ancestors of this merge.Please land using a merge commit to retain upstream ancestry for future syncs.
Validation
git diff --checkpassed.Note
Medium Risk
Targets a real concurrency bug in Mega MoE scheduling; the change is small but affects synchronization on all BF16/FP8/FP4 Mega MoE kernels.
Overview
Syncs upstream through PR deepseek-ai#441 to fix a Mega MoE scheduler race: consumers could signal a task-info pipeline slot as free before finishing metadata reads, so the scheduler could overwrite
task_infosstill in use.Adds
ptx::fence_acq_rel_cta()(fence.acq_rel.cta) inld_st.cuhand invokes it inMegaMoEScheduler::release_task_info()immediately before the empty-barrierarrive, so metadata reads complete before slot reuse. BF16 and FP8/FP4 paths both callrelease_task_info()and pick up the fix.docs/fork-upstream-sync.mdis updated to record upstream commit78b6900and describe the ordering change.Reviewed by Cursor Bugbot for commit c2e49f5. Bugbot is set up for automated code reviews on this repo. Configure here.