Skip to content

Commit f1ec4ae

Browse files
authored
Merge pull request #782 from martindevans/remove_opencl
Remove OpenCL Backend.
2 parents 6444daf + 0e08ac8 commit f1ec4ae

File tree

2 files changed

+2
-138
lines changed

2 files changed

+2
-138
lines changed

.github/workflows/compile.yml

Lines changed: 2 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -99,106 +99,6 @@ jobs:
9999
with:
100100
path: .\build\bin\Release\llava_shared.dll
101101
name: llava-bin-win-${{ matrix.build }}-x64.dll
102-
103-
compile-clblast:
104-
name: Compile (clblast) - ${{ matrix.os }}
105-
strategy:
106-
fail-fast: false
107-
matrix:
108-
os: [
109-
ubuntu-22.04,
110-
windows-latest
111-
]
112-
env:
113-
OPENBLAS_VERSION: 0.3.23
114-
OPENCL_VERSION: 2023.04.17
115-
CLBLAST_VERSION: 1.6.0
116-
VULKAN_VERSION: 1.3.261.1
117-
runs-on: ${{ matrix.os }}
118-
steps:
119-
- name: Clone
120-
id: checkout
121-
uses: actions/checkout@v4
122-
with:
123-
repository: ggerganov/llama.cpp
124-
ref: '${{ github.event.inputs.llama_cpp_commit }}'
125-
- name: Download dependencies - Linux
126-
if: ${{ matrix.os == 'ubuntu-22.04' }}
127-
run: |
128-
sudo apt update
129-
sudo apt install libopencl-clang-dev libclblast-dev
130-
131-
- name: Download dependencies - Windows
132-
id: get_opencl
133-
if: ${{ matrix.os == 'windows-latest' }}
134-
run: |
135-
curl.exe -o $env:RUNNER_TEMP/opencl.zip -L "https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v${env:OPENCL_VERSION}/OpenCL-SDK-v${env:OPENCL_VERSION}-Win-x64.zip"
136-
mkdir $env:RUNNER_TEMP/opencl
137-
tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl
138-
curl.exe -o $env:RUNNER_TEMP/clblast.7z -L "https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-windows-x64.7z"
139-
curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L "https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE"
140-
7z x "-o${env:RUNNER_TEMP}" $env:RUNNER_TEMP/clblast.7z
141-
rename-item $env:RUNNER_TEMP/CLBlast-${env:CLBLAST_VERSION}-windows-x64 clblast
142-
foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) {
143-
$txt = Get-Content -Path $f -Raw
144-
$txt.Replace('C:/vcpkg/packages/opencl_x64-windows/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8
145-
}
146-
147-
- name: Build
148-
id: cmake_build
149-
if: ${{ matrix.os == 'windows-latest' }}
150-
run: |
151-
mkdir build
152-
cd build
153-
cmake .. ${{ env.COMMON_DEFINE }} -DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"
154-
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
155-
copy $env:RUNNER_TEMP/clblast/lib/clblast.dll .\bin\Release\clblast.dll
156-
# # We should probably generate a sha256 sum in a file, and use that.
157-
# echo "78a8c98bcb2efe1a63318d901ab204d9ba96c3b29707b4ce0c4240bdcdc698d6 ./bin/Release/clblast.dll" >> tmp
158-
# sha256sum -c tmp || exit 255
159-
# rm tmp
160-
ls -R
161-
- name: Build
162-
if: ${{ matrix.os == 'ubuntu-22.04' }}
163-
run: |
164-
mkdir build
165-
cd build
166-
cmake .. ${{ env.COMMON_DEFINE }} -DLLAMA_CLBLAST=ON
167-
cmake --build . --config Release -j ${env:NUMBER_OF_PROCESSORS}
168-
# if we ever want to pull libclblast.so back into the packages, just uncomment this line, and the one below for the upload
169-
# cp $(ldconfig -p | grep libclblast.so | tail -n 1 | cut -d ' ' -f 4) ./
170-
ls -R
171-
- name: Upload artifacts (Windows)
172-
if: ${{ matrix.os == 'windows-latest' }}
173-
uses: actions/upload-artifact@v4
174-
with:
175-
path: |
176-
.\build\bin\Release\llama.dll
177-
.\build\bin\Release\clblast.dll
178-
name: llama-bin-win-clblast-x64.dll
179-
- name: Upload llava artifacts (Windows)
180-
if: ${{ matrix.os == 'windows-latest' }}
181-
uses: actions/upload-artifact@v4
182-
with:
183-
path: |
184-
.\build\bin\Release\llava_shared.dll
185-
name: llava-bin-win-clblast-x64.dll
186-
- name: Upload artifacts (linux)
187-
if: ${{ matrix.os == 'ubuntu-22.04' }}
188-
uses: actions/upload-artifact@v4
189-
with:
190-
path: |
191-
./build/libllama.so
192-
# ./build/libclblast.so
193-
name: llama-bin-linux-clblast-x64.so
194-
- name: Upload llava artifacts (linux)
195-
if: ${{ matrix.os == 'ubuntu-22.04' }}
196-
uses: actions/upload-artifact@v4
197-
with:
198-
path: |
199-
./build/examples/llava/libllava_shared.so
200-
name: llava-bin-linux-clblast-x64.so
201-
202102

203103
compile-cublas:
204104
name: Compile (cublas)
@@ -323,8 +223,7 @@ jobs:
323223
"compile-linux",
324224
"compile-macos",
325225
"compile-windows",
326-
"compile-cublas",
327-
"compile-clblast"
226+
"compile-cublas"
328227
]
329228
steps:
330229
- uses: actions/download-artifact@v4
@@ -335,7 +234,7 @@ jobs:
335234
- name: Rearrange Files
336235
run: |
337236
# Make all directories at once
338-
mkdir --parents deps/{avx,avx2,avx512,osx-arm64,osx-x64,osx-x64-rosetta2,cu11.7.1,cu12.1.0,clblast}
237+
mkdir --parents deps/{avx,avx2,avx512,osx-arm64,osx-x64,osx-x64-rosetta2,cu11.7.1,cu12.1.0}
339238
340239
cp artifacts/llama-bin-linux-noavx-x64.so/libllama.so deps/libllama.so
341240
cp artifacts/llama-bin-linux-avx-x64.so/libllama.so deps/avx/libllama.so
@@ -379,11 +278,6 @@ jobs:
379278
380279
cp artifacts/llama-bin-linux-cublas-cu12.1.0-x64.so/libllama.so deps/cu12.1.0/libllama.so
381280
cp artifacts/llava-bin-linux-cublas-cu12.1.0-x64.so/libllava_shared.so deps/cu12.1.0/libllava_shared.so
382-
383-
cp artifacts/llama-bin-win-clblast-x64.dll/{llama,clblast}.dll deps/clblast/
384-
cp artifacts/llava-bin-win-clblast-x64.dll/llava_shared.dll deps/clblast/llava_shared.dll
385-
cp artifacts/llama-bin-linux-clblast-x64.so/libllama.so deps/clblast/
386-
cp artifacts/llava-bin-linux-clblast-x64.so/libllava_shared.so deps/clblast/libllava_shared.so
387281
388282
389283
- name: Upload artifacts

LLama/runtimes/build/LLamaSharp.Backend.OpenCL.nuspec

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)