Skip to content

Update dpnp.isclose with scalar-specific SYCL kernels #2540

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

Open
wants to merge 34 commits into
base: master
Choose a base branch
from

Conversation

vlad-perevezentsev
Copy link
Collaborator

This PR suggests updating dpnp.isclose() function adding a scalar-specific SYCL kernels for both contiguous and stride cases to improve performance when rtol and atol are scalars.
Also extends and updates tests for dpnp.isclose()

The new kernel improves performance by up to 10x compared to the previous implementation when rtol and atol are scalars (tested on PVC).

CPU results:
image

GPU results:
image

  • 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?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

Copy link
Contributor

View rendered docs @ https://intelpython.github.io/dpnp/pull/2540/index.html

Copy link
Contributor

github-actions bot commented Jul 25, 2025

Array API standard conformance tests for dpnp=0.19.0dev2=py313h509198e_36 ran successfully.
Passed: 1227
Failed: 0
Skipped: 9

@antonwolfy antonwolfy added this to the 0.19.0 release milestone Jul 29, 2025
@coveralls
Copy link
Collaborator

coveralls commented Jul 30, 2025

Coverage Status

coverage: 71.79% (-0.3%) from 72.108%
when pulling 248e066 on update_isclose
into 30918e4 on master.

if (nd == 1 && simplified_a_strides[0] == 1 &&
simplified_b_strides[0] == 1 && simplified_res_strides[0] == 1)
{
// Special case of contiguous data
Copy link
Contributor

Choose a reason for hiding this comment

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

seems no test is covering that

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