This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][GPU] Make the path to ROCm a runtime option
ClosedPublic

Authored by krzysz00 on Nov 17 2021, 11:21 AM.

Details

Summary

Our current build assumes that the path to ROCm we find at build time
will be the path at which ROCm is located when the built code is
executed. This commit adds a --rocm-path option to SerializeToHsaco,
and removes the HIP dependency that the SerializeToHsaco previously had.

Depends on D114113

(though the dependency is to ensure the diffs apply cleanly and to capture the dependency on D114107)

Diff Detail

Event Timeline

krzysz00 created this revision.Nov 17 2021, 11:21 AM
krzysz00 requested review of this revision.Nov 17 2021, 11:21 AM
mehdi_amini added inline comments.Nov 17 2021, 12:50 PM
mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
71

I think you only need this for the optLevel because it isn't a pass option right now.

89

I think this should be in the parent revision?

93–94

Can you make this a pass option like the other options?

94–100

I'd really rather avoid using environment variable when we have pass options available.

krzysz00 added inline comments.Nov 17 2021, 1:06 PM
mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
93–94

Sure, I can do that. I'll fold that stuff into the parent revision

94–100

This is the clang behavior, which I'm mostly replicating

mehdi_amini added inline comments.Nov 17 2021, 4:37 PM
mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
94–100

If clang or any tool want to load from the environment, that's fine: but from a layering point of view I see it as their responsibility to do so and set it as a pass option when they create the passes.

krzysz00 updated this revision to Diff 388316.Nov 18 2021, 1:54 PM
krzysz00 marked 3 inline comments as done.
  • Address review comments
krzysz00 added inline comments.Nov 18 2021, 1:54 PM
mlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
89

Yep, and the only reason any of this worked is that this whole file was #ifdef'd off with how the CMakeLists.txt was written.

mehdi_amini accepted this revision.Nov 18 2021, 3:57 PM
This revision is now accepted and ready to land.Nov 18 2021, 3:57 PM
krzysz00 updated this revision to Diff 388578.Nov 19 2021, 11:23 AM

Re-push to account for earlier merged patches.

This revision was automatically updated to reflect the committed changes.