Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

[SYCL][CUDA] Add SM version check to bfloat16 CUDA test #1423

Merged
merged 2 commits into from
Nov 29, 2022

Conversation

steffenlarsen
Copy link

bfloat16 requires SM80 on the CUDA backend. This commit changes CUDA tests to do an early exit if that requirement is not met.

bfloat16 requires SM80 on the CUDA backend. This commit changes CUDA
tests to do an early exit if that requirement is not met.

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@JackAKirk
Copy link

JackAKirk commented Nov 29, 2022

So bfloat16 doesn't require SM80 on the CUDA backend since intel/llvm#6524. I wrote in #6524 that we should now remove the bfloat16_type_cuda.cpp test, since the only difference is that it used the bfloat16 aspect, and they decided that they didn't want to make the aspect a requirement of using bfloat16.

The bfloat16_type.cpp test compiles and runs for me using:

clang++ -fsycl -fsycl-targets=nvptx64-nvidia-cuda bfloat16_type.cpp -o res

You get the PI_ERROR_INVALID_BINARY if you try to run on cuda without passing the correct triple.

So I think you should allow bfloat16_type.cpp to run on cuda and delete bfloat16_type_cuda.cpp

For HIP that is an interesting question: I think that it also should support the bfloat16 class fully, but I dont have an AMD machine handy to check. I guess that it also failed previously due to not passing the triple. Is the HIP AMD CI is working atm?

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
@@ -1,12 +1,13 @@
// RUN: %if cuda %{%clangxx -fsycl -fsycl-targets=%sycl_triple -DUSE_CUDA_SM80=1 -Xsycl-target-backend --cuda-gpu-arch=sm_80 %s -o %t.out %}
// RUN: %if cuda %{%GPU_RUN_PLACEHOLDER %t.out %}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So there is an sm_80 in the CI now? Useful to know.

Copy link
Author

@steffenlarsen steffenlarsen Nov 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is, but with the check we just skip if the device does not support it. I'd argue it is generally a bad practice to write the tests in a way that makes them dependent on what we have in CI, as anyone running it on other systems would see failures if we do. You could argue though that skipping without more information than a hidden message is also a bad practice, but in my opinion it is the lesser evil. 😄

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. Yeah make sense thanks!

@steffenlarsen
Copy link
Author

Thanks for clarifying, @JackAKirk! In that case I don't see why we would need the builtin_type_cuda.cpp variant anymore, so I've changed it so that it just uses builtin_type.cpp. Additionally, I've changed it so it tries to run the SM80 build on CUDA but skips if the device doesn't support it.

@JackAKirk JackAKirk self-requested a review November 29, 2022 12:27
@pvchupin pvchupin merged commit 80d18fc into intel:intel Nov 29, 2022
myler pushed a commit to myler/llvm-test-suite that referenced this pull request Mar 22, 2023
* [SYCL][CUDA] Add SM version check to bfloat16 CUDA test

bfloat16 requires SM80 on the CUDA backend. This commit changes CUDA
tests to do an early exit if that requirement is not met.
* Remove CUDA specific test and try run SM80

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Mar 27, 2023
…est-suite#1423)

* [SYCL][CUDA] Add SM version check to bfloat16 CUDA test

bfloat16 requires SM80 on the CUDA backend. This commit changes CUDA
tests to do an early exit if that requirement is not met.
* Remove CUDA specific test and try run SM80

Signed-off-by: Larsen, Steffen <steffen.larsen@intel.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants