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
Build GPU code only for arch enabled in Kokkos with HIP #652
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.
Do we always need this code or only when using rocthrust?
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.
I don't understand how this works.
- Where is
GPU_TARGETS
used? - Why do we need to do this for HIP and not CUDA?
- Why do we need to do this in ArborX and not inherit it from the built Kokkos?
It influences the |
No you are right, only when using rocThrust |
include(CMakeDependentOption) | ||
cmake_dependent_option(ARBORX_ENABLE_ROCTHRUST "Enable rocThrust support" ON "Kokkos_ENABLE_HIP" OFF) | ||
if(Kokkos_ENABLE_HIP AND ARBORX_ENABLE_ROCTHRUST) | ||
set_amd_gpu_target() |
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.
@Rombur let me know what you think about the function.
We would need to put in a separate CMake file that gets installed and call it again in our exported configuration before finding the rocThrust dependency.
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.
ping @Rombur
What do we need to do to move forward with this PR? |
I think for now we should stick with configuring with |
Can we use any of kokkos/kokkos#5327 here? |
I don't think so. The fist message in that PR is wrong btw. This is not how |
if(VEGA900 IN_LIST Kokkos_ARCH) | ||
set(Kokkos_AMD_GPU_TARGET gfx900) | ||
elseif(VEGA906 IN_LIST Kokkos_ARCH) | ||
set(Kokkos_AMD_GPU_TARGET gfx906) | ||
elseif(VEGA908 IN_LIST Kokkos_ARCH) | ||
set(Kokkos_AMD_GPU_TARGET gfx908) | ||
elseif(VEGA90A IN_LIST Kokkos_ARCH) | ||
set(Kokkos_AMD_GPU_TARGET gfx90a) | ||
else() | ||
message(WARNING "GPU device code will be built for all architectures suported by ROCm.") | ||
return() | ||
endif() |
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 is no longer necessary with kokkos/kokkos#5925
Closing since this is being addressed in Kokkos from release 4.3 |
I realized we were compiling the code for all supported architectures because build time is ridiculous and more particularly I was getting warnings multiple times.
To be honest I am not sure yet what is the best way to do this. For reference see https://github.com/ROCm-Developer-Tools/hipamd/blob/0d7eebeccaa4afd58b8ebddd5c6304e0eef0b422/hip-config.cmake.in#L166 and https://rocmdocs.amd.com/en/latest/Installation_Guide/Using-CMake-with-AMD-ROCm.html#using-hip-in-cmake