[ROCDL] Add arch-aware universal s_waitcnt - #915
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an arch-aware s_waitcnt helper under flydsl.expr.rocdl and standardizes ROCm arch strings to be lower-case so downstream arch dispatch can compare against canonical gfx* prefixes.
Changes:
- Normalize
get_rocm_arch()to always return a lower-cased arch string. - Add
s_waitcntplus per-arch encoders for CDNA3 and RDNA3/4 (gfx11/gfx120). - Re-export the new universal helper(s) from
flydsl.expr.rocdl.__init__.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| python/flydsl/runtime/device.py | Lower-case normalization of detected/overridden ROCm arch strings. |
| python/flydsl/expr/rocdl/utils.py | Adds shared normalization/validation helper for s_waitcnt fields. |
| python/flydsl/expr/rocdl/universal.py | Adds arch-aware s_waitcnt API and wires it into the universal ROCDL helpers; adjusts WMMA dispatch to rely on lower-cased arch. |
| python/flydsl/expr/rocdl/rdna4.py | Adds RDNA4 (gfx120*) s_waitcnt immediate packing. |
| python/flydsl/expr/rocdl/rdna3.py | Adds RDNA3 (gfx11*) s_waitcnt immediate packing. |
| python/flydsl/expr/rocdl/cdna3.py | Adds CDNA3 (gfx942) s_waitcnt immediate packing. |
| python/flydsl/expr/rocdl/init.py | Re-exports new helper modules and universal helpers from the ROCDL package. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Avoid hiding existing atom types behind a restrictive export list and dispatch CDNA wait counters correctly. Co-authored-by: Cursor <cursoragent@cursor.com>
coderfeli
reviewed
Jul 28, 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.
Motivation
Technical Details
Test Plan
Test Result
Submission Checklist