Intel® Distribution for Python*
Engage in discussions with community peers related to Python* applications and core computational packages.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
447 Discussions

About the availability of the use of GPU in Intel Numpy

Xuwen_T_Intel
Employee
6,386 Views

Hi, I am going to test the SpMV performance on the IA hardware, and want to know if Intel-NumPy/SciPy has the support for the Intel i-GPUs, besides the Intel CPUs. If true, what operations should I make to use the GPUs in the Python code, like Cupy.

0 Kudos
5 Replies
ArunJ_Intel
Moderator
6,369 Views

Hi Xuwen,

 

GPU support in scikit-learn is present for DBSCAN, K-Means, Linear Regression and Logistic Regression algorithms.

daal4py optimizations for GPU include KNN Classification, batch and streaming Covariance, DBSCAN, GBT Regression, K-Means, Linear & Logistic Regression, batch and streaming Low Order Moments, PCA, and binary SVM Classification.

 

 

Here is an example of running sklearn dbscan algorithm on gpu.

 

from daal4py.sklearn import patch_sklearn
from daal4py.oneapi import sycl_context
patch_sklearn()
from sklearn.cluster import DBSCAN
X = np.array([[1., 2.], [2., 2.], [2., 3.],
      [8., 7.], [8., 8.], [25., 80.]], dtype=np.float32)

with sycl_context("gpu"):
  clustering = DBSCAN(eps=3, min_samples=2).fit(X)

  

  

For numpy with GPU support you could try out dpnp – GPU-enabled Data Parallel NumPy, a collection of many NumPy algorithms accelerated for GPUs. You can find information on examples and usage of dpnp by following the below link

 

https://github.com/IntelPython/dpnp

 

Thanks

Arun Jose

 

0 Kudos
Xuwen_T_Intel
Employee
6,341 Views

HIi Arun 

 

Thanks a lot for your feedback. I have two new question about dpnp. First, does this library contain any sparse matrix-cector operations, e.g. SpMV? Second, this library is based on a C++ library with SYCL based kernels, so do these kernels are those from oneMKL?

 

Xuwen 

0 Kudos
ArunJ_Intel
Moderator
6,318 Views

Hi Xuwen,

 

In limitations of dpnp.meshgrid it is mentioned sparse is supported only with a value of false. I couldnt find any mention of support for sparse matrix-vector operations with dpnp. However we will check internally and provide you a definitive response regarding sparse matrix/vector operations if any present in the library.

 

https://intelpython.github.io/dpnp/reference/generated/dpnp.meshgrid.html

 

Regarding your second query, DPNP is a NumPy-like library accelerated with SYCL on Intel devices. It provides Python interfaces for many NumPy functions, and includes a subset of methods of :class:`dpnp.ndarray`. Under the hood it is based on native C++ and oneMKL based kernels.

https://github.com/IntelPython/dpnp/blob/1b4ab46c23ae74552069b50b6babc1883388ad1e/doc/index.rst

 

Thanks

Arun

 

0 Kudos
Rachel_O_Intel
Moderator
6,210 Views

Hi Xuwen,


I am an engineer working on your issue. Sparse functionality is supported in oneMKL (https://docs.oneapi.io/versions/latest/onemkl/oneapi-mkl-sparse-gemv.html) to execute of SYCL devices, but not presently available in dpnp. We will file this functionality and samples supporting this for dpnp and dpctl as a feature request for a feature release of the product.


Best,


Rachel


0 Kudos
Rachel_O_Intel
Moderator
6,176 Views

This thread is now closed. Any additional comments to this thread will be considered community only. 


If you need any additional information, please submit a new question as this thread will no longer be monitored.


Best,


Rachel



0 Kudos
Reply