From a48eebe621957e0d36bd4eed0006033247e5f654 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Tue, 2 May 2023 00:19:10 +0300 Subject: [PATCH 01/14] Add OpenCL and CLBlast support --- .github/workflows/build.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 179080576f249..01e0b2223b93b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -158,12 +158,34 @@ jobs: defines: '-DLLAMA_AVX2=OFF' - build: 'avx512' defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON' + - build: 'opencl' + defines: '-DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"' steps: - name: Clone id: checkout uses: actions/checkout@v1 + - name: Download OpenCL SDK + id: get_opencl + if: ${{ matrix.build == 'opencl' }} + run: | + curl.exe -o $env:RUNNER_TEMP/opencl.zip -L https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v2023.04.17/OpenCL-SDK-v2023.04.17-Win-x64.zip + mkdir $env:RUNNER_TEMP/opencl + tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl + + - name: Download CLBlast + id: get_clblast + if: ${{ matrix.build == 'opencl' }} + run: | + curl.exe -o $env:RUNNER_TEMP/clblast.zip -L https://github.com/CNugteren/CLBlast/releases/download/1.5.3/CLBlast-1.5.3-Windows-x64.zip + mkdir $env:RUNNER_TEMP/clblast + tar.exe -xvf $env:RUNNER_TEMP/clblast.zip -C $env:RUNNER_TEMP/clblast + foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) { + $txt = Get-Content -Path $f -Raw + $txt.Replace('C:/dependencies/opencl/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8 + } + - name: Build id: cmake_build run: | @@ -172,6 +194,12 @@ jobs: cmake .. ${{ matrix.defines }} cmake --build . --config Release + - name: Add clblast.dll + id: add_clblast_dll + if: ${{ matrix.build == 'opencl' }} + run: | + cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release + - name: Check AVX512F support id: check_avx512f if: ${{ matrix.build == 'avx512' }} @@ -187,7 +215,7 @@ jobs: - name: Test id: cmake_test - if: ${{ matrix.build != 'avx512' || env.HAS_AVX512F == '1' }} # Test AVX-512 only when possible + if: ${{ ( matrix.build != 'avx512' || env.HAS_AVX512F == '1' ) && matrix.build != 'opencl' }} # Test AVX-512 only when possible run: | cd build ctest -C Release --verbose From a0de04a6f1a195de6848a7e6ef8e7f533e29fdc8 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Tue, 2 May 2023 13:21:54 +0300 Subject: [PATCH 02/14] Add OpenBLAS support --- .github/workflows/build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01e0b2223b93b..c36231c05f6fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -160,6 +160,8 @@ jobs: defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON' - build: 'opencl' defines: '-DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"' + - build: 'openblas' + defines: '-DLLAMA_OPENBLAS=ON -DBLAS_LIBRARIES="/LIBPATH:$env:RUNNER_TEMP/openblas/lib" -DOPENBLAS_INC="$env:RUNNER_TEMP/openblas/include"' steps: - name: Clone @@ -185,6 +187,14 @@ jobs: $txt = Get-Content -Path $f -Raw $txt.Replace('C:/dependencies/opencl/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8 } + - name: Download OpenBLAS + id: get_openblas + if: ${{ matrix.build == 'openblas' }} + run: | + curl.exe -o $env:RUNNER_TEMP/openblas.zip -L https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip + mkdir $env:RUNNER_TEMP/openblas + tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas + Rename-Item $env:RUNNER_TEMP/openblas/lib/libopenblas.lib openblas.lib - name: Build id: cmake_build @@ -200,6 +210,12 @@ jobs: run: | cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release + - name: Add libopenblas.dll + id: add_libopenblas_dll + if: ${{ matrix.build == 'openblas' }} + run: | + cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release + - name: Check AVX512F support id: check_avx512f if: ${{ matrix.build == 'avx512' }} From 5d4158b12cff3835dced6457f5ddfe5011ddfc46 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Tue, 2 May 2023 16:54:28 +0300 Subject: [PATCH 03/14] Add testing to matrix --- .github/workflows/build.yml | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c36231c05f6fe..0c32af8b3ab9b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -120,7 +120,7 @@ jobs: make macOS-latest-cmake: - runs-on: macOS-latest + runs-on: macos-latest steps: - name: Clone @@ -152,16 +152,21 @@ jobs: strategy: matrix: include: - - build: 'avx2' - defines: '' - - build: 'avx' - defines: '-DLLAMA_AVX2=OFF' - - build: 'avx512' - defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON' - - build: 'opencl' - defines: '-DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"' - - build: 'openblas' - defines: '-DLLAMA_OPENBLAS=ON -DBLAS_LIBRARIES="/LIBPATH:$env:RUNNER_TEMP/openblas/lib" -DOPENBLAS_INC="$env:RUNNER_TEMP/openblas/include"' + - build: 'avx2' + defines: '' + testing: true + - build: 'avx' + defines: '-DLLAMA_AVX2=OFF' + testing: true + - build: 'avx512' + defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON' + testing: true + - build: 'opencl' + defines: '-DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"' + testing: false + - build: 'openblas' + defines: '-DLLAMA_OPENBLAS=ON -DBLAS_LIBRARIES="/LIBPATH:$env:RUNNER_TEMP/openblas/lib" -DOPENBLAS_INC="$env:RUNNER_TEMP/openblas/include"' + testing: true steps: - name: Clone @@ -187,6 +192,7 @@ jobs: $txt = Get-Content -Path $f -Raw $txt.Replace('C:/dependencies/opencl/', "$($env:RUNNER_TEMP.Replace('\','/'))/opencl/") | Set-Content -Path $f -Encoding UTF8 } + - name: Download OpenBLAS id: get_openblas if: ${{ matrix.build == 'openblas' }} @@ -218,7 +224,7 @@ jobs: - name: Check AVX512F support id: check_avx512f - if: ${{ matrix.build == 'avx512' }} + if: ${{ matrix.testing && matrix.build == 'avx512' }} continue-on-error: true run: | cd build @@ -231,7 +237,7 @@ jobs: - name: Test id: cmake_test - if: ${{ ( matrix.build != 'avx512' || env.HAS_AVX512F == '1' ) && matrix.build != 'opencl' }} # Test AVX-512 only when possible + if: ${{ matrix.testing && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }} # Test AVX-512 only when possible run: | cd build ctest -C Release --verbose From 42b17575228a410b7ec139aabd7687d35819f48f Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Thu, 4 May 2023 16:37:15 +0300 Subject: [PATCH 04/14] Remove testing from matrix --- .github/workflows/build.yml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c32af8b3ab9b..7c60c4be2735d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -154,19 +154,14 @@ jobs: include: - build: 'avx2' defines: '' - testing: true - build: 'avx' defines: '-DLLAMA_AVX2=OFF' - testing: true - build: 'avx512' defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON' - testing: true - build: 'opencl' defines: '-DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"' - testing: false - build: 'openblas' defines: '-DLLAMA_OPENBLAS=ON -DBLAS_LIBRARIES="/LIBPATH:$env:RUNNER_TEMP/openblas/lib" -DOPENBLAS_INC="$env:RUNNER_TEMP/openblas/include"' - testing: true steps: - name: Clone @@ -224,7 +219,7 @@ jobs: - name: Check AVX512F support id: check_avx512f - if: ${{ matrix.testing && matrix.build == 'avx512' }} + if: ${{ matrix.build == 'avx512' }} continue-on-error: true run: | cd build @@ -237,7 +232,7 @@ jobs: - name: Test id: cmake_test - if: ${{ matrix.testing && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }} # Test AVX-512 only when possible + if: ${{ matrix.build != 'opencl' && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }} # Test AVX-512 only when possible run: | cd build ctest -C Release --verbose From f8929309d77a53b759e345619cd44668926261b3 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Thu, 4 May 2023 18:05:12 +0300 Subject: [PATCH 05/14] Download licenses to --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7c60c4be2735d..4715de57cb6ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -192,7 +192,7 @@ jobs: id: get_openblas if: ${{ matrix.build == 'openblas' }} run: | - curl.exe -o $env:RUNNER_TEMP/openblas.zip -L https://github.com/xianyi/OpenBLAS/releases/download/v0.3.21/OpenBLAS-0.3.21-x64.zip + curl.exe -o $env:RUNNER_TEMP/openblas.zip -L https://github.com/xianyi/OpenBLAS/releases/download/v0.3.23/OpenBLAS-0.3.23-x64.zip mkdir $env:RUNNER_TEMP/openblas tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas Rename-Item $env:RUNNER_TEMP/openblas/lib/libopenblas.lib openblas.lib @@ -210,12 +210,14 @@ jobs: if: ${{ matrix.build == 'opencl' }} run: | cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release + curl.exe -L https://github.com/CNugteren/CLBlast/raw/1.5.3/LICENSE -o ./build/bin/Release/CLBlast.LICENSE.txt - name: Add libopenblas.dll id: add_libopenblas_dll if: ${{ matrix.build == 'openblas' }} run: | cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release + curl.exe -L https://github.com/xianyi/OpenBLAS/raw/v0.3.23/LICENSE -o ./build/bin/Release/OpenBLAS.LICENSE.txt - name: Check AVX512F support id: check_avx512f From b0d9e4c322f4d8cbbf962f485b1dcd2119e50b74 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Thu, 4 May 2023 18:22:03 +0300 Subject: [PATCH 06/14] not sure why this is failing --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4715de57cb6ba..5c6cc515a6cac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -181,6 +181,7 @@ jobs: if: ${{ matrix.build == 'opencl' }} run: | curl.exe -o $env:RUNNER_TEMP/clblast.zip -L https://github.com/CNugteren/CLBlast/releases/download/1.5.3/CLBlast-1.5.3-Windows-x64.zip + curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L https://github.com/CNugteren/CLBlast/raw/1.5.3/LICENSE mkdir $env:RUNNER_TEMP/clblast tar.exe -xvf $env:RUNNER_TEMP/clblast.zip -C $env:RUNNER_TEMP/clblast foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) { @@ -193,6 +194,7 @@ jobs: if: ${{ matrix.build == 'openblas' }} run: | curl.exe -o $env:RUNNER_TEMP/openblas.zip -L https://github.com/xianyi/OpenBLAS/releases/download/v0.3.23/OpenBLAS-0.3.23-x64.zip + curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L https://github.com/xianyi/OpenBLAS/raw/v0.3.23/LICENSE mkdir $env:RUNNER_TEMP/openblas tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas Rename-Item $env:RUNNER_TEMP/openblas/lib/libopenblas.lib openblas.lib @@ -210,14 +212,14 @@ jobs: if: ${{ matrix.build == 'opencl' }} run: | cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release - curl.exe -L https://github.com/CNugteren/CLBlast/raw/1.5.3/LICENSE -o ./build/bin/Release/CLBlast.LICENSE.txt + cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release - name: Add libopenblas.dll id: add_libopenblas_dll if: ${{ matrix.build == 'openblas' }} run: | cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release - curl.exe -L https://github.com/xianyi/OpenBLAS/raw/v0.3.23/LICENSE -o ./build/bin/Release/OpenBLAS.LICENSE.txt + cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release - name: Check AVX512F support id: check_avx512f From 52179eb4d9dc4f730c5544685fa8b2ab1dbf7935 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Thu, 4 May 2023 19:05:43 +0300 Subject: [PATCH 07/14] MSVC stuff --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c6cc515a6cac..f9801af791547 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,7 +197,7 @@ jobs: curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L https://github.com/xianyi/OpenBLAS/raw/v0.3.23/LICENSE mkdir $env:RUNNER_TEMP/openblas tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas - Rename-Item $env:RUNNER_TEMP/openblas/lib/libopenblas.lib openblas.lib + lib.exe /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll - name: Build id: cmake_build @@ -218,7 +218,7 @@ jobs: id: add_libopenblas_dll if: ${{ matrix.build == 'openblas' }} run: | - cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release + cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release - name: Check AVX512F support From 92e2b38a9a96f518a4e408bc0e9c439e56529b9b Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Thu, 4 May 2023 19:26:45 +0300 Subject: [PATCH 08/14] more jank --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f9801af791547..3efad842ae7de 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,7 +197,10 @@ jobs: curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L https://github.com/xianyi/OpenBLAS/raw/v0.3.23/LICENSE mkdir $env:RUNNER_TEMP/openblas tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas - lib.exe /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll + $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath) + $msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim())) + $lib = $(join-path $msvc 'bin\Hostx64\x64\lib.exe') + & $lib /machine:x64 "/def:${env:RUNNER_TEMP}/openblas/lib/libopenblas.def" "/out:${env:RUNNER_TEMP}/openblas/lib/openblas.lib" /name:openblas.dll - name: Build id: cmake_build From 5cb13c2fccad804371f7c042047221e080e75e90 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Sat, 6 May 2023 17:57:02 +0300 Subject: [PATCH 09/14] add version numbers --- .github/workflows/build.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d0e551b16f3d..ecce60d90ee34 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,6 +148,10 @@ jobs: windows-latest-cmake: runs-on: windows-latest + env: + OPENBLAS_VERSION: 0.3.23 + OPENCL_VERSION: 2023.04.17 + CLBLAST_VERSION: 1.5.3 strategy: matrix: @@ -172,7 +176,7 @@ jobs: id: get_opencl if: ${{ matrix.build == 'opencl' }} run: | - curl.exe -o $env:RUNNER_TEMP/opencl.zip -L https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v2023.04.17/OpenCL-SDK-v2023.04.17-Win-x64.zip + 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 mkdir $env:RUNNER_TEMP/opencl tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl @@ -180,8 +184,8 @@ jobs: id: get_clblast if: ${{ matrix.build == 'opencl' }} run: | - curl.exe -o $env:RUNNER_TEMP/clblast.zip -L https://github.com/CNugteren/CLBlast/releases/download/1.5.3/CLBlast-1.5.3-Windows-x64.zip - curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L https://github.com/CNugteren/CLBlast/raw/1.5.3/LICENSE + curl.exe -o $env:RUNNER_TEMP/clblast.zip -L https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-Windows-x64.zip + curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE mkdir $env:RUNNER_TEMP/clblast tar.exe -xvf $env:RUNNER_TEMP/clblast.zip -C $env:RUNNER_TEMP/clblast foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) { @@ -193,8 +197,8 @@ jobs: id: get_openblas if: ${{ matrix.build == 'openblas' }} run: | - curl.exe -o $env:RUNNER_TEMP/openblas.zip -L https://github.com/xianyi/OpenBLAS/releases/download/v0.3.23/OpenBLAS-0.3.23-x64.zip - curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L https://github.com/xianyi/OpenBLAS/raw/v0.3.23/LICENSE + curl.exe -o $env:RUNNER_TEMP/openblas.zip -L https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip + curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE mkdir $env:RUNNER_TEMP/openblas tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath) @@ -209,20 +213,21 @@ jobs: cd build cmake .. ${{ matrix.defines }} cmake --build . --config Release + cp ../LICENSE "./bin/Release/llama.cpp-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}.txt" - name: Add clblast.dll id: add_clblast_dll if: ${{ matrix.build == 'opencl' }} run: | cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release - cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release + cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release/CLBlast-${env:CLBLAST_VERSION}.txt - name: Add libopenblas.dll id: add_libopenblas_dll if: ${{ matrix.build == 'openblas' }} run: | cp $env:RUNNER_TEMP/openblas/bin/libopenblas.dll ./build/bin/Release/openblas.dll - cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release + cp $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt ./build/bin/Release/OpenBLAS-${env:OPENBLAS_VERSION}.txt - name: Check AVX512F support id: check_avx512f From 87d8ac92860cbf17bf4cdd43281c49c88136fc3a Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Sat, 6 May 2023 17:59:26 +0300 Subject: [PATCH 10/14] fix --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ecce60d90ee34..f40498d970c07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -176,7 +176,7 @@ jobs: id: get_opencl if: ${{ matrix.build == 'opencl' }} run: | - 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 + 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" mkdir $env:RUNNER_TEMP/opencl tar.exe -xvf $env:RUNNER_TEMP/opencl.zip --strip-components=1 -C $env:RUNNER_TEMP/opencl @@ -184,7 +184,7 @@ jobs: id: get_clblast if: ${{ matrix.build == 'opencl' }} run: | - curl.exe -o $env:RUNNER_TEMP/clblast.zip -L https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-Windows-x64.zip + curl.exe -o $env:RUNNER_TEMP/clblast.zip -L "https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-Windows-x64.zip" curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE mkdir $env:RUNNER_TEMP/clblast tar.exe -xvf $env:RUNNER_TEMP/clblast.zip -C $env:RUNNER_TEMP/clblast @@ -197,8 +197,8 @@ jobs: id: get_openblas if: ${{ matrix.build == 'openblas' }} run: | - curl.exe -o $env:RUNNER_TEMP/openblas.zip -L https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip - curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE + curl.exe -o $env:RUNNER_TEMP/openblas.zip -L "https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip" + curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE" mkdir $env:RUNNER_TEMP/openblas tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas $vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath) From 0dfa17db1e5d0ca1064ab90ab2568387c48bc730 Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Sat, 6 May 2023 17:59:44 +0300 Subject: [PATCH 11/14] fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f40498d970c07..0505cef4b0422 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -185,7 +185,7 @@ jobs: if: ${{ matrix.build == 'opencl' }} run: | curl.exe -o $env:RUNNER_TEMP/clblast.zip -L "https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-Windows-x64.zip" - curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE + curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L "https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE" mkdir $env:RUNNER_TEMP/clblast tar.exe -xvf $env:RUNNER_TEMP/clblast.zip -C $env:RUNNER_TEMP/clblast foreach ($f in (gci -Recurse -Path "$env:RUNNER_TEMP/clblast" -Filter '*.cmake')) { From 29869512038567d86f9734676f2552814e7abdac Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Sat, 6 May 2023 18:02:05 +0300 Subject: [PATCH 12/14] fix --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0505cef4b0422..ab1c71168f4a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -197,7 +197,7 @@ jobs: id: get_openblas if: ${{ matrix.build == 'openblas' }} run: | - curl.exe -o $env:RUNNER_TEMP/openblas.zip -L "https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip" + curl.exe -o $env:RUNNER_TEMP/openblas.zip -L "https://github.com/xianyi/OpenBLAS/releases/download/v${env:OPENBLAS_VERSION}/OpenBLAS-${env:OPENBLAS_VERSION}-x64.zip" curl.exe -o $env:RUNNER_TEMP/OpenBLAS.LICENSE.txt -L "https://github.com/xianyi/OpenBLAS/raw/v${env:OPENBLAS_VERSION}/LICENSE" mkdir $env:RUNNER_TEMP/openblas tar.exe -xvf $env:RUNNER_TEMP/openblas.zip -C $env:RUNNER_TEMP/openblas From 09236f40b4d30b34ca1526aa2afef46de60b4a4f Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Sat, 6 May 2023 18:41:56 +0300 Subject: [PATCH 13/14] llama license text --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ab1c71168f4a9..4b51f2100d113 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -213,7 +213,7 @@ jobs: cd build cmake .. ${{ matrix.defines }} cmake --build . --config Release - cp ../LICENSE "./bin/Release/llama.cpp-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}.txt" + cp ../LICENSE ./bin/Release/llama.cpp.txt - name: Add clblast.dll id: add_clblast_dll From 963b27450c1ec6100be193dc8d0fc3c3ff50d73f Mon Sep 17 00:00:00 2001 From: Henri Vasserman Date: Sun, 7 May 2023 12:29:20 +0300 Subject: [PATCH 14/14] change build name to 'clblast' --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b51f2100d113..a5938bf93684f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -162,7 +162,7 @@ jobs: defines: '-DLLAMA_AVX2=OFF' - build: 'avx512' defines: '-DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON' - - build: 'opencl' + - build: 'clblast' defines: '-DLLAMA_CLBLAST=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"' - build: 'openblas' defines: '-DLLAMA_OPENBLAS=ON -DBLAS_LIBRARIES="/LIBPATH:$env:RUNNER_TEMP/openblas/lib" -DOPENBLAS_INC="$env:RUNNER_TEMP/openblas/include"' @@ -174,7 +174,7 @@ jobs: - name: Download OpenCL SDK id: get_opencl - if: ${{ matrix.build == 'opencl' }} + if: ${{ matrix.build == 'clblast' }} run: | 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" mkdir $env:RUNNER_TEMP/opencl @@ -182,7 +182,7 @@ jobs: - name: Download CLBlast id: get_clblast - if: ${{ matrix.build == 'opencl' }} + if: ${{ matrix.build == 'clblast' }} run: | curl.exe -o $env:RUNNER_TEMP/clblast.zip -L "https://github.com/CNugteren/CLBlast/releases/download/${env:CLBLAST_VERSION}/CLBlast-${env:CLBLAST_VERSION}-Windows-x64.zip" curl.exe -o $env:RUNNER_TEMP/CLBlast.LICENSE.txt -L "https://github.com/CNugteren/CLBlast/raw/${env:CLBLAST_VERSION}/LICENSE" @@ -217,7 +217,7 @@ jobs: - name: Add clblast.dll id: add_clblast_dll - if: ${{ matrix.build == 'opencl' }} + if: ${{ matrix.build == 'clblast' }} run: | cp $env:RUNNER_TEMP/clblast/lib/clblast.dll ./build/bin/Release cp $env:RUNNER_TEMP/CLBlast.LICENSE.txt ./build/bin/Release/CLBlast-${env:CLBLAST_VERSION}.txt @@ -244,7 +244,7 @@ jobs: - name: Test id: cmake_test - if: ${{ matrix.build != 'opencl' && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }} # Test AVX-512 only when possible + if: ${{ matrix.build != 'clblast' && (matrix.build != 'avx512' || env.HAS_AVX512F == '1') }} # Test AVX-512 only when possible run: | cd build ctest -C Release --verbose