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

x.__dlpack_device__() returns ID of the parent device #1560

Merged
merged 5 commits into from
Feb 26, 2024

Conversation

oleksandr-pavlyk
Copy link
Collaborator

x.__dlpack_device__() returns ID of the parent device, if allocation device is not a root device.

It gives ID (position in sycl::device::get_devices()) for the root device that the array allocation device descends from for sub-devices, or ID of the allocation device is that device is a root device.

This allows sharing through DLPack of allocation on sub-devices, as long as default platform context for the platform the device is from was used in allocation.

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

It gives ID (position in `sycl::device::get_devices()`) for the
root device that the array allocation device descends from for
sub-devices, or ID of the allocation device is that device is a
root device.
Copy link

github-actions bot commented Feb 23, 2024

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

Copy link

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_20 ran successfully.
Passed: 907
Failed: 0
Skipped: 88

@coveralls
Copy link
Collaborator

coveralls commented Feb 23, 2024

Coverage Status

coverage: 91.099% (-0.05%) from 91.148%
when pulling db9dd04 on dlpack-support-sub-device
into a42d5a4 on master.

Copy link

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_23 ran successfully.
Passed: 906
Failed: 1
Skipped: 88

Copy link

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_24 ran successfully.
Passed: 907
Failed: 0
Skipped: 88

Copy link

Array API standard conformance tests for dpctl=0.17.0dev0=py310h15de555_26 ran successfully.
Passed: 907
Failed: 0
Skipped: 88

@oleksandr-pavlyk
Copy link
Collaborator Author

I have verified that this change allows one to share data allocated on the tile, if driver is used in legacy composite device-hierarchy. Newly added test passes for both default and legacy device-hierarchy modes.

@ndgrigorian This PR is ready for final review.

@ndgrigorian ndgrigorian self-requested a review February 26, 2024 19:28
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.

These changes LGTM, thank you @oleksandr-pavlyk !

@oleksandr-pavlyk oleksandr-pavlyk merged commit fe75a16 into master Feb 26, 2024
42 of 44 checks passed
@oleksandr-pavlyk oleksandr-pavlyk deleted the dlpack-support-sub-device branch February 26, 2024 22:28
oleksandr-pavlyk added a commit that referenced this pull request Mar 27, 2024
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