Skip to content

Add missing MKL function from VM namespace #2445

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

Merged
merged 9 commits into from
May 14, 2025
Merged

Conversation

antonwolfy
Copy link
Contributor

@antonwolfy antonwolfy commented May 13, 2025

The PR add missing MKL functions from VM namespace to the dedicated extension:

  • arg() to be used by dpnp.angle
  • copysign()
  • i0()
  • inv() to be used by dpnp.reciprocal

Note, remainder() is available as MKL VM function but follows C's module operator and so can't be used to implement dpnp.remainder which has to follow Python's module operator according to Python array API specification:

This function is equivalent to the Python modulus operator x1_i % x2_i.

Note, sycl::half is not intended to be used for VM functions due to accuracy reason and values mismatch with numpy in corner cases.

  • 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?

@antonwolfy antonwolfy self-assigned this May 13, 2025
Copy link
Contributor

github-actions bot commented May 13, 2025

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

@coveralls
Copy link
Collaborator

coveralls commented May 13, 2025

Coverage Status

coverage: 71.864% (+0.2%) from 71.711%
when pulling 9572332 on add-missing-mkl-vm-funcs
into d75c842 on master.

Copy link
Contributor

github-actions bot commented May 13, 2025

Array API standard conformance tests for dpnp=0.18.0dev2=py312he4f9c94_15 ran successfully.
Passed: 1228
Failed: 1
Skipped: 9

@antonwolfy antonwolfy force-pushed the add-missing-mkl-vm-funcs branch from da8eccc to d09fbdd Compare May 13, 2025 14:31
@antonwolfy antonwolfy force-pushed the add-missing-mkl-vm-funcs branch from d09fbdd to 869adff Compare May 13, 2025 19:46
@antonwolfy antonwolfy added this to the 0.18.0 release milestone May 13, 2025
@antonwolfy antonwolfy marked this pull request as ready for review May 13, 2025 22:05
Copy link
Collaborator

@vtavana vtavana left a comment

Choose a reason for hiding this comment

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

Thank you , @antonwolfy!

antonwolfy and others added 2 commits May 14, 2025 11:22
Co-authored-by: Vahid Tavanashad <120411540+vtavana@users.noreply.github.com>
@antonwolfy antonwolfy merged commit acfc678 into master May 14, 2025
55 of 67 checks passed
@antonwolfy antonwolfy deleted the add-missing-mkl-vm-funcs branch May 14, 2025 11:03
github-actions bot added a commit that referenced this pull request May 14, 2025
The PR add missing MKL functions from VM namespace to the dedicated
extension:
- `arg()` to be used by `dpnp.angle`
- `copysign()`
- `i0()`
- `inv()` to be used by `dpnp.reciprocal`

Note, `remainder()` is available as MKL VM function but follows C's
module operator and so can't be used to implement `dpnp.remainder` which
has to follow Python's module operator according to Python array API
[specification](https://data-apis.org/array-api/2024.12/API_specification/generated/array_api.remainder.html):
> This function is equivalent to the Python modulus operator x1_i %
x2_i.

Note, `sycl::half` is not intended to be used for VM functions due to
accuracy reason and values mismatch with numpy in corner cases. acfc678
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