Page MenuHomePhabricator

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

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



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

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


I think this should be in the parent revision?


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


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

krzysz00 added inline comments.Nov 17 2021, 1:06 PM

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


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

mehdi_amini added inline comments.Nov 17 2021, 4:37 PM

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

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.