-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use target attached on gpu module when lowering #1666
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, looks fine, just wanted to flag the need for the upgrade path
@@ -42,7 +42,6 @@ void configureGpuToROCDLConversionLegality(ConversionTarget &target); | |||
/// is configurable. | |||
std::unique_ptr<OperationPass<gpu::GPUModuleOp>> | |||
createLowerGpuOpsToROCDLOpsPass( | |||
const std::string &chipset = "gfx900", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backwards compatibity/other people using the pass/..., keep this, but use a default value that's something like target
or infer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added "infer" option
Since this is NFC, I d rather land it upstream first -- so to avoid further changes (if any) from upstream comments that'd be upon the next upstream merge. |
} | ||
const ROCDL::ROCDLTargetAttr targetAttr = | ||
mlir::dyn_cast<ROCDL::ROCDLTargetAttr>(targets.getValue().front()); | ||
maybeChipset = amdgpu::Chipset::parse(targetAttr.getChip()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this and failed(maybeChipset) is almost the same as the "else" code. Could we set chipset=targetAttr.getChip() and move it out of if/else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
efd63a4
to
c966d3b
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #1666 +/- ##
===========================================
- Coverage 78.00% 77.96% -0.05%
===========================================
Files 98 98
Lines 26498 26499 +1
Branches 3809 3809
===========================================
- Hits 20671 20660 -11
+ Misses 4311 4301 -10
- Partials 1516 1538 +22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Moves
rocdl-attach-target
beforeconvert-gpu-to-rocdl
pass.rocdl-attach-target
would add target attributes on gpu module which are then read duringconvert-gpu-to-rocdl
Solves Task 1 of https://github.com/ROCm/rocMLIR-internal/issues/1534