-
Notifications
You must be signed in to change notification settings - Fork 13.4k
SYCL: Rename oneMKL to oneMath #12192
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
Merged
NeoZhangJianyu
merged 17 commits into
ggml-org:master
from
Rbiessy:romain/rename_onemath
Apr 1, 2025
Merged
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
a856351
Rename oneMKL Interface to oneMath
Rbiessy dccc9f8
Use oneMath for Intel vendor
Rbiessy 3577bc0
Rename occurences to mkl
Rbiessy 4482516
clang-format
Rbiessy 2c79721
Silence verbose warnings
Rbiessy 64b5a14
Set oneMath HIP_TARGETS
Rbiessy bc851c8
Fix silence warnings
Rbiessy 9002b4d
Remove step to build oneMath from build instructions
Rbiessy 09dfe89
Use fixed oneMath version
Rbiessy 948f3c5
Remove INTEL_CPU
Rbiessy 1c8a949
Fold CMake oneDNN conditions
Rbiessy 5f2525a
Merge branch 'master' into romain/rename_onemath
Rbiessy 995aea3
Use Intel oneMKL for Intel devices
Rbiessy 1caa2d9
Merge branch 'master' into romain/rename_onemath
Rbiessy 0b6f9a9
Improve CMake message
Rbiessy 6af33c9
Link against MKL::MKL_SYCL::BLAS only
Rbiessy 06fe2ca
Move oneMath documentation to Nvidia and AMD sections
Rbiessy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
**oneAPI** is an open ecosystem and a standard-based specification, supporting multiple architectures including but not limited to intel CPUs, GPUs and FPGAs. The key components of the oneAPI ecosystem include: | ||
|
||
- **DPCPP** *(Data Parallel C++)*: The primary oneAPI SYCL implementation, which includes the icpx/icx Compilers. | ||
- **oneAPI Libraries**: A set of highly optimized libraries targeting multiple domains *(e.g. oneMKL and oneDNN)*. | ||
- **oneAPI Libraries**: A set of highly optimized libraries targeting multiple domains *(e.g. Intel oneMKL, oneMath and oneDNN)*. | ||
- **oneAPI LevelZero**: A high performance low level interface for fine-grained control over intel iGPUs and dGPUs. | ||
- **Nvidia & AMD Plugins**: These are plugins extending oneAPI's DPCPP support to SYCL on Nvidia and AMD GPU targets. | ||
|
||
|
@@ -227,30 +227,10 @@ Upon a successful installation, SYCL is enabled for the available intel devices, | |
|
||
**oneAPI Plugin**: In order to enable SYCL support on Nvidia GPUs, please install the [Codeplay oneAPI Plugin for Nvidia GPUs](https://developer.codeplay.com/products/oneapi/nvidia/download). User should also make sure the plugin version matches the installed base toolkit one *(previous step)* for a seamless "oneAPI on Nvidia GPU" setup. | ||
|
||
|
||
**oneMKL for cuBlas**: The current oneMKL releases *(shipped with the oneAPI base-toolkit)* do not contain the cuBLAS backend. A build from source of the upstream [oneMKL](https://github.com/oneapi-src/oneMKL) with the *cuBLAS* backend enabled is thus required to run it on Nvidia GPUs. | ||
|
||
```sh | ||
git clone https://github.com/oneapi-src/oneMKL | ||
cd oneMKL | ||
cmake -B buildWithCublas -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx -DENABLE_MKLGPU_BACKEND=OFF -DENABLE_MKLCPU_BACKEND=OFF -DENABLE_CUBLAS_BACKEND=ON -DTARGET_DOMAINS=blas | ||
cmake --build buildWithCublas --config Release | ||
``` | ||
|
||
- **Adding support to AMD GPUs** | ||
|
||
**oneAPI Plugin**: In order to enable SYCL support on AMD GPUs, please install the [Codeplay oneAPI Plugin for AMD GPUs](https://developer.codeplay.com/products/oneapi/amd/download). As with Nvidia GPUs, the user should also make sure the plugin version matches the installed base toolkit. | ||
|
||
**oneMKL for rocBlas**: The current oneMKL releases *(shipped with the oneAPI base-toolkit)* doesn't contain the rocBLAS backend. A build from source of the upstream [oneMKL](https://github.com/oneapi-src/oneMKL) with the *rocBLAS* backend enabled is thus required to run it on AMD GPUs. | ||
|
||
```sh | ||
git clone https://github.com/oneapi-src/oneMKL | ||
cd oneMKL | ||
# Find your HIPTARGET with rocminfo, under the key 'Name:' | ||
cmake -B buildWithrocBLAS -DCMAKE_CXX_COMPILER=icpx -DCMAKE_C_COMPILER=icx -DENABLE_MKLGPU_BACKEND=OFF -DENABLE_MKLCPU_BACKEND=OFF -DENABLE_ROCBLAS_BACKEND=ON -DHIPTARGETS=${HIPTARGET} -DTARGET_DOMAINS=blas | ||
cmake --build buildWithrocBLAS --config Release | ||
``` | ||
|
||
3. **Verify installation and environment** | ||
|
||
In order to check the available SYCL devices on the machine, please use the `sycl-ls` command. | ||
|
@@ -291,6 +271,8 @@ For AMD GPUs we should expect at least one SYCL-HIP device [`hip:gpu`]: | |
|
||
### II. Build llama.cpp | ||
|
||
The SYCL backend depends on [oneMath](https://github.com/uxlfoundation/oneMath). By default it is automatically built along with the project. A specific build can be provided by setting the CMake flag `-DoneMath_DIR=/path/to/oneMath/install/lib/cmake/oneMath`. | ||
|
||
|
||
#### Intel GPU | ||
|
||
``` | ||
|
@@ -316,12 +298,6 @@ cmake --build build --config Release -j -v | |
#### Nvidia GPU | ||
|
||
```sh | ||
# Export relevant ENV variables | ||
export LD_LIBRARY_PATH=/path/to/oneMKL/buildWithCublas/lib:$LD_LIBRARY_PATH | ||
export LIBRARY_PATH=/path/to/oneMKL/buildWithCublas/lib:$LIBRARY_PATH | ||
export CPLUS_INCLUDE_DIR=/path/to/oneMKL/buildWithCublas/include:$CPLUS_INCLUDE_DIR | ||
export CPLUS_INCLUDE_DIR=/path/to/oneMKL/include:$CPLUS_INCLUDE_DIR | ||
|
||
# Build LLAMA with Nvidia BLAS acceleration through SYCL | ||
# Setting GGML_SYCL_DEVICE_ARCH is optional but can improve performance | ||
GGML_SYCL_DEVICE_ARCH=sm_80 # Example architecture | ||
|
@@ -339,11 +315,6 @@ cmake --build build --config Release -j -v | |
#### AMD GPU | ||
|
||
```sh | ||
# Export relevant ENV variables | ||
export LD_LIBRARY_PATH=/path/to/oneMKL/buildWithrocBLAS/lib:$LD_LIBRARY_PATH | ||
export LIBRARY_PATH=/path/to/oneMKL/buildWithrocBLAS/lib:$LIBRARY_PATH | ||
export CPLUS_INCLUDE_DIR=/path/to/oneMKL/buildWithrocBLAS/include:$CPLUS_INCLUDE_DIR | ||
|
||
# Build LLAMA with rocBLAS acceleration through SYCL | ||
|
||
## AMD | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.