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
Add support for rocThrust in sort when using HIP #6793
Conversation
@@ -62,6 +62,7 @@ | |||
#cmakedefine KOKKOS_ENABLE_LIBDL | |||
#cmakedefine KOKKOS_ENABLE_LIBQUADMATH | |||
#cmakedefine KOKKOS_ENABLE_ONEDPL | |||
#cmakedefine KOKKOS_ENABLE_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.
You might want to add that setting to HIP::print_configuration()
@masterleinad same comment about KOKKOS_ENABLE_ONEDPL
and SYCL
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.
Let me do that after #6758 is merged.
containers/src/CMakeLists.txt
Outdated
@@ -28,6 +28,9 @@ KOKKOS_LIB_INCLUDE_DIRECTORIES(kokkoscontainers | |||
${CMAKE_CURRENT_BINARY_DIR} | |||
${CMAKE_CURRENT_SOURCE_DIR} | |||
) | |||
|
|||
KOKKOS_LINK_TPL(kokkoscontainers PUBLIC 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.
Why link containers?
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.
My bad, I meant to add this in algorithm.
@@ -0,0 +1,2 @@ | |||
FIND_PACKAGE(rocthrust REQUIRED) | |||
KOKKOS_CREATE_IMPORTED_TPL(ROCTHRUST INTERFACE LINK_LIBRARIES roc::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.
Do we still have the arborx/ArborX#652 issue where the exported rocThrust package potentially adds flags to compile for all GPU architecture it knows about?
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.
At least for the version shipped with ROCm 5.7, it works fine. I see only one architecture.
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.
We need to find out for sure because IIRC compile time blows up
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 looked at another PR it looks like the compile time is indeed 2x more for both 5.2 and 5.6 so we need to handle this and set the GPU_TARGETS
before attempting to find 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.
Looks OK to me.
Just wanted to confirm: will we be able to write something like this downstream and will it work? Including linking to if(Kokkos_ENABLE_HIP)
if(Kokkos_VERSION VERSION_LESS 4.3)
# Do something
else
set(ARBORX_ENABLE_ROCTHRUST ${Kokkos_ENABLE_ROCTHRUST})
endif()
endif() |
containers/src/CMakeLists.txt
Outdated
@@ -28,6 +28,7 @@ KOKKOS_LIB_INCLUDE_DIRECTORIES(kokkoscontainers | |||
${CMAKE_CURRENT_BINARY_DIR} | |||
${CMAKE_CURRENT_SOURCE_DIR} | |||
) | |||
|
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.
Please undo
@@ -0,0 +1,2 @@ | |||
FIND_PACKAGE(rocthrust REQUIRED) | |||
KOKKOS_CREATE_IMPORTED_TPL(ROCTHRUST INTERFACE LINK_LIBRARIES roc::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.
We need to find out for sure because IIRC compile time blows up
This would be useful for LAMMPS; |
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.
Just realized my comment was pending. Sorry about that.
I had mentioned the issue to Bruno in private.
@@ -0,0 +1,2 @@ | |||
FIND_PACKAGE(rocthrust REQUIRED) | |||
KOKKOS_CREATE_IMPORTED_TPL(ROCTHRUST INTERFACE LINK_LIBRARIES roc::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 looked at another PR it looks like the compile time is indeed 2x more for both 5.2 and 5.6 so we need to handle this and set the GPU_TARGETS
before attempting to find rocThrust.
This will be in 4.3 correct? Would be really nice if it supported |
This is the plan yes. Bruno is swamped with something else but will get back to it next week. #6793 (comment) needs to be addressed and then we will merge. |
Rebased on |
Make sure to take https://github.com/kokkos/kokkos/pull/6856/files into account and define
edit: I see that |
This PR is to add support for rocThrust. |
This PR add support for rocThrust. Unlike Thrust, rocThrust is not always installed with HIP. For instance, the docker images do not contain rocThrust unless you use the
-complete
tag. I will note that the 3.0 release of rocThrust is not backward compatible with the 2.X series. This is not an issue for us becausesort
is the same across version but it is problematic if we decide to require a minimum version of rocThrust because then the 3.0 version will be rejected. Since we are not affected by the break of backward compatibility, I've decided to forego the minimum version requirements. In practice, this means that the minimum version of rocThrust is the minimum version that is compatible with ROCm 5.2Once this PR is merged, I'll open a PR to document the new option that enables/disables rocThrust.