Skip to content

Commit bf38346

Browse files
authored
Remove support for Nvidia & AMD GPU, because the oneAPI plugin for Nvidia & AMD GPU is unavailable: download/installation channels are out of work. (ggml-org#19246)
User can't build up the software for Nvidia & AMD GPU. rm the oneMath since it is only used in NV and AMD code path.
1 parent 4d5e972 commit bf38346

7 files changed

Lines changed: 59 additions & 273 deletions

File tree

docs/backend/SYCL.md

Lines changed: 15 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@
2222
- **DPCPP** *(Data Parallel C++)*: The primary oneAPI SYCL implementation, which includes the icpx/icx Compilers.
2323
- **oneAPI Libraries**: A set of highly optimized libraries targeting multiple domains *(e.g. Intel oneMKL, oneMath and oneDNN)*.
2424
- **oneAPI LevelZero**: A high performance low level interface for fine-grained control over Intel iGPUs and dGPUs.
25-
- **Nvidia & AMD Plugins**: These are plugins extending oneAPI's DPCPP support to SYCL on Nvidia and AMD GPU targets.
2625

2726
### Llama.cpp + SYCL
2827

2928
The llama.cpp SYCL backend is primarily designed for **Intel GPUs**.
30-
SYCL cross-platform capabilities enable support for Nvidia GPUs as well, with limited support for AMD.
29+
SYCL cross-platform capabilities enable support for other vendor GPUs as well.
3130

3231
## Recommended Release
3332

@@ -42,6 +41,9 @@ The following releases are verified and recommended:
4241

4342
## News
4443

44+
- 2026.02
45+
- Remove support for Nvidia & AMD GPU, because the oneAPI plugin for Nvidia & AMD GPU is unavailable: download/installation channels are out of work. User can't build up the software for Nvidia & AMD GPU.
46+
4547
- 2025.11
4648
- Support malloc memory on device more than 4GB.
4749

@@ -111,8 +113,8 @@ On older Intel GPUs, you may try [OpenCL](/docs/backend/OPENCL.md) although the
111113
|-------------------------------|---------|---------------------------------------|
112114
| Intel Data Center Max Series | Support | Max 1550, 1100 |
113115
| Intel Data Center Flex Series | Support | Flex 170 |
114-
| Intel Arc A-Series | Support | Arc A770, Arc A730M, Arc A750 |
115-
| Intel Arc B-Series | Support | Arc B580 |
116+
| Intel Arc A-Series | Support | Arc A770, Arc A730M, Arc A750 |
117+
| Intel Arc B-Series | Support | Arc B580 |
116118
| Intel built-in Arc GPU | Support | built-in Arc GPU in Meteor Lake, Arrow Lake, Lunar Lake |
117119
| Intel iGPU | Support | iGPU in 13700k, 13400, i5-1250P, i7-1260P, i7-1165G7 |
118120

@@ -127,20 +129,7 @@ On older Intel GPUs, you may try [OpenCL](/docs/backend/OPENCL.md) although the
127129

128130
### Other Vendor GPU
129131

130-
**Verified devices**
131-
132-
| Nvidia GPU | Status | Verified Model |
133-
|--------------------------|-----------|----------------|
134-
| Ampere Series | Supported | A100, A4000 |
135-
| Ampere Series *(Mobile)* | Supported | RTX 40 Series |
136-
137-
| AMD GPU | Status | Verified Model |
138-
|--------------------------|--------------|----------------|
139-
| Radeon Pro | Experimental | W6800 |
140-
| Radeon RX | Experimental | 6700 XT |
141-
142-
Note: AMD GPU support is highly experimental and is incompatible with F16.
143-
Additionally, it only supports GPUs with a sub_group_size (warp size) of 32.
132+
NA
144133

145134
## Docker
146135

@@ -149,11 +138,11 @@ The docker build option is currently limited to *Intel GPU* targets.
149138
### Build image
150139

151140
```sh
152-
# Using FP16
153-
docker build -t llama-cpp-sycl --build-arg="GGML_SYCL_F16=ON" --target light -f .devops/intel.Dockerfile .
154-
155141
# Using FP32
156142
docker build -t llama-cpp-sycl --build-arg="GGML_SYCL_F16=OFF" --target light -f .devops/intel.Dockerfile .
143+
144+
# Using FP16
145+
docker build -t llama-cpp-sycl --build-arg="GGML_SYCL_F16=ON" --target light -f .devops/intel.Dockerfile .
157146
```
158147

159148
*Notes*:
@@ -212,14 +201,6 @@ Platform #0: Intel(R) OpenCL HD Graphics
212201
`-- Device #0: Intel(R) Iris(R) Xe Graphics [0x9a49]
213202
```
214203

215-
- **Nvidia GPU**
216-
217-
In order to target Nvidia GPUs through SYCL, please make sure the CUDA/CUBLAS native requirements *-found [here](README.md#cuda)-* are installed.
218-
219-
- **AMD GPU**
220-
221-
To target AMD GPUs with SYCL, the ROCm stack must be installed first.
222-
223204
2. **Install Intel® oneAPI Base toolkit**
224205

225206
SYCL backend depends on:
@@ -248,23 +229,6 @@ Upon a successful installation, SYCL is enabled for the available intel devices,
248229
|2025.1|
249230
|2024.1|
250231

251-
- **Adding support to Nvidia GPUs**
252-
253-
**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.
254-
255-
**oneDNN**: The current oneDNN releases *(shipped with the oneAPI base-toolkit)* do not include the NVIDIA backend. Therefore, oneDNN must be compiled from source to enable the NVIDIA target:
256-
257-
```sh
258-
git clone https://github.com/oneapi-src/oneDNN.git
259-
cd oneDNN
260-
cmake -GNinja -Bbuild-nvidia -DDNNL_CPU_RUNTIME=DPCPP -DDNNL_GPU_RUNTIME=DPCPP -DDNNL_GPU_VENDOR=NVIDIA -DONEDNN_BUILD_GRAPH=OFF -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
261-
cmake --build build-nvidia --config Release
262-
```
263-
264-
- **Adding support to AMD GPUs**
265-
266-
**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.
267-
268232
3. **Verify installation and environment**
269233

270234
In order to check the available SYCL devices on the machine, please use the `sycl-ls` command.
@@ -285,25 +249,6 @@ When targeting an intel GPU, the user should expect one or more devices among th
285249
[opencl:gpu][opencl:2] Intel(R) OpenCL Graphics, Intel(R) UHD Graphics 730 OpenCL 3.0 NEO [24.39.31294]
286250
```
287251

288-
- **Nvidia GPU**
289-
290-
Similarly, user targeting Nvidia GPUs should expect at least one SYCL-CUDA device [`cuda:gpu`] as below:
291-
292-
```
293-
[opencl:acc][opencl:0] Intel(R) FPGA Emulation Platform for OpenCL(TM), Intel(R) FPGA Emulation Device OpenCL 1.2 [2023.16.12.0.12_195853.xmain-hotfix]
294-
[opencl:cpu][opencl:1] Intel(R) OpenCL, Intel(R) Xeon(R) Gold 6326 CPU @ 2.90GHz OpenCL 3.0 (Build 0) [2023.16.12.0.12_195853.xmain-hotfix]
295-
[cuda:gpu][cuda:0] NVIDIA CUDA BACKEND, NVIDIA A100-PCIE-40GB 8.0 [CUDA 12.5]
296-
```
297-
298-
- **AMD GPU**
299-
300-
For AMD GPUs we should expect at least one SYCL-HIP device [`hip:gpu`]:
301-
302-
```
303-
[opencl:cpu][opencl:0] Intel(R) OpenCL, 12th Gen Intel(R) Core(TM) i9-12900K OpenCL 3.0 (Build 0) [2024.18.6.0.02_160000]
304-
[hip:gpu][hip:0] AMD HIP BACKEND, AMD Radeon PRO W6800 gfx1030 [HIP 60140.9]
305-
```
306-
307252
### II. Build llama.cpp
308253

309254
#### Intel GPU
@@ -332,47 +277,6 @@ It is possible to come across some precision issues when running tests that stem
332277
instructions, which can be circumvented by setting the environment variable `SYCL_PROGRAM_COMPILE_OPTIONS`
333278
as `-cl-fp32-correctly-rounded-divide-sqrt`
334279

335-
#### Nvidia GPU
336-
337-
The SYCL backend depends on [oneMath](https://github.com/uxlfoundation/oneMath) for Nvidia and AMD devices.
338-
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`.
339-
340-
```sh
341-
# Build LLAMA with Nvidia BLAS acceleration through SYCL
342-
# Setting GGML_SYCL_DEVICE_ARCH is optional but can improve performance
343-
GGML_SYCL_DEVICE_ARCH=sm_80 # Example architecture
344-
345-
# Option 1: Use FP32 (recommended for better performance in most cases)
346-
cmake -B build -DGGML_SYCL=ON -DGGML_SYCL_TARGET=NVIDIA -DGGML_SYCL_DEVICE_ARCH=${GGML_SYCL_DEVICE_ARCH} -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DDNNL_DIR=/path/to/oneDNN/build-nvidia/install/lib/cmake/dnnl
347-
348-
# Option 2: Use FP16
349-
cmake -B build -DGGML_SYCL=ON -DGGML_SYCL_TARGET=NVIDIA -DGGML_SYCL_DEVICE_ARCH=${GGML_SYCL_DEVICE_ARCH} -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_SYCL_F16=ON -DDNNL_DIR=/path/to/oneDNN/build-nvidia/install/lib/cmake/dnnl
350-
351-
# build all binary
352-
cmake --build build --config Release -j -v
353-
```
354-
355-
It is possible to come across some precision issues when running tests that stem from using faster
356-
instructions, which can be circumvented by passing the `-fno-fast-math` flag to the compiler.
357-
358-
#### AMD GPU
359-
360-
The SYCL backend depends on [oneMath](https://github.com/uxlfoundation/oneMath) for Nvidia and AMD devices.
361-
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`.
362-
363-
```sh
364-
# Build LLAMA with rocBLAS acceleration through SYCL
365-
366-
## AMD
367-
# Use FP32, FP16 is not supported
368-
# Find your GGML_SYCL_DEVICE_ARCH with rocminfo, under the key 'Name:'
369-
GGML_SYCL_DEVICE_ARCH=gfx90a # Example architecture
370-
cmake -B build -DGGML_SYCL=ON -DGGML_SYCL_TARGET=AMD -DGGML_SYCL_DEVICE_ARCH=${GGML_SYCL_DEVICE_ARCH} -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx
371-
372-
# build all binary
373-
cmake --build build --config Release -j -v
374-
```
375-
376280
### III. Run the inference
377281

378282
#### Retrieve and prepare model
@@ -766,23 +670,23 @@ use 1 SYCL GPUs: [0] with Max compute units:512
766670
| Name | Value | Function |
767671
|--------------------|---------------------------------------|---------------------------------------------|
768672
| GGML_SYCL | ON (mandatory) | Enable build with SYCL code path. |
769-
| GGML_SYCL_TARGET | INTEL *(default)* \| NVIDIA \| AMD | Set the SYCL target device type. |
770-
| GGML_SYCL_DEVICE_ARCH | Optional (except for AMD) | Set the SYCL device architecture, optional except for AMD. Setting the device architecture can improve the performance. See the table [--offload-arch](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/OffloadDesign.md#--offload-arch) for a list of valid architectures. |
673+
| GGML_SYCL_TARGET | INTEL *(default)* | Set the SYCL target device type. |
674+
| GGML_SYCL_DEVICE_ARCH | Optional | Set the SYCL device architecture. Setting the device architecture can improve the performance. See the table [--offload-arch](https://github.com/intel/llvm/blob/sycl/sycl/doc/design/OffloadDesign.md#--offload-arch) for a list of valid architectures. |
771675
| GGML_SYCL_F16 | OFF *(default)* \|ON *(optional)* | Enable FP16 build with SYCL code path. (1.) |
772-
| GGML_SYCL_GRAPH | ON *(default)* \|OFF *(Optional)* | Enable build with [SYCL Graph extension](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc). |
676+
| GGML_SYCL_GRAPH | OFF *(default)* \|ON *(Optional)* | Enable build with [SYCL Graph extension](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/experimental/sycl_ext_oneapi_graph.asciidoc). |
773677
| GGML_SYCL_DNN | ON *(default)* \|OFF *(Optional)* | Enable build with oneDNN. |
774678
| CMAKE_C_COMPILER | `icx` *(Linux)*, `icx/cl` *(Windows)* | Set `icx` compiler for SYCL code path. |
775679
| CMAKE_CXX_COMPILER | `icpx` *(Linux)*, `icx` *(Windows)* | Set `icpx/icx` compiler for SYCL code path. |
776680

777-
1. FP16 is recommended for better prompt processing performance on quantized models. Performance is equivalent in text generation but set `GGML_SYCL_F16=OFF` if you are experiencing issues with FP16 builds.
681+
1. FP32 or FP16 have different performance impact to LLM. Recommended to test them for better prompt processing performance on your models. You need to rebuild the code after change `GGML_SYCL_F16=OFF/ON`.
778682

779683
#### Runtime
780684

781685
| Name | Value | Function |
782686
|-------------------|------------------|---------------------------------------------------------------------------------------------------------------------------|
783687
| GGML_SYCL_DEBUG | 0 (default) or 1 | Enable log function by macro: GGML_SYCL_DEBUG |
784688
| GGML_SYCL_DISABLE_OPT | 0 (default) or 1 | Disable optimize features for Intel GPUs. (Recommended to 1 for intel devices older than Gen 10) |
785-
| GGML_SYCL_DISABLE_GRAPH | 0 or 1 (default) | Disable running computations through SYCL Graphs feature. Disabled by default because graph performance isn't yet better than non-graph performance. |
689+
| GGML_SYCL_DISABLE_GRAPH | 0 or 1 (default) | Disable running computations through SYCL Graphs feature. Disabled by default because SYCL Graph is still on development, no better performance. |
786690
| GGML_SYCL_DISABLE_DNN | 0 (default) or 1 | Disable running computations through oneDNN and always use oneMKL. |
787691
| ZES_ENABLE_SYSMAN | 0 (default) or 1 | Support to get free memory of GPU by sycl::aspect::ext_intel_free_memory.<br>Recommended to use when --split-mode = layer |
788692
| UR_L0_ENABLE_RELAXED_ALLOCATION_LIMITS | 0 (default) or 1 | Support malloc device memory more than 4GB.|

ggml/src/ggml-sycl/CMakeLists.txt

Lines changed: 9 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
message(STATUS "GGML_SYCL_TARGET=${GGML_SYCL_TARGET}")
22

3-
if (NOT GGML_SYCL_TARGET MATCHES "^(INTEL|NVIDIA|AMD)$")
4-
message(FATAL_ERROR "Invalid backend chosen, supported options are INTEL, NVIDIA, or AMD")
3+
if (NOT GGML_SYCL_TARGET MATCHES "^(INTEL)$")
4+
message(FATAL_ERROR "GGML_SYCL_TARGET: Invalid target, the supported options are [INTEL]")
55
endif()
66

77
check_cxx_compiler_flag("-fsycl" SUPPORTS_SYCL)
@@ -125,106 +125,27 @@ endif()
125125
target_compile_definitions(ggml-sycl PRIVATE GGML_SYCL_DNNL=${GGML_SYCL_DNNL})
126126

127127
if (GGML_SYCL_F16)
128-
if (GGML_SYCL_TARGET STREQUAL "AMD")
129-
message(WARNING "AMD target does not entirely support FP16 in the SYCL backend.")
130-
endif()
131128
add_compile_definitions(GGML_SYCL_F16)
132129
endif()
133130

134131
if (GGML_SYCL_TARGET STREQUAL "INTEL")
135132
add_compile_definitions(GGML_SYCL_WARP_SIZE=16)
136133
target_link_options(ggml-sycl PRIVATE -Xs -ze-intel-greater-than-4GB-buffer-required)
137-
elseif (GGML_SYCL_TARGET STREQUAL "NVIDIA")
138-
add_compile_definitions(GGML_SYCL_WARP_SIZE=32)
139-
elseif (GGML_SYCL_TARGET STREQUAL "AMD")
140-
# INFO: Allowed Sub_group_sizes are not consistent through all
141-
# hip targets. For example, 64 is used for certain models, but the backend
142-
# does not support it.
143-
# Target archs tested working: gfx1030, gfx1031, (Only tested sub_group_size = 32)
144-
add_compile_definitions(GGML_SYCL_WARP_SIZE=32)
145-
else()
146-
# default for other target
147-
add_compile_definitions(GGML_SYCL_WARP_SIZE=32)
148-
endif()
149-
150-
if (GGML_SYCL_GRAPH)
151-
target_compile_definitions(ggml-sycl PRIVATE GGML_SYCL_GRAPH)
152-
endif()
153134

154-
# Link against Intel oneMKL or oneMath
155-
if (GGML_SYCL_TARGET STREQUAL "INTEL")
156-
# Intel devices use Intel oneMKL directly instead of oneMath to avoid the limitation of linking Intel oneMKL statically
157-
# See https://github.com/uxlfoundation/oneMath/issues/654
135+
# Link against Intel oneMKL
158136
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
159137
set(SYCL_COMPILER ON)
160138
endif()
161139
find_package(MKL REQUIRED)
162140
target_link_libraries(ggml-sycl PRIVATE MKL::MKL_SYCL::BLAS)
163-
target_compile_definitions(ggml-sycl PRIVATE GGML_SYCL_USE_INTEL_ONEMKL)
164141
else()
165-
find_package(oneMath QUIET)
166-
if (NOT oneMath_FOUND)
167-
message(STATUS "oneMath not found: oneMath will be automatically downloaded")
168-
# Use FetchContent to automatically pull and build oneMath
169-
include(FetchContent)
170-
set(BUILD_FUNCTIONAL_TESTS False)
171-
set(BUILD_EXAMPLES False)
172-
set(TARGET_DOMAINS blas)
173-
if (GGML_SYCL_TARGET STREQUAL "NVIDIA")
174-
set(ENABLE_MKLCPU_BACKEND False)
175-
set(ENABLE_MKLGPU_BACKEND False)
176-
set(ENABLE_CUBLAS_BACKEND True)
177-
elseif (GGML_SYCL_TARGET STREQUAL "AMD")
178-
set(ENABLE_MKLCPU_BACKEND False)
179-
set(ENABLE_MKLGPU_BACKEND False)
180-
set(ENABLE_ROCBLAS_BACKEND True)
181-
# Ensure setting a string variable here is not overriden by oneMath CACHE variables
182-
cmake_policy(SET CMP0126 NEW)
183-
# Setting the device architecture is only needed and useful for AMD devices in oneMath
184-
set(HIP_TARGETS ${GGML_SYCL_DEVICE_ARCH} CACHE STRING "oneMath HIP target" FORCE)
185-
endif()
186-
FetchContent_Declare(
187-
ONEMATH
188-
GIT_REPOSITORY https://github.com/uxlfoundation/oneMath.git
189-
GIT_TAG 8efe85f5aaebb37f1d8c503b7af66315feabf142
190-
)
191-
FetchContent_MakeAvailable(ONEMATH)
192-
# Create alias to match with find_package targets name
193-
function(onemath_alias target)
194-
if (TARGET ${target}_obj)
195-
# Silence verbose warnings from external libraries
196-
target_compile_options(${target}_obj PRIVATE -w)
197-
endif()
198-
if (TARGET ${target})
199-
add_library(ONEMATH::${target} ALIAS ${target})
200-
endif()
201-
endfunction()
202-
onemath_alias(onemath)
203-
onemath_alias(onemath_blas_mklcpu)
204-
onemath_alias(onemath_blas_mklgpu)
205-
onemath_alias(onemath_blas_cublas)
206-
onemath_alias(onemath_blas_rocblas)
207-
endif()
142+
# default for other target
143+
message(FATAL_ERROR "GGML_SYCL_TARGET is not supported")
144+
add_compile_definitions(GGML_SYCL_WARP_SIZE=32)
145+
endif()
208146

209-
# Below oneMath compile-time dispatching is used for better performance
210-
if (GGML_SYCL_TARGET STREQUAL "NVIDIA")
211-
target_link_libraries(ggml-sycl PRIVATE ONEMATH::onemath_blas_cublas)
212-
target_compile_options(ggml-sycl PRIVATE "-fsycl-targets=nvptx64-nvidia-cuda")
213-
target_link_options(ggml-sycl PRIVATE "-fsycl-targets=nvptx64-nvidia-cuda")
214-
target_compile_definitions(ggml-sycl PRIVATE GGML_SYCL_NVIDIA)
215-
elseif (GGML_SYCL_TARGET STREQUAL "AMD")
216-
if (NOT GGML_SYCL_DEVICE_ARCH)
217-
message(FATAL_ERROR "Can't enable SYCL hip backend, GGML_SYCL_DEVICE_ARCH has not been set.")
218-
endif()
219-
target_link_libraries(ggml-sycl PRIVATE ONEMATH::onemath_blas_rocblas)
220-
target_compile_options(ggml-sycl PRIVATE "-fsycl-targets=amdgcn-amd-amdhsa")
221-
target_link_options(ggml-sycl PRIVATE "-fsycl-targets=amdgcn-amd-amdhsa")
222-
target_compile_definitions(ggml-sycl PRIVATE GGML_SYCL_AMD)
223-
else()
224-
# Fallback to oneMath runtime dispatcher
225-
target_link_libraries(ggml-sycl PRIVATE ONEMATH::onemath)
226-
target_compile_definitions(ggml-sycl PRIVATE GGML_SYCL_GENERIC)
227-
endif()
147+
if (GGML_SYCL_GRAPH)
148+
target_compile_definitions(ggml-sycl PRIVATE GGML_SYCL_GRAPH)
228149
endif()
229150

230151
if (GGML_SYCL_DEVICE_ARCH)

0 commit comments

Comments
 (0)