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

Feature Request: create SyclDevice and attribute to and from dlpack Enum in Python #1929

Open
icfaust opened this issue Dec 10, 2024 · 1 comment · May be fixed by #1953
Open

Feature Request: create SyclDevice and attribute to and from dlpack Enum in Python #1929

icfaust opened this issue Dec 10, 2024 · 1 comment · May be fixed by #1953
Assignees

Comments

@icfaust
Copy link

icfaust commented Dec 10, 2024

There is already functionality for converting SyclDevices into dlpack_device Enums (c_dlpack.get_parent_device_ordinal_id) occurring in Cython. dpctl Tensors also already include a __dlpack_device__, would it be possible to enhance operability with dlpack by including a __dlpack_device__ attribute to SyclDevice, and make a SyclDevice creator arg if passed a dlpack enum?

Thanks

@ndgrigorian ndgrigorian self-assigned this Dec 10, 2024
@ndgrigorian
Copy link
Collaborator

I've started work on this feature. Would it be sufficient for your needs for dpctl.tensor to expose two functions for interchanging a DLPack device with a SyclDevice or a dpctl.tensor.Device?

Something like

import dpctl.tensor as dpt

dev = dpctl.SyclDevice("*:cpu")
dlpack_dev = dpt.create_dlpack_device(dev)

and its converse (making a root SyclDevice from a DLPack device type).

This avoids creating a dependency between dpctl.SyclDevice and DLPack functionality, i.e., defining device type enumerators in the dpctl namespace.

@ndgrigorian ndgrigorian linked a pull request Jan 4, 2025 that will close this issue
8 tasks
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 a pull request may close this issue.

2 participants