-
Notifications
You must be signed in to change notification settings - Fork 62
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
Remove FindHIP and use hip-config.cmake instead #526
Conversation
This seems like a substantial improvement. A breaking change, but a substantial improvement nevertheless. |
Yup, two major changes:
I don't think people were using hip->nvcc anyway, and we can revisit that with the builtin CMake HIP support. |
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.
Not a review (yet), but please update the RELEASE-NOTES
with this change, especially since it seems like a breaking change.
Some other questions:
- does this require a specific version of CMake ?
- will this PR necessitate a new BLT release?
It probably requires a specific version of rocm, but at least from my testing 3.14+ works just fine in cmake. I don't tend to keep any lower around so I can't speak to that. |
Tom's right, just a specific HIP/rocm version, but I have checked back a long way and the file was there, so I think we should be good to go. The change is only breaking due to target names so if there was a way to avoid that I think it would be preferable. Happy to take suggestions. If not, I think a release would be appropriate to make it easy to do things like Spack packages (things would have to be conditional based on BLT version). |
I personally think it would be worth it, but maybe lumped in with a rework so cuda can be used the same way? Or as an experimental option under a flag until it can be consistent? FWIW I actually really like the blt::<target> convention. It makes it more clear what’s going on, and makes it more discoverable with searches and completion for example.
|
Hey folks I would be interested in getting this merged. Kenny mentioned updating release notes, but I think the fact that this requires namespacing the targets requires some more discussion. I'm happy to add the namespaces (and alias) to the other imported BLT targets for consistency, and we can deprecate the non-namespaced versions. Thoughts? |
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 does seem like a really nice cleanup of the hip setup and logic.
- I like the
blt::hip
namespace change - For consistency, we should probably do the same to our other similar targets, e.g.
nvcc
,mpi
,openmp
, ...- I agree that we should think about/discuss these changes
- Since this is a breaking change, we should also consider creating a new release.
- In the meantime, it should definitely be documented in our
RELEASE-NOTES
Since I have less familiarity with some of the implications, I'll wait on others to approve this before me.
Edit: Clarifying my second bullet -- if we are going to require people to update their build systems to accommodate the blt::hip
namespace change, and are thinking about doing similar things for other dependencies, like nvcc
, it would probably be a good idea to do it all at once.
@@ -59,9 +59,6 @@ mark_as_advanced(ENABLE_CLANG_CUDA) | |||
set(BLT_CLANG_CUDA_ARCH "sm_30" CACHE STRING "Compute architecture to use when generating CUDA code with Clang") | |||
mark_as_advanced(BLT_CLANG_CUDA_ARCH) | |||
option(ENABLE_HIP "Enable HIP support" OFF) | |||
cmake_dependent_option(ENABLE_CLANG_HIP "Enable Clang's native HIP support" OFF |
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.
Can you please comment on why ENABLE_CLANG_HIP
is no longer necessary?
Bonus: It seems that we still need ENABLE_CLANG_CUDA
in some cuda cases. Please also comment on that.
It would be nice if we could document some of this, perhaps in a follow up PR.
I tried testing this branch locally on Config and build lines
Warning (seems safe to ignore)
Linker error
Edit: Are you seeing these, or am I doing something wrong? Update: Looks like the warning is related to a static_analysis test and is expected, so we can ignore that one. Update 2: I'm seeing the same error with Here's the full build and link line from cmake/make
|
|
||
set(ROCM_PATH "/opt/rocm-4.1.0/" CACHE PATH "") | ||
set(HIP_PLATFORM "clang" CACHE STRIING "") | ||
|
||
set(BLT_CLANG_HIP_ARCH "gfx908" CACHE STRING "") |
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.
BLT_CLANG_HIP_ARCH
got removed in #521
I think it should be:
set(BLT_CLANG_HIP_ARCH "gfx908" CACHE STRING "") | |
set(CMAKE_HIP_ARCHITECTURES "gfx908" CACHE STRING "") |
@davidbeckingsale -- I discovered that our current hip host-config was also broken and created #537 to fix it for cmake@3.19. It's still not working correctly for cmake@3.21. See also #536 |
Thanks @kennyweiss for taking a look at this. I'll make the changes you have suggested and will investigate the build issue - I have a hunch as to where it might be coming from. |
Patch hip::device target to allow compilation/running without FindHIP
Just FYI, this fixes a really obnoxious bug for us in "Kokkos + Perfsuite interoperability" land. So if it hits credibility on your side, we'd love to see a merge (and ideally then a merge of that BLT into RAJA, and that RAJA into Perfsuite, if you're feeling charitable :) ) |
@DavidPoliakoff that's the plan. a few folks are out on vacation until the middle of next week. we'll work on a perf suite release after that. Actually, it looks like the next BLT release will not come out until after the new year. So it will be a while before this gets pulled into RAJA repos. |
cmake/thirdparty/SetupHIP.cmake
Outdated
DEFINES ${_hip_compile_defines} | ||
COMPILE_FLAGS ${_hip_compile_flags}) | ||
if (NOT ROCM_PATH) | ||
find_path(ROCM_PATH |
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.
indent
I'm encountering the following errors during configuration when using this branch in the blt submodule for
|
That error is peculiar, what version of cmake are you using? |
Lots of us have hit this - a target that is not imported cannot have BLT provides an option to export the tpl targets (meaning they can't be created as imported libraries) - this error appears when the option BLT_EXPORT_THIRDPARTY is On. |
Imported or ALIAS, can we name the target |
Great idea! I think that should work. |
For the export targets issue: When used downstream, aren't projects exporting blt's targets into their own namespaces anyway? If we called these They would be namespaces, but protected in the scope of the imported project. |
This is good to merge pending someone else's review and my couple changes. Also please update the release notes and this page Thanks @davidbeckingsale ! |
Good catch, will do. |
Co-authored-by: Chris White <white238@llnl.gov>
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.
Thanks for working through this @davidbeckingsale !
.. note:: The recommended usage of the HIP targets is via the ``blt::hip`` and | ||
``blt::hip_runtime`` aliases. Alias targets cannot be exported, so the | ||
``blt_hip``/``blt_hip_runtime`` names can be used for this purpose. | ||
|
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.
Should we mention anything about the underlying targets, and if those are still available for users?
(I think those are hip::host
and hip::device
, but I'm not sure)
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.
They are available, but hip::host
actually seems broken (missing include) so I don't think we should recommend it.
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.
The behavior would also be different would it not?
I admit I'm wondering, especially with this doc change, if having the aliases is worth it since now there's a split between at least two uses. Should it just always be blt_<backend>
perhaps rather than have both? At least that way it can be made consistent everywhere. Really not fond of how aliases only kinda-sorta work across projects like this.
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.
😭
Installing a target provided by BLT is a pretty specific use case that afaik only a couple of projects are doing. Using blt_<backend>
is fine but just looks wrong to me, I feel like the namespaced target is correct since we want people to think of them as imported targets.
Co-authored-by: Chris White <white238@llnl.gov>
No description provided.