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

Add support of usm_ndarray constructor with default dtype on Iris XE #1058

Closed
antonwolfy opened this issue Feb 2, 2023 · 3 comments
Closed
Assignees

Comments

@antonwolfy
Copy link
Collaborator

Currently dpctl creates usm_ndarray with default dtype="|f8" which cause an issue on gpu device without double type support.

The below example code cause an exception for Iris XE:

> import dpctl.tensor as dpt
> dpt.usm_ndarray((10,))

ValueError                                Traceback (most recent call last)
Cell In[3], line 1
----> 1 dpt.usm_ndarray((10,))

File dpctl/tensor/_usmarray.pyx:264, in dpctl.tensor._usmarray.usm_ndarray.__cinit__()

ValueError: Device Intel(R) Graphics [0x9a49] does not support |f8 natively.
@oleksandr-pavlyk oleksandr-pavlyk self-assigned this Feb 2, 2023
oleksandr-pavlyk added a commit that referenced this issue Aug 16, 2023
This changes builds up on gh-1265 and takes into account queue
from the pre-allocated buffer, if provided.
@oleksandr-pavlyk
Copy link
Collaborator

This has been fixed:

In [1]: import dpctl, dpctl.tensor as dpt

In [2]: dpt.usm_ndarray((10,))
Out[2]: usm_ndarray([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32)

In [3]: import dpctl.memory as dpm

In [4]: dpt.usm_ndarray((10,), buffer=dpm.MemoryUSMShared(80))
Out[4]: usm_ndarray([nan, nan,  0.,  0.,  0.,  0.,  0.,  0., nan, nan], dtype=float32)

@oleksandr-pavlyk
Copy link
Collaborator

Please retest and close.

@antonwolfy
Copy link
Collaborator Author

I can confirm the issue is resolved:

import dpctl, dpctl.tensor as dpt

dpt.usm_ndarray((10,))
# Out: usm_ndarray([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32)

dpctl.__version__
# Out: '0.17.0dev0+232.gd8b9cceed7'

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

No branches or pull requests

2 participants