Fix FlyDSL split-k barrier synchronization issue#2877
Open
XiaobingSuper wants to merge 4 commits intomainfrom
Open
Fix FlyDSL split-k barrier synchronization issue#2877XiaobingSuper wants to merge 4 commits intomainfrom
XiaobingSuper wants to merge 4 commits intomainfrom
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
|
Contributor
There was a problem hiding this comment.
Pull request overview
Updates FlyDSL’s split-k HGEMM synchronization to use a per-dispatch 64-bit token protocol (based on dispatch_id) to remain correct under graph replay while reducing host-side state and polling overhead.
Changes:
- Replace rotating split-k “signal state” + int32 counters with an int64 per-dispatch token (
dispatch_id + 1, reserving0as invalid) and release/acquire publish+poll. - Remove host-managed split-k state rotation and shrink the global semaphore to a single int64 counter array.
- Reduce barrier polling overhead by having only
tid==0poll the semaphore and then synchronizing the block withgpu.barrier().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| aiter/ops/flydsl/kernels/splitk_hgemm.py | Switch split-k semaphore publish/poll to int64 dispatch tokens; remove stale-counter cleanup and signal_state plumbing. |
| aiter/ops/flydsl/kernels/small_m_hgemm.py | Mirror the int64 dispatch-token protocol for small-M split-k; remove stale-counter cleanup and signal_state. |
| aiter/ops/flydsl/gemm_kernels.py | Allocate a per-stream int64 semaphore (length 128) and remove host-side rotating split-k state management. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Replace the rotating split-k signal state with a 64-bit dispatch token barrier so split-k launches stay graph-safe and avoid stale-counter races. Narrow the polling and small_m publish waits to vmcnt-only to recover the lost performance while keeping the new protocol stable. Made-with: Cursor
bf1da7b to
9bfdc55
Compare
This reverts commit 033d8b9.
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.
Summary
Fix FlyDSL split-k barrier synchronization issue for graph mode