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] Add vec<bfloat16> support to math builtins #14002

Merged
merged 16 commits into from
Jun 7, 2024

Conversation

uditagarwal97
Copy link
Contributor

@uditagarwal97 uditagarwal97 commented Jun 1, 2024

This PR

  1. Updates extension to add math builtins for vec<bfloat16> and corresponding swizzles.
  2. Implements unoptimized support for vec<bloat16>/swizzles in math builtins and adds a test case for the same.
  3. Adds a test to check the device code generated for vec<bloat16> math builtins.

I will make a follow-up PR to optimize vec<bfloat16> math builtins. I think we can use elementwise builtins for ext_vector_type (https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors) to optimize vec<bfloat16> math builtins. The device code test case will help visualizing/reviewing math builtin optimizations.

@uditagarwal97 uditagarwal97 marked this pull request as ready for review June 1, 2024 05:47
@uditagarwal97 uditagarwal97 requested review from a team as code owners June 1, 2024 05:47
to clarify vec/swizzle overloads of isnan, fma, and fmax
by clarifying log/expr/rint/trunc overloads for vec<bfloat16>
} // namespace sycl::ext::oneapi::experimental
```

===== Description
====== Overloads (1) and (2)
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for these numbered descriptions.

Copy link
Contributor

@asudarsa asudarsa left a comment

Choose a reason for hiding this comment

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

Changes to BFloat16 test looks good. Thanks

to align bfloat16 builtins documentation with that of SYCL
@uditagarwal97
Copy link
Contributor Author

Changes to BFloat16 test looks good. Thanks

Thanks. I've augmented the test case to also add the tests for builtin overloads accepting swizzles.

Copy link
Contributor

@asudarsa asudarsa left a comment

Choose a reason for hiding this comment

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

Looks good from the DPC++ Tools 9offload utilities) perspective

Thanks

@uditagarwal97
Copy link
Contributor Author

Linux Gen12 failures are unrelated:

Failed Tests (2):
  SYCL :: Basic/submit_time.cpp
  SYCL :: syclcompat/memory/memory_management_test3.cpp

Basic/submit_time.cpp seems like a flaky failure. Also, reported in #13591 (comment)
syclcompat/memory/memory_management_test3.cpp is reported in #14086

@intel/llvm-gatekeepers the PR is ready to be merged!

@steffenlarsen steffenlarsen merged commit b925bd8 into intel:sycl Jun 7, 2024
14 of 15 checks passed
ianayl pushed a commit to ianayl/sycl that referenced this pull request Jun 13, 2024
This PR
1. Updates extension to add math builtins for `vec<bfloat16>` and
corresponding swizzles.
2. Implements **unoptimized** support for `vec<bloat16>`/swizzles in
math builtins and adds a test case for the same.
3. Adds a test to check the device code generated for `vec<bloat16>`
math builtins.

I will make a follow-up PR to optimize `vec<bfloat16>` math builtins. I
think we can use elementwise builtins for `ext_vector_type`
(https://clang.llvm.org/docs/LanguageExtensions.html#vectors-and-extended-vectors)
to optimize `vec<bfloat16>` math builtins. The device code test case
will help visualizing/reviewing math builtin optimizations.
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.

5 participants