Skip to content
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

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

umangyadav
Copy link
Member

@umangyadav umangyadav commented Sep 30, 2024

Moves rocdl-attach-target before convert-gpu-to-rocdl pass. rocdl-attach-target would add target attributes on gpu module which are then read during convert-gpu-to-rocdl

Solves Task 1 of https://github.com/ROCm/rocMLIR-internal/issues/1534

Copy link
Collaborator

@krzysz00 krzysz00 left a 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",
Copy link
Collaborator

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Added "infer" option

@manupak
Copy link
Contributor

manupak commented Oct 1, 2024

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());
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.96%. Comparing base (82378ac) to head (c966d3b).
Report is 17 commits behind head on develop.

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     
Flag Coverage Δ
mfma 77.96% <100.00%> (-0.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

4 participants