scikit-learn-intelex icon indicating copy to clipboard operation
scikit-learn-intelex copied to clipboard

Check available of host and cpu devices for sycl examples

Open PetrovKP opened this issue 3 years ago • 4 comments

Host and Cpu devices can be not available in python package and there is a failed:

python daal4py\examples\sycl\sklearn_sycl.py
********************************************************************************
device context: host
Traceback (most recent call last):
  File "daal4py\examples\sycl\sklearn_sycl.py", line 179, in <module>
    with get_context(device):
  File "C:\Users\kpetrov\Miniconda3\envs\py36\lib\contextlib.py", line 81, in __enter__
    return next(self.gen)
  File "src\oneapi\oneapi.pyx", line 78, in sycl_context
  File "src\oneapi\oneapi.pyx", line 42, in _oneapi.sycl_execution_context.__cinit__
RuntimeError: No device of requested type available. Please check https://software.intel.com/en-us/articles/intel-oneapi-dpcpp-compiler-system-requirements-beta -1 (CL_DEVICE_NOT_FOUND)

These changes do a check for the availability of devices and does not run examples if there is no package

PetrovKP avatar Jan 30 '21 17:01 PetrovKP

General question: how proper is it not to raise any error or warning if no host device is available?

michael-smirnov avatar Feb 01 '21 05:02 michael-smirnov

@michael-smirnov

General question: how proper is it not to raise any error or warning if no host device is available?

I think the behavior should be aligned in the case when the GPU is not found.

PetrovKP avatar Feb 01 '21 09:02 PetrovKP

@michael-smirnov

General question: how proper is it not to raise any error or warning if no host device is available?

I think the behavior should be aligned in the case when the GPU is not found.

I don't think that for cpu/host we should have same path as for GPU. There are might be cases there you don't have GPU, but you always having CPU.

The problem is that in this setup in case of some major problems with DPC++ environment we will have green examples in both customer systems and our testing.

Might be we should consider separation of sycl and normal examples? In case you are running sycl examples we can expect that they are failing without dpc++ env..

napetrov avatar Feb 01 '21 15:02 napetrov

I would say at least the host device should be present always with DPC++ RT.

michael-smirnov avatar Feb 02 '21 05:02 michael-smirnov