]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
Introducing experimental OpenCL backend with support for Qualcomm Adreno GPUs (#10693)
authorlhez <redacted>
Fri, 13 Dec 2024 20:23:52 +0000 (12:23 -0800)
committerGitHub <redacted>
Fri, 13 Dec 2024 20:23:52 +0000 (12:23 -0800)
commita76c56fa1a3d27467eb97468d8c3b2fe1243b61a
tree6a4a4907ab53f6bfc84fae619fea2e0cb7f3efd0
parentc27ac678dd393af0da9b8acf10266e760c8a0912
Introducing experimental OpenCL backend with support for Qualcomm Adreno GPUs (#10693)

* [cl][adreno] Add Adreno GPU support

Add new OpenCL backend to support Adreno GPUs

---------

Co-authored-by: Skyler Szot <redacted>
Co-authored-by: Shangqing Gu <redacted>
Co-authored-by: Alexander Angus <redacted>
Co-authored-by: Hongqiang Wang <redacted>
Co-authored-by: Max Krasnyansky <redacted>
* [cl][ci] Add workflow for CL

* [cl][adreno] Fix memory leak for non SMALL_ALLOC path

* opencl: integrate backend dyn.load interface and fix compiler and format warnings

* opencl: remove small-alloc support and fix build errors for non-opencl platforms

* opencl: fixed merge conflict (MUSA added twice in cmake)

* opencl-ci: use RUNNER_TEMP instead of github.workspace

* opencl: fix embed tool invocation with python3

* opencl: CI workflow fixes

* opencl: Clean up small-alloc in CMake files

* opencl: cleanup ggml-opencl2 header file

* opencl: use ulong for offsets and strides in ADD kernel

* opencl: use cl_ulong for all offsets

* opencl: use cl_ulong for sizes and strides

* opencl: use `GGML_LOG_xxx` instead of `fprintf(stderr, ...)`

* opencl: rename backend `opencl2` -> `opencl`

* opencl: rename kernel files `ggml-opencl2` -> `ggml-opencl`

* opencl: make OpenCL required, remove redundant lib and inc directories

* `ggml-base`, `..` and `.` are added by `ggml_add_backend_library`

* opencl: rename backend - funcs, structs, etc `opencl2` -> `opencl`

* opencl: remove copyright marker since main license already covers

* opencl: replace some more OPENCL2 leftovers

* opencl: remove limits on `tensor_extra`

* opencl: use pools for `tensor_extra`

* opencl: fix compiler warnings with GCC and Clang

Still getting the warning about clCreateCmdQueue being obsolete.
Will fix that separately.

* opencl: fail gracefully if opencl devices are not available

Also for unsupported GPUs.

* opencl: fix MSVC builds (string length error)

* opencl: check for various requirements, allow deprecated API

* opencl: update log message for unsupported GPUs

---------

Co-authored-by: Skyler Szot <redacted>
Co-authored-by: Shangqing Gu <redacted>
Co-authored-by: Alexander Angus <redacted>
Co-authored-by: Hongqiang Wang <redacted>
Co-authored-by: Max Krasnyansky <redacted>
17 files changed:
.github/workflows/build.yml
ggml/CMakeLists.txt
ggml/include/ggml-opencl.h [new file with mode: 0644]
ggml/src/CMakeLists.txt
ggml/src/ggml-backend-reg.cpp
ggml/src/ggml-opencl/CMakeLists.txt [new file with mode: 0644]
ggml/src/ggml-opencl/ggml-opencl.cpp [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/embed_kernel.py [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl.cl [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl_cvt.cl [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl_gemv_noshuffle.cl [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl_gemv_noshuffle_general.cl [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl_mm.cl [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl_mul_mat_Ab_Bi_8x4.cl [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl_transpose_16.cl [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl_transpose_32.cl [new file with mode: 0644]
ggml/src/ggml-opencl/kernels/ggml-opencl_transpose_32_16.cl [new file with mode: 0644]