Skip to content

[ROCDL] Add arch-aware universal s_waitcnt - #915

Merged
coderfeli merged 3 commits into
mainfrom
pr/enh-arch-aware-waitcnt
Jul 28, 2026
Merged

[ROCDL] Add arch-aware universal s_waitcnt#915
coderfeli merged 3 commits into
mainfrom
pr/enh-arch-aware-waitcnt

Conversation

@sjfeng1999

Copy link
Copy Markdown
Collaborator

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_waitcnt plus 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.

Comment thread python/flydsl/expr/rocdl/__init__.py
Comment thread python/flydsl/expr/rocdl/universal.py Outdated
Comment thread python/flydsl/expr/rocdl/universal.py
Comment thread python/flydsl/expr/rocdl/universal.py
Comment thread python/flydsl/expr/rocdl/rdna3.py Outdated
Comment thread python/flydsl/expr/rocdl/rdna4.py Outdated
Comment thread python/flydsl/expr/rocdl/cdna3.py Outdated
Comment thread python/flydsl/expr/rocdl/universal.py
sjfeng1999 and others added 2 commits July 28, 2026 04:08
Avoid hiding existing atom types behind a restrictive export list and dispatch CDNA wait counters correctly.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread python/flydsl/expr/rocdl/universal.py
@coderfeli
coderfeli merged commit 592d568 into main Jul 28, 2026
15 checks passed
@coderfeli
coderfeli deleted the pr/enh-arch-aware-waitcnt branch July 28, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants