Skip to content

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

Merged
oleksandr-pavlyk merged 5 commits into
masterfrom
dlpack-support-sub-device
Feb 26, 2024
Merged

oleksandr-pavlyk merged 5 commits into
masterfrom
dlpack-support-sub-device

Conversation

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor

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.
@github-actions

github-actions Bot commented Feb 23, 2024 •

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

@coveralls

coveralls commented Feb 23, 2024 •

Copy link
Copy Markdown
Collaborator

Coverage Status

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

@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

@oleksandr-pavlyk

Copy link
Copy Markdown
Contributor 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

@ndgrigorian ndgrigorian left a comment

Copy link
Copy Markdown
Collaborator

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
@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