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

Use sycl ext oneapi experimental for complex #1411

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

oleksandr-pavlyk
Copy link
Collaborator

This PR applies functions from sycl::ext:;oneapi::experimental extension to evaluate trigonometric, hyperbolic unary functions and their inverses.

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • If this PR is a work in progress, are you opening the PR as a draft?

@github-actions
Copy link

@coveralls
Copy link
Collaborator

coveralls commented Sep 20, 2023

Coverage Status

coverage: 85.942%. remained the same
when pulling 0efe28b on use-sycl-ext-oneapi-experimental-for-complex
into f772888 on master.

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.0rc1=py310ha25a700_5 ran successfully.
Passed: 915
Failed: 85
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 02fa4de to 8a5788c Compare September 22, 2023 16:36
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.0rc2=py310ha25a700_3 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 8a5788c to 3339d48 Compare September 27, 2023 15:21
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.0rc3=py310ha25a700_5 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 3339d48 to 468110d Compare September 27, 2023 21:48
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.0=py310ha25a700_6 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 468110d to 7c4b0ca Compare September 29, 2023 19:48
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.1dev0=py310ha25a700_9 ran successfully.
Passed: 916
Failed: 84
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 7c4b0ca to 74b3b53 Compare October 6, 2023 16:49
@github-actions
Copy link

github-actions bot commented Oct 6, 2023

Array API standard conformance tests for dpctl=0.15.1dev0=py310ha25a700_14 ran successfully.
Passed: 934
Failed: 66
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 74b3b53 to 6d7d3fe Compare October 11, 2023 16:51
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.1dev0=py310ha25a700_40 ran successfully.
Passed: 935
Failed: 65
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 6d7d3fe to 71b85ab Compare October 14, 2023 20:24
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.1dev0=py310ha25a700_51 ran successfully.
Passed: 935
Failed: 65
Skipped: 119

@ndgrigorian
Copy link
Collaborator

@oleksandr-pavlyk
I've spotted a few cases where std functions are still used on complex values.

std::log

const realT wx = std::real(std::log(in));

resT log_in = (std::signbit(x)) ? std::log(-in) : std::log(in);

std::sinh

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 479a969 to 8555f7d Compare October 26, 2023 22:47
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.1dev0=py310ha25a700_83 ran successfully.
Passed: 935
Failed: 65
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 8555f7d to 49d12ec Compare October 27, 2023 00:57
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.15.1dev0=py310ha25a700_90 ran successfully.
Passed: 935
Failed: 65
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 49d12ec to c90c261 Compare November 5, 2023 22:29
Copy link

github-actions bot commented Nov 5, 2023

Array API standard conformance tests for dpctl=0.15.1dev1=py310ha25a700_2 ran successfully.
Passed: 935
Failed: 65
Skipped: 119

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from c90c261 to affc054 Compare November 9, 2023 02:40
Copy link

github-actions bot commented Nov 9, 2023

Array API standard conformance tests for dpctl=0.15.1dev1=py310ha25a700_14 ran successfully.
Passed: 1021
Failed: 51
Skipped: 50

This works around use of double precision functions/literals in implementations
of these functions in MSVC headers, causing failures to offload on Iris Xe for
single precision input citing lack of fp64 support by the hardware.

Changes include CL/sycl.hpp to sycl/sycl.hpp per SYCL-2020 spec

For every CMake target, where add_sycl_to_target is used, we also run
target_compile_options(
   ${target_name}
   PRIVATE
   -fysl-targets=spir64-unknown-unknown,nvptx64-nvidia-cuda
)

Add DPCTL_TARGET_CUDA Boolean cmake option

Also DPCTL_SYCL_TARGETS parameter can be used to specify targets
to build for.

DPCTL_TARGET_CUDA could be set via cmake option, or via environment
variable, e.g.

```
$ DPCTL_TARGET_CUDA=1 python scripts/build_locally.py --verbose
```

This calls `target_compile_options` to set sycl-targets for targets
needing SYCL
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from affc054 to 6d3be5d Compare November 16, 2023 21:36
Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310h15de555_13 ran successfully.
Passed: 1019
Failed: 55
Skipped: 59

Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310h15de555_14 ran successfully.
Passed: 1019
Failed: 55
Skipped: 59

@oleksandr-pavlyk
Copy link
Collaborator Author

@ndgrigorian ready to merge, please take a look

@oleksandr-pavlyk oleksandr-pavlyk marked this pull request as ready for review November 17, 2023 03:20
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from ac42985 to 0f76890 Compare November 18, 2023 15:06
Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310h15de555_14 ran successfully.
Passed: 1020
Failed: 54
Skipped: 59

Introduced private header to load SYCL's experimental complex header
from the right location. The header and implementations respond to
USE_SYCL_FOR_COMPLEX_TYPES preprocessor variable. If set, sycl::ext::oneapi::experimental
namespace functions are to be used. Otherwise std:: namespace functions will
be used instead for complex types.

USE_SYCL_FOR_COMPLEX_TYPES is being set in tensor/CMakeLists.txt

If USE_SYCL_FOR_COMPLEX_TYPES is not set, std:: functions are used except for
sqrt and abs functions. For abs we use hypot(std::real(z), std::imag(z)) and
for sqrt we use custom implementation on Windows to avoid failure to offload
for single precision type due to unwarranted use of double precision types in
the implementation for single precision inputs iin MS VC headers
@oleksandr-pavlyk oleksandr-pavlyk force-pushed the use-sycl-ext-oneapi-experimental-for-complex branch from 0f76890 to c77344c Compare November 20, 2023 13:07
Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310h15de555_14 ran successfully.
Passed: 1018
Failed: 56
Skipped: 59

Copy link
Collaborator

@ndgrigorian ndgrigorian left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @oleksandr-pavlyk ! Nice to see the internal CI passing again.

Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310h15de555_15 ran successfully.
Passed: 1020
Failed: 54
Skipped: 59

Copy link

Array API standard conformance tests for dpctl=0.15.1dev2=py310h15de555_16 ran successfully.
Passed: 1018
Failed: 56
Skipped: 59

@oleksandr-pavlyk oleksandr-pavlyk merged commit 5ec9fd5 into master Nov 20, 2023
26 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the use-sycl-ext-oneapi-experimental-for-complex branch November 20, 2023 20:52
oleksandr-pavlyk added a commit that referenced this pull request Nov 24, 2023
After transition to oneapi::experimental namespace functions
for complex types in gh-1411, all tests pass.
oleksandr-pavlyk added a commit that referenced this pull request Dec 5, 2023
After transition to oneapi::experimental namespace functions
for complex types in gh-1411, all tests pass.
oleksandr-pavlyk added a commit that referenced this pull request Dec 9, 2023
After transition to oneapi::experimental namespace functions
for complex types in gh-1411, all tests pass.
oleksandr-pavlyk added a commit that referenced this pull request Dec 11, 2023
After transition to oneapi::experimental namespace functions
for complex types in gh-1411, all tests pass.
oleksandr-pavlyk added a commit that referenced this pull request Dec 12, 2023
After transition to oneapi::experimental namespace functions
for complex types in gh-1411, all tests pass.
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