-
Notifications
You must be signed in to change notification settings - Fork 405
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
Allow using the SYCL execution space on AMD GPUs #6321
Conversation
Intended for testing purposes only and hence requires the UNSUPPORTED_ARCH flag to be set (prefer the HIP execution space for these GPUs).
Can one of the admins verify this patch? |
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 reasonable to me. I personally wouldn't go so far for us to set CI up, maybe other than a nightly? In the end we are a bit resource constrained during PR testing.
@@ -573,7 +573,7 @@ FUNCTION(CHECK_CUDA_ARCH ARCH FLAG) | |||
ENDIF() | |||
SET(CUDA_ARCH_ALREADY_SPECIFIED ${ARCH} PARENT_SCOPE) | |||
IF (NOT KOKKOS_ENABLE_CUDA AND NOT KOKKOS_ENABLE_OPENMPTARGET AND NOT KOKKOS_ENABLE_SYCL AND NOT KOKKOS_ENABLE_OPENACC) | |||
MESSAGE(WARNING "Given CUDA arch ${ARCH}, but Kokkos_ENABLE_CUDA, Kokkos_ENABLE_OPENACC, and Kokkos_ENABLE_OPENMPTARGET are OFF. Option will be ignored.") | |||
MESSAGE(WARNING "Given CUDA arch ${ARCH}, but Kokkos_ENABLE_CUDA, Kokkos_ENABLE_SYCL, Kokkos_ENABLE_OPENACC, and Kokkos_ENABLE_OPENMPTARGET are OFF. Option will be ignored.") |
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 think we left this off here intentionally since its unsupported.
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.
@masterleinad 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.
On the other hand we print them above, so I guess could go either way.
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 think it makes sense to print SYCL
in the warning as well.
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 reasonable to me (but we won't maintain support or promise SYCL to work on AMD GPUs).
OK to test. |
Thanks for the feedback! One more thing: I noticed that one of the tests failed due to some trailing whitespaces I missed in cmake/kokkos_arch.cmake. I have fixed that in the last commit just now! |
This pull request adds the changes necessary to run the Kokkos SYCL execution space on AMD GPUs (if
Kokkos_ENABLE_UNSUPPORTED_ARCH=ON
).Of course, I realize that this is not the intended execution space for AMD GPUs (hence I made sure it cannot be used without
Kokkos_ENABLE_UNSUPPORTED_ARCH
). However, I needed these changes as I adapted the toolchain of our own simulation (which uses Kokkos) for SYCL and dpcpp but lacked access to an Intel GPU as yet - hence, I wanted to test it on an AMD MI100.The changes required to do this with Kokkos are quite minimal; one simply has to make sure the correct AMD architecture flags are passed to dpcpp (as outlined here). Note that the logic to similarly run the SYCL execution space on NVIDIA devices already existed in
cmake/kokkos_arch.cmake
, I merely adapted it to also work for AMD GPUs.I tested it (using our simulation Octo-Tiger) with dpcpp/2023-03 on a MI100 and everything seems to work fine! I figured it might be useful to other people as well, even if just for testing/benchmark purposes, hence this PR!