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

Fix array API inspection behavior with device keyword #1979

Merged
merged 4 commits into from
Jan 24, 2025

Conversation

ndgrigorian
Copy link
Collaborator

@ndgrigorian ndgrigorian commented Jan 23, 2025

This PR proposes changing the handling of the device keyword in the array API inspection utilities to:

  • raise a more helpful exception for unexpected inputs
  • work correctly with filter strings and SyclQueues

Also fixes the dtypes utility returning complex128 in its output when the provided device does not support double precision types.

Resolves #1978 , resolves #1977

  • 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?
  • If this PR is a work in progress, are you opening the PR as a draft?

* Fixes a bug where `"complex128"` was present in the list of dtypes on devices without fp64 support
* Fixes functionality of device keyword for SyclQueue and strings
* Improves error message when device keyword cannot be used to construct a SyclDevice instance
* Tweaks docstring for device keywords in inspection utilities
Copy link

github-actions bot commented Jan 24, 2025

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

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310h93fe807_493 ran successfully.
Passed: 894
Failed: 2
Skipped: 118

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310h93fe807_494 ran successfully.
Passed: 894
Failed: 2
Skipped: 118

@coveralls
Copy link
Collaborator

coveralls commented Jan 24, 2025

Coverage Status

coverage: 88.24% (+0.06%) from 88.18%
when pulling 06f266c on fix-device-keyword-in-array-api-inspection
into c5cbb08 on master.

@ndgrigorian ndgrigorian marked this pull request as ready for review January 24, 2025 05:24
@ndgrigorian
Copy link
Collaborator Author

@antonwolfy
This is now ready for your review

Copy link

Array API standard conformance tests for dpctl=0.19.0dev0=py310h93fe807_496 ran successfully.
Passed: 894
Failed: 2
Skipped: 118

Copy link
Collaborator

@antonwolfy antonwolfy left a comment

Choose a reason for hiding this comment

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

I checked with dpnp changes added in dpnp-2275 and it works as expected now.
Thank you @ndgrigorian for a quick fix. LGTM!

@ndgrigorian ndgrigorian merged commit 7bc3d80 into master Jan 24, 2025
72 of 74 checks passed
@ndgrigorian ndgrigorian deleted the fix-device-keyword-in-array-api-inspection branch January 24, 2025 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants