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

Initial check-in of some unary and binary elementwise functions #1203

Merged
merged 52 commits into from
May 22, 2023

Conversation

oleksandr-pavlyk
Copy link
Collaborator

@oleksandr-pavlyk oleksandr-pavlyk commented May 8, 2023

This is a draft PR to review/refine implementation of elementwise functions in dpctl.tensor.

This checks in implementations of dpctl.tensor.add, dpctl.tensor.isnan, dpctl.tensor.cos and dpctl.tensor.abs, dpctl.tensor.isinf, dpctl.tensor.isfinite, and dpctl.tensor.divide, and dpctl.tensor.equal.

  • 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

github-actions bot commented May 8, 2023

Corrected/added checks for validity of sub-groups reads/writes.

Added -fno-approx-func flag to compile element-wise functions, as well
as -fno-finite-math-only flag.

Fixed test_cos_order test to account for NumPy using float16 for intermediate
computations for inputs of type "i1", but CPU RT does not support float16.
@coveralls
Copy link
Collaborator

coveralls commented May 9, 2023

Coverage Status

Coverage: 84.034% (+0.6%) from 83.41% when pulling 62f2d46 on feature/elementwise-functions into 634348b on master.

@github-actions
Copy link

github-actions bot commented May 9, 2023

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_51 ran successfully.
Passed: 162
Failed: 838
Skipped: 116

@github-actions
Copy link

github-actions bot commented May 9, 2023

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_52 ran successfully.
Passed: 162
Failed: 838
Skipped: 116

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_54 ran successfully.
Passed: 162
Failed: 838
Skipped: 116

@oleksandr-pavlyk oleksandr-pavlyk changed the title Initial check-in of elementwise functions: abs/cos/isnan/add Initial check-in of elementwise functions: abs/cos/isnan/add/isinf/isfinite May 13, 2023
@oleksandr-pavlyk
Copy link
Collaborator Author

The build failure occurs due to use of int std::isinf(double x). When compiling this with DPC++ and system's GCC 9.4 and sysroot, it goes through fine, but when compiling it with DPC++ and conda GCC 11.2 (or 12.2) and conda's sysroot, it fails to compile.

Using sycl::isinf could be a work-around, but tests fail due to apparent bug in OpenCL CPU RT.

@oleksandr-pavlyk oleksandr-pavlyk mentioned this pull request May 16, 2023
6 tasks
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_82 ran successfully.
Passed: 210
Failed: 790
Skipped: 116

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_103 ran successfully.
Passed: 228
Failed: 772
Skipped: 116

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_104 ran successfully.
Passed: 227
Failed: 773
Skipped: 116

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_105 ran successfully.
Passed: 228
Failed: 772
Skipped: 116

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_106 ran successfully.
Passed: 227
Failed: 773
Skipped: 116

oleksandr-pavlyk and others added 2 commits May 19, 2023 16:40
Also consolidated various *impl_fn_ptr_t which were common among
unary functions, and among binary functions into common reused types.
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_107 ran successfully.
Passed: 228
Failed: 772
Skipped: 116

oleksandr-pavlyk and others added 4 commits May 20, 2023 11:11
Also ensure that test_add_order exercises non-same dtypes to
improve coverage.
…ns-out-keyword

Feature/elementwise functions out keyword
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_114 ran successfully.
Passed: 228
Failed: 772
Skipped: 116

@oleksandr-pavlyk oleksandr-pavlyk force-pushed the feature/elementwise-functions branch from 3cf142e to 62f2d46 Compare May 22, 2023 17:06
@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_115 ran successfully.
Passed: 227
Failed: 773
Skipped: 116

@ndgrigorian ndgrigorian self-requested a review May 22, 2023 19:02
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.

I've looked over the out keyword addition and tested it out.
I think this is ready to be merged. This will be a great addition.

@oleksandr-pavlyk oleksandr-pavlyk merged commit 18d1728 into master May 22, 2023
@oleksandr-pavlyk oleksandr-pavlyk deleted the feature/elementwise-functions branch May 22, 2023 19:08
@github-actions
Copy link

Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞

@github-actions
Copy link

Array API standard conformance tests for dpctl=0.14.3dev1=py310h76be34b_115 ran successfully.
Passed: 228
Failed: 772
Skipped: 116

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.

4 participants