Skip to content

Commit db520e4

Browse files
s-NickRbiessy
andauthored
[SYCL][BLAS] Move portBLAS to UXL Foundation as generic SYCL BLAS (#618)
Signed-off-by: nscipione <[email protected]> Co-authored-by: Romain Biessy <[email protected]>
1 parent 044479d commit db520e4

36 files changed

+1839
-1829
lines changed

.github/workflows/pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
include:
37-
- config: portBLAS
37+
- config: generic SYCL BLAS
3838
domain: blas
39-
build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install -DENABLE_PORTBLAS_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DPORTBLAS_TUNING_TARGET=INTEL_CPU
39+
build_options: -DREF_BLAS_ROOT=${PWD}/lapack/install -DENABLE_GENERIC_BLAS_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF -DGENERIC_BLAS_TUNING_TARGET=INTEL_CPU
4040
- config: portFFT
4141
domain: dft
4242
build_options: -DENABLE_PORTFFT_BACKEND=ON -DENABLE_MKLCPU_BACKEND=OFF

CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ endif()
4545
option(ENABLE_CUBLAS_BACKEND "Enable the cuBLAS backend for the BLAS interface" OFF)
4646
option(ENABLE_ROCBLAS_BACKEND "Enable the rocBLAS backend for the BLAS interface" OFF)
4747
option(ENABLE_NETLIB_BACKEND "Enable the Netlib backend for the BLAS interface" OFF)
48-
option(ENABLE_PORTBLAS_BACKEND "Enable the portBLAS backend for the BLAS interface. Cannot be used with other BLAS backends." OFF)
48+
option(ENABLE_GENERIC_BLAS_BACKEND "Enable the generic BLAS backend for the BLAS interface. Cannot be used with other BLAS backends." OFF)
4949

5050
# rand
5151
option(ENABLE_CURAND_BACKEND "Enable the cuRAND backend for the RNG interface" OFF)
@@ -76,14 +76,19 @@ option(BUILD_EXAMPLES "" ON)
7676
## Documentation
7777
option(BUILD_DOC "" OFF)
7878

79+
if(DEFINED ENABLE_PORTBLAS_BACKEND)
80+
message(WARNING "PORTBLAS_BACKEND is deprecated, please use ENABLE_GENERIC_BLAS_BACKEND.")
81+
set(ENABLE_GENERIC_BLAS_BACKEND ${ENABLE_PORTBLAS_BACKEND})
82+
endif()
83+
7984
## Supported domains
8085
set(DOMAINS_LIST "")
8186
if(ENABLE_MKLCPU_BACKEND
8287
OR ENABLE_MKLGPU_BACKEND
8388
OR ENABLE_CUBLAS_BACKEND
8489
OR ENABLE_ROCBLAS_BACKEND
8590
OR ENABLE_NETLIB_BACKEND
86-
OR ENABLE_PORTBLAS_BACKEND)
91+
OR ENABLE_GENERIC_BLAS_BACKEND)
8792
list(APPEND DOMAINS_LIST "blas")
8893
endif()
8994
if(ENABLE_MKLCPU_BACKEND
@@ -112,13 +117,13 @@ if(ENABLE_MKLCPU_BACKEND
112117
list(APPEND DOMAINS_LIST "sparse_blas")
113118
endif()
114119

115-
if(ENABLE_PORTBLAS_BACKEND
120+
if(ENABLE_GENERIC_BLAS_BACKEND
116121
AND (ENABLE_MKLCPU_BACKEND
117122
OR ENABLE_MKLGPU_BACKEND
118123
OR ENABLE_CUBLAS_BACKEND
119124
OR ENABLE_ROCBLAS_BACKEND
120125
OR ENABLE_NETLIB_BACKEND))
121-
message(FATAL_ERROR "ENABLE_PORTBLAS_BACKEND cannot be enabled at the same time as other BLAS backends.")
126+
message(FATAL_ERROR "ENABLE_GENERIC_BLAS_BACKEND cannot be enabled at the same time as other BLAS backends.")
122127
endif()
123128

124129
if (ENABLE_PORTFFT_BACKEND

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ oneMath is part of the [UXL Foundation](http://www.uxlfoundation.org).
6969
<td align="center">AMD GPU</td>
7070
</tr>
7171
<tr>
72-
<td align="center"><a href="https://github.com/codeplaysoftware/portBLAS"> portBLAS </a></td>
72+
<td align="center"><a href="https://github.com/uxlfoundation/generic-sycl-components/tree/main/onemath/sycl/blas"> generic SYCL BLAS </a></td>
7373
<td align="center">x86 CPU, Intel GPU, NVIDIA GPU, AMD GPU, Other SYCL devices (unsupported)</td>
7474
</tr>
7575
<tr>
@@ -192,7 +192,7 @@ Supported compilers include:
192192
<td align="center">Dynamic, Static</td>
193193
</tr>
194194
<tr>
195-
<td align="center">portBLAS</td>
195+
<td align="center">generic SYCL BLAS</td>
196196
<td align="center">Intel DPC++</br>Open DPC++</td>
197197
<td align="center">Dynamic, Static</td>
198198
</tr>
@@ -203,7 +203,7 @@ Supported compilers include:
203203
<td align="center">Dynamic, Static</td>
204204
</tr>
205205
<tr>
206-
<td align="center">portBLAS</td>
206+
<td align="center">generic SYCL BLAS</td>
207207
<td align="center">Intel DPC++</br>Open DPC++</td>
208208
<td align="center">Dynamic, Static</td>
209209
</tr>
@@ -214,7 +214,7 @@ Supported compilers include:
214214
<td align="center">Dynamic, Static</td>
215215
</tr>
216216
<tr>
217-
<td align="center">portBLAS</td>
217+
<td align="center">generic SYCL BLAS</td>
218218
<td align="center">Open DPC++</td>
219219
<td align="center">Dynamic, Static</td>
220220
</tr>
@@ -225,13 +225,13 @@ Supported compilers include:
225225
<td align="center">Dynamic, Static</td>
226226
</tr>
227227
<tr>
228-
<td align="center">portBLAS</td>
228+
<td align="center">generic SYCL BLAS</td>
229229
<td align="center">Open DPC++</td>
230230
<td align="center">Dynamic, Static</td>
231231
</tr>
232232
<tr>
233233
<td rowspan=1 align="center">Other SYCL devices (unsupported)</td>
234-
<td align="center">portBLAS</td>
234+
<td align="center">generic SYCL BLAS</td>
235235
<td align="center">Intel DPC++</br>Open DPC++</td>
236236
<td align="center">Dynamic, Static</td>
237237
</tr>
@@ -549,7 +549,7 @@ Product | Supported Version | License
549549
[AMD rocFFT](https://github.com/ROCm/rocFFT) | rocm-5.4.3 | [AMD License](https://github.com/ROCm/rocFFT/blob/rocm-5.4.3/LICENSE.md)
550550
[AMD rocSPARSE](https://github.com/ROCm/rocSPARSE) | 3.1.2 | [AMD License](https://github.com/ROCm/rocSPARSE/blob/develop/LICENSE.md)
551551
[NETLIB LAPACK](https://www.netlib.org/) | [5d4180c](https://github.com/Reference-LAPACK/lapack/commit/5d4180cf8288ae6ad9a771d18793d15bd0c5643c) | [BSD like license](http://www.netlib.org/lapack/LICENSE.txt)
552-
[portBLAS](https://github.com/codeplaysoftware/portBLAS) | 0.1 | [Apache License v2.0](https://github.com/codeplaysoftware/portBLAS/blob/main/LICENSE)
552+
[Generic SYCL BLAS](https://github.com/uxlfoundation/generic-sycl-components/tree/main/onemath/sycl/blas) | 0.1 | [Apache License v2.0](https://github.com/uxlfoundation/generic-sycl-components/blob/main/LICENSE)
553553
[portFFT](https://github.com/codeplaysoftware/portFFT) | 0.1 | [Apache License v2.0](https://github.com/codeplaysoftware/portFFT/blob/main/LICENSE)
554554

555555
---

docs/building_the_project_with_dpcpp.rst

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ or ``clang++`` and ``clang`` respectively when using the Open DPC++ Compiler.
5959
Backends should be enabled by setting ``-DENABLE_<BACKEND_NAME>_BACKEND=True``
6060
for each desired backend. By default, only the ``MKLGPU`` and ``MKLCPU``
6161
backends are enabled. Multiple backends for multiple device vendors can be
62-
enabled at once (albeit with limitations when using portBLAS and portFFT). The
63-
supported backends for the compilers are given in the table at `oneMath
62+
enabled at once (albeit with limitations when using oneMath generic SYCL BLAS and portFFT).
63+
The supported backends for the compilers are given in the table at `oneMath
6464
supported configurations table
6565
<https://github.com/uxlfoundation/oneMath?tab=readme-ov-file#supported-configurations>`_,
6666
and the CMake option names are given in the table below. Some backends may
@@ -127,7 +127,7 @@ The most important supported build options are:
127127
* - ENABLE_MKLCPU_THREAD_TBB
128128
- True, False
129129
- True
130-
* - ENABLE_PORTBLAS_BACKEND
130+
* - ENABLE_GENERIC_BLAS_BACKEND
131131
- True, False
132132
- False
133133
* - ENABLE_PORTFFT_BACKEND
@@ -239,19 +239,19 @@ SYCL enables portable heterogeneous computing on a wide range of accelerators.
239239
Consequently, it is possible to use oneMath with accelerators not anticipated by
240240
the project.
241241

242-
For generic SYCL devices, only portBLAS and portFFT backend are enabled.
242+
For generic SYCL devices, only generic BLAS and portFFT backend are enabled.
243243
The user must set the appropriate ``-fsycl-targets`` for their device, and also
244-
any other option required for performance. See `Building for portBLAS`_ and
244+
any other option required for performance. See `Building for oneMath generic SYCL BLAS`_ and
245245
`Building for portFFT`_. Extensive testing is strongly advised for these
246246
unsupported configurations.
247247

248248
.. _build_for_portlibs_dpcpp:
249249

250-
Pure SYCL backends: portBLAS and portFFT
251-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
250+
Pure SYCL backends: generic BLAS and portFFT
251+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
252252

253-
`portBLAS <https://github.com/codeplaysoftware/portBLAS>`_ and `portFFT
254-
<https://github.com/codeplaysoftware/portFFT>`_ are experimental pure-SYCL
253+
`Generic SYCL BLAS <https://github.com/uxlfoundation/generic-sycl-components/tree/main/onemath/sycl/blas>`_
254+
and `portFFT <https://github.com/codeplaysoftware/portFFT>`_ are experimental pure-SYCL
255255
backends that work on all SYCL targets supported by the DPC++ compiler. Since
256256
they support multiple targets, they cannot be enabled with other backends in the
257257
same domain, or the ``MKLCPU`` or ``MKLGPU`` backends. Both libraries are
@@ -260,35 +260,35 @@ experimental and currently only support a subset of operations and features.
260260
For best performance, both libraries must be tuned. See the individual sections
261261
for more details.
262262

263-
Both portBLAS and portFFT are used as header-only libraries, and will be
263+
Both generic SYCL BLAS and portFFT are used as header-only libraries, and will be
264264
downloaded automatically if not found.
265265

266-
.. _build_for_portblas_dpcpp:
266+
.. _build_for_generic_blas_dpcpp:
267267

268-
Building for portBLAS
269-
---------------------
268+
Building for oneMath generic SYCL BLAS
269+
--------------------------------------
270270

271-
`portBLAS <https://github.com/codeplaysoftware/portBLAS>`_ is
272-
enabled by setting ``-DENABLE_PORTBLAS_BACKEND=True``.
271+
`onemath generic SYCL BLAS <https://github.com/uxlfoundation/generic-sycl-components/tree/main/onemath/sycl/blas>`_
272+
is enabled by setting ``-DENABLE_GENERIC_BLAS_BACKEND=True``.
273273

274-
By default, the portBLAS backend is not tuned for any specific device.
274+
By default, the generic BLAS backend is not tuned for any specific device.
275275
This tuning is required to achieve best performance.
276-
portBLAS can be tuned for a specific hardware target by adding compiler
276+
The generic SYCL BLAS backend can be tuned for a specific hardware target by adding compiler
277277
definitions in 2 ways:
278278

279279
#.
280-
Manually specify a tuning target with ``-DPORTBLAS_TUNING_TARGET=<target>``.
281-
The list of portBLAS targets can be found
282-
`here <https://github.com/codeplaysoftware/portBLAS#cmake-options>`_.
280+
Manually specify a tuning target with ``-DGENERIC_BLAS_TUNING_TARGET=<target>``.
281+
The list of oneMath SYCL BLAS targets can be found
282+
`here <https://github.com/uxlfoundation/generic-sycl-components/tree/main/onemath/sycl/blas#cmake-options>`_.
283283
This will automatically set ``-fsycl-targets`` if needed.
284284
#.
285285
If one target is set via ``-fsycl-targets`` the configuration step will
286-
try to automatically detect the portBLAS tuning target. One can manually
286+
try to automatically detect the oneMath SYCL BLAS tuning target. One can manually
287287
specify ``-fsycl-targets`` via ``CMAKE_CXX_FLAGS``. See
288288
`DPC++ User Manual <https://intel.github.io/llvm-docs/UsersManual.html>`_
289289
for more information on ``-fsycl-targets``.
290290

291-
portBLAS relies heavily on JIT compilation. This may cause time-outs on some
291+
OneMath SYCL BLAS relies heavily on JIT compilation. This may cause time-outs on some
292292
systems. To avoid this issue, use ahead-of-time compilation through tuning
293293
targets or ``sycl-targets``.
294294

@@ -439,11 +439,10 @@ Build oneMath for the BLAS domain on a generic SYCL device:
439439
-DCMAKE_C_COMPILER=clang \
440440
-DENABLE_MKLCPU_BACKEND=False \
441441
-DENABLE_MKLGPU_BACKEND=False \
442-
-DENABLE_PORTBLAS_BACKEND=True
442+
-DENABLE_GENERIC_BLAS_BACKEND=True
443443
444444
Note that this is not a tested configuration. This builds oneMath with the
445-
portBLAS backend only, for a generic SYCL device supported by the Open DPC++
446-
project.
445+
generic SYCL BLAS backend only, for a generic SYCL device.
447446

448447
Build oneMath for the DFT domain on a generic SYCL device:
449448

examples/blas/run_time_dispatching/level3/CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ endif()
4040
if(ENABLE_ROCBLAS_BACKEND)
4141
list(APPEND DEVICE_FILTERS "hip:gpu")
4242
endif()
43-
if(ENABLE_PORTBLAS_BACKEND)
44-
if(PORTBLAS_TUNING_TARGET)
45-
if(PORTBLAS_TUNING_TARGET MATCHES "INTEL_CPU")
43+
if(ENABLE_GENERIC_BLAS_BACKEND)
44+
if(GENERIC_BLAS_TUNING_TARGET)
45+
if(GENERIC_BLAS_TUNING_TARGET MATCHES "INTEL_CPU")
4646
list(APPEND DEVICE_FILTERS "opencl:cpu")
47-
elseif(PORTBLAS_TUNING_TARGET MATCHES "_GPU")
47+
elseif(GENERIC_BLAS_TUNING_TARGET MATCHES "_GPU")
4848
list(APPEND DEVICE_FILTERS "*:gpu")
4949
endif()
5050
else()
51-
# portBLAS default sycl-target is spir64, testing runtime on both supported
51+
# onemath_sycl_blas default sycl-target is spir64, testing runtime on both supported
5252
# devices.
5353
list(APPEND DEVICE_FILTERS "opencl:cpu;level_zero:gpu")
5454
endif()

include/oneapi/math/blas.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
#ifdef ONEMATH_ENABLE_NETLIB_BACKEND
5050
#include "oneapi/math/blas/detail/netlib/blas_ct.hpp"
5151
#endif
52-
#ifdef ONEMATH_ENABLE_PORTBLAS_BACKEND
53-
#include "oneapi/math/blas/detail/portblas/blas_ct.hpp"
52+
#ifdef ONEMATH_ENABLE_GENERIC_BLAS_BACKEND
53+
#include "oneapi/math/blas/detail/generic/blas_ct.hpp"
5454
#endif
5555

5656
namespace oneapi {

include/oneapi/math/blas/detail/blas_ct_backends.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ namespace column_major {
5151
#define BACKEND netlib
5252
#include "blas_ct_backends.hxx"
5353
#undef BACKEND
54-
#define BACKEND portblas
54+
#define BACKEND generic
5555
#include "blas_ct_backends.hxx"
5656
#undef BACKEND
5757

@@ -73,7 +73,7 @@ namespace row_major {
7373
#define BACKEND netlib
7474
#include "blas_ct_backends.hxx"
7575
#undef BACKEND
76-
#define BACKEND portblas
76+
#define BACKEND generic
7777
#include "blas_ct_backends.hxx"
7878
#undef BACKEND
7979

include/oneapi/math/blas/detail/portblas/blas_ct.hpp renamed to include/oneapi/math/blas/detail/generic/blas_ct.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*
1818
**************************************************************************/
1919

20-
#ifndef _DETAIL_PORTBLAS_BLAS_CT_HPP_
21-
#define _DETAIL_PORTBLAS_BLAS_CT_HPP_
20+
#ifndef _DETAIL_GENERIC_BLAS_BLAS_CT_HPP_
21+
#define _DETAIL_GENERIC_BLAS_BLAS_CT_HPP_
2222

2323
#if __has_include(<sycl/sycl.hpp>)
2424
#include <sycl/sycl.hpp>
@@ -30,7 +30,7 @@
3030

3131
#include "oneapi/math/types.hpp"
3232
#include "oneapi/math/detail/backend_selector.hpp"
33-
#include "oneapi/math/blas/detail/portblas/onemath_blas_portblas.hpp"
33+
#include "oneapi/math/blas/detail/generic/onemath_blas_generic.hpp"
3434
#include "oneapi/math/blas/detail/blas_ct_backends.hpp"
3535

3636
namespace oneapi {
@@ -54,4 +54,4 @@ namespace row_major {
5454
} //namespace math
5555
} //namespace oneapi
5656

57-
#endif //_DETAIL_PORTBLAS_BLAS_CT_HPP_
57+
#endif //_DETAIL_GENERIC_BLAS_BLAS_CT_HPP_

0 commit comments

Comments
 (0)