Skip to content
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

[SYCL][CUDA] Add no-fast-math to tests that rely on it. #9889

Merged
merged 4 commits into from
Jul 10, 2023

Conversation

JackAKirk
Copy link
Contributor

Same as #9419. This updates a few tests that were missed where the fast-math flag affects at least the cuda backend. These tests assume no-fast-math precision.

Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
@JackAKirk JackAKirk requested a review from a team as a code owner June 14, 2023 21:38
@aelovikov-intel
Copy link
Contributor

@JackAKirk , can you please merge latest origin/sycl? There were some changes with the lint CI task today, I hope the testing would work after the merge.

@JackAKirk JackAKirk temporarily deployed to aws June 15, 2023 10:27 — with GitHub Actions Inactive
@JackAKirk
Copy link
Contributor Author

@JackAKirk , can you please merge latest origin/sycl? There were some changes with the lint CI task today, I hope the testing would work after the merge.

Thanks, I've done this now.

@JackAKirk JackAKirk temporarily deployed to aws June 15, 2023 11:06 — with GitHub Actions Inactive
@JackAKirk JackAKirk changed the title [SYCL][CUDA] Add fno-fast-math to tests that rely on it. [SYCL][CUDA] Add no-fast-math to tests that rely on it. Jun 16, 2023
Signed-off-by: JackAKirk <jack.kirk@codeplay.com>
@JackAKirk JackAKirk temporarily deployed to aws June 27, 2023 10:46 — with GitHub Actions Inactive
@JackAKirk JackAKirk temporarily deployed to aws June 27, 2023 11:20 — with GitHub Actions Inactive
@JackAKirk JackAKirk temporarily deployed to aws July 10, 2023 09:22 — with GitHub Actions Inactive
@JackAKirk
Copy link
Contributor Author

@cperkinsintel Would you be able to review this please?

@JackAKirk JackAKirk temporarily deployed to aws July 10, 2023 09:57 — with GitHub Actions Inactive
@aelovikov-intel
Copy link
Contributor

Modified E2E tests pass in the pre-commit.

@aelovikov-intel aelovikov-intel merged commit fde72c6 into intel:sycl Jul 10, 2023
10 of 12 checks passed
// REQUIRES: aspect-ext_oneapi_bfloat16_math_functions
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend --cuda-gpu-arch=sm_80 %} %s -o %t.out
// RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %if any-device-is-cuda %{ -Xsycl-target-backend --cuda-gpu-arch=sm_80 %} %s -o %t.out %{mathflags}
Copy link
Contributor

Choose a reason for hiding this comment

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

@JackAKirk - I'm working with this test and on our slightly older shared CUDA dev machines sm_80 gets rejected. But with sm_75 the test both compiles and behaves as expected.

Can I just switch this to sm_75 ? Or, better yet, given that we have a REQUIRES: aspect-ext_oneapi_bfloat16_math_functions in this test, can the whole %if any-device-is-cuda ... %} block be removed?

Copy link
Contributor Author

@JackAKirk JackAKirk Jan 3, 2024

Choose a reason for hiding this comment

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

The test behaves differently depending on whether it is compiled for sm_xx>=sm_80 or not:

  • sm_80 and above uses some native bfloat16 math instructions
  • below sm_80 always uses generic impls

So I set it to compile with sm_80 flag because this is what the CI has, and allows testing of the native impls.

It is possible to remove the arch flag, and it is probably the best thing to do now that bfloat16 is generically supported, to avoid confusion. Unfortunately this means that the native impls won't be tested automatically via the CI. But I suppose we could test this in release testing.

ext_oneapi_bfloat16_math_functions is really an artifact of earlier times when bfloat16 was not generically implemented for all devices: I think it should be removed.

Thanks

Copy link
Contributor

@cperkinsintel cperkinsintel Jan 3, 2024

Choose a reason for hiding this comment

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

Given that, I think I'll have it test both and add a comment summarizing what you just said. Or, at minimum, the comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants