Skip to content

dpnp.cov() doesn't work on Iris XE #1379

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

Closed
antonwolfy opened this issue Apr 14, 2023 · 1 comment
Closed

dpnp.cov() doesn't work on Iris XE #1379

antonwolfy opened this issue Apr 14, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@antonwolfy
Copy link
Contributor

dpnp.cov function doesn't work on GPU device without double precision support:

In [1]: import dpnp as np

In [2]: x = np.array([[0, 2], [1, 1], [2, 0]]).T

In [3]: np.cov(x)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[3], line 1
----> 1 np.cov(x)

File ~/code/dpnp/dpnp/dpnp_iface_statistics.py:295, in cov(x1, y, rowvar, bias, ddof, fweights, aweights)
    293     else:
    294         if x1_desc.dtype != dpnp.float64:
--> 295             x1_desc = dpnp.get_dpnp_descriptor(dpnp.astype(x1, dpnp.float64), copy_when_nondefault_queue=False)
    297         return dpnp_cov(x1_desc).get_pyobj()
    299 return call_origin(numpy.cov, x1, y, rowvar, bias, ddof, fweights, aweights)

File ~/code/dpnp/dpnp/dpnp_iface.py:160, in astype(x1, dtype, order, casting, subok, copy)
    158 """Copy the array with data type casting."""
    159 if isinstance(x1, dpnp_array):
--> 160     return x1.astype(dtype, order=order, casting=casting, copy=copy)
    162 if isinstance(x1, dpt.usm_ndarray):
    163     return dpt.astype(x1, dtype, order=order, casting=casting, copy=copy)

File ~/code/dpnp/dpnp/dpnp_array.py:576, in dpnp_array.astype(self, dtype, order, casting, subok, copy)
    554 """Copy the array with data type casting.
    555
    556 Args:
   (...)
    572
    573 """
    575 new_array = self.__new__(dpnp_array)
--> 576 new_array._array_obj = dpt.astype(self._array_obj, dtype, order=order, casting=casting, copy=copy)
    577 return new_array

File ~/miniconda3/envs/dpnp_dev/lib/python3.9/site-packages/dpctl/tensor/_copy_utils.py:426, in astype(usm_ary, newdtype, order, casting, copy)
    421 else:
    422     raise ValueError(
    423         "Unrecognized value of the order keyword. "
    424         "Recognized values are 'A', 'C', 'F', or 'K'"
    425     )
--> 426 R = dpt.usm_ndarray(
    427     usm_ary.shape,
    428     dtype=target_dtype,
    429     buffer=usm_ary.usm_type,
    430     order=copy_order,
    431     buffer_ctor_kwargs={"queue": usm_ary.sycl_queue},
    432 )
    433 if order == "K" and (not c_contig and not f_contig):
    434     original_strides = usm_ary.strides

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

ValueError: Device Intel(R) Graphics [0x9a49] does not support float64 natively.
@antonwolfy antonwolfy added the bug Something isn't working label Apr 14, 2023
@antonwolfy antonwolfy self-assigned this Apr 14, 2023
@vtavana vtavana mentioned this issue Apr 20, 2023
6 tasks
@vtavana vtavana self-assigned this Apr 28, 2023
@vtavana
Copy link
Collaborator

vtavana commented Apr 28, 2023

completed by #1385

@vtavana vtavana closed this as completed Apr 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants