oneapi-src / oneMKL

oneAPI Math Kernel Library (oneMKL) Interfaces
Apache License 2.0
606 stars 155 forks source link

When trying to use oneMKL with the portBLAS backend there is a check for Intel, AMD or Nvidia GPU. #542

Open al3x-jp opened 1 month ago

al3x-jp commented 1 month ago

Summary

When trying to use oneMKL with the portBLAS backend, the current code structure checks for an Intel, AMD or NVidia GPU, which if not found causes an unsupported error. It is understood that portBLAS could work on any GPU that supports OpenCL.

Version

HEAD of oneMKL Tree

Environment

Ubuntu 22.04 with PowerVR GPU

Steps to reproduce

Build oneMKL with "portBLAS" support specified and then execute the example GEMM test on a GPU that isn't Intel, AMD or Nvidia, but that supports SYCL OpenCL backend (e.g., a PowerVR GPU).

To build: cmake .. -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DENABLE_MKLGPU_BACKEND=False -DENABLE_MKLGPU_BACKEND=False -DENABLE_PORTBLAS_BACKEND=True -DENABLE_CUBLAS_BACKEND=False -DENABLE_ROCBLAS_BACKEND=False -DENABLE_NETLIB_BACKEND=False -DBUILD_FUNCTIONAL_TESTS=False -DBUILD_EXAMPLES=True -DENABLE_MKLCPU_BACKEND=False

To run: ONEAPI_DEVICE_SELECTOR=opencl:gpu SYCL_PI_TRACE=1 ./example_blas_gemm_usm

Observed behaviour

The BLAS GEMM example prints the following message when run on a PowerVR OpenCL Device: "oneMKL: PowerVR B-Series BXT-32-1024 is not supported"

Expected behaviour

It is expected that portBLAS could work on any GPU that supports the SYCL OpenCL backend.

Rbiessy commented 1 month ago

Thank you for this issue @al3x-jp. You are right currently the oneMKL structure does not allow a backend to support devices that are not in a list of supported device. I think we should have some kind of generic device that would allow portBLAS and portFFT backends to run on any SYCL device. These devices won't necessarily be "supported" until we have a CI testing them but they could be documented as expected to work. We'll let you know once we are able to work on this issue.

hjabird commented 1 month ago

I've started looking into this issue.

hjabird commented 1 month ago

I've created a PR for this, see above. With this PR, only portBLAS is enabled.