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

Improve interoperability between SyclDevice and DLPack devices #1953

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

Conversation

ndgrigorian
Copy link
Collaborator

@ndgrigorian ndgrigorian commented Jan 4, 2025

This PR proposes improving dpctl's interoperability with DLPack by

  • Adding a new method get_device_id to dpctl.SyclDevice which returns the ordinal ID of a root device
  • Adding new functions dpctl.tensor.dldevice_to_sycldevice and its converse dpctl.tensor.sycldevice_to_dldevice which function as conversions between dpctl.SyclDevices and the DLPack device tuples returned by arr.__dlpack_device__() for some array arr from an arbitrary array library

Closes #1929

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

dpctl/tensor/_dldevice_conversions.py Outdated Show resolved Hide resolved
dpctl/tensor/_dldevice_conversions.py Outdated Show resolved Hide resolved
Copy link

github-actions bot commented Jan 4, 2025

Copy link

github-actions bot commented Jan 4, 2025

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

@ndgrigorian ndgrigorian force-pushed the dlpack-enum-sycl-device-interop branch 2 times, most recently from ac69747 to eb7f4fe Compare January 7, 2025 18:49
Copy link

github-actions bot commented Jan 7, 2025

Array API standard conformance tests for dpctl=0.19.0dev0=py310h93fe807_411 ran successfully.
Passed: 893
Failed: 3
Skipped: 118

@coveralls
Copy link
Collaborator

coveralls commented Jan 7, 2025

Coverage Status

coverage: 87.738% (+0.02%) from 87.716%
when pulling f010c23 on dlpack-enum-sycl-device-interop
into a7ca491 on master.

@ndgrigorian ndgrigorian force-pushed the dlpack-enum-sycl-device-interop branch from eb7f4fe to c529b29 Compare January 7, 2025 22:05
@ndgrigorian ndgrigorian marked this pull request as ready for review January 7, 2025 22:06
Copy link

github-actions bot commented Jan 7, 2025

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

Copy link

github-actions bot commented Jan 9, 2025

Array API standard conformance tests for dpctl=0.19.0dev0=py310h93fe807_415 ran successfully.
Passed: 893
Failed: 3
Skipped: 118

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.

Feature Request: create SyclDevice and attribute to and from dlpack Enum in Python
3 participants