From 2c0d88eaaba289ac462c5d17d0b3b5f2274a91b8 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Fri, 25 Oct 2024 10:43:47 +0300 Subject: [PATCH 1/5] ci : fix openblas build --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdd45a99804..49f16e53142 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -308,7 +308,7 @@ jobs: - name: Build using CMake w/ OpenBLAS shell: msys2 {0} run: | - cmake -B build -DGGML_OPENBLAS=ON + cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS cmake --build build --config ${{ matrix.build }} -j $(nproc) windows: @@ -417,7 +417,8 @@ jobs: run: > cmake -S . -B ./build -A ${{ matrix.arch }} -DCMAKE_BUILD_TYPE=${{ matrix.build }} - -DGGML_OPENBLAS=${{ matrix.blas }} + -DGGML_BLAS=${{ matrix.blas }} + -DGGML_BLAS_VENDOR=OpenBLAS -DCMAKE_LIBRARY_PATH="$env:OPENBLAS_PATH/lib" -DWHISPER_SDL2=${{ matrix.sdl2 }} From 763ad20c174adacd5c4507b8c79ec265bc447c8f Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Fri, 25 Oct 2024 13:47:27 +0300 Subject: [PATCH 2/5] cont : would this work? --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49f16e53142..b8bf9dbe3ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -278,6 +278,7 @@ jobs: mingw-w64-${{matrix.env}}-cmake mingw-w64-${{matrix.env}}-SDL2 mingw-w64-${{matrix.env}}-openblas + mingw-w64-${{matrix.env}}-pkgconf - name: Build using make shell: msys2 {0} From 318dad5273a96b5fe53622c10bca408ac84b0398 Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Fri, 25 Oct 2024 16:03:59 +0300 Subject: [PATCH 3/5] ci : I'm sorry, windows --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b8bf9dbe3ce..328c343ff88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -278,7 +278,6 @@ jobs: mingw-w64-${{matrix.env}}-cmake mingw-w64-${{matrix.env}}-SDL2 mingw-w64-${{matrix.env}}-openblas - mingw-w64-${{matrix.env}}-pkgconf - name: Build using make shell: msys2 {0} @@ -305,12 +304,13 @@ jobs: shell: msys2 {0} run: | rm -rf build - - - name: Build using CMake w/ OpenBLAS - shell: msys2 {0} - run: | - cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS - cmake --build build --config ${{ matrix.build }} -j $(nproc) +# TODO: fails for some reason: https://github.com/ggerganov/whisper.cpp/actions/runs/11516781296/job/32060139298?pr=2511 +# +# - name: Build using CMake w/ OpenBLAS +# shell: msys2 {0} +# run: | +# cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS +# cmake --build build --config ${{ matrix.build }} -j $(nproc) windows: runs-on: windows-latest From 6a89f3ea0f4b59dfb796b45bb3e6d5c6222c3f6e Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Fri, 25 Oct 2024 19:19:06 +0300 Subject: [PATCH 4/5] cont : disabled wrong build --- .github/workflows/build.yml | 154 ++++++++++++++++++------------------ 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 328c343ff88..7d6c0d1a1eb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -304,13 +304,12 @@ jobs: shell: msys2 {0} run: | rm -rf build -# TODO: fails for some reason: https://github.com/ggerganov/whisper.cpp/actions/runs/11516781296/job/32060139298?pr=2511 -# -# - name: Build using CMake w/ OpenBLAS -# shell: msys2 {0} -# run: | -# cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS -# cmake --build build --config ${{ matrix.build }} -j $(nproc) + + - name: Build using CMake w/ OpenBLAS + shell: msys2 {0} + run: | + cmake -B build -DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS + cmake --build build --config ${{ matrix.build }} -j $(nproc) windows: runs-on: windows-latest @@ -372,76 +371,77 @@ jobs: name: whisper-bin-${{ matrix.arch }} path: build/bin/${{ matrix.build }} - windows-blas: - runs-on: windows-latest - - strategy: - matrix: - build: [Release] - arch: [Win32, x64] - blas: [ON] - sdl2: [ON] - include: - - arch: Win32 - obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x86.zip - s2arc: x86 - - arch: x64 - obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x64.zip - s2arc: x64 - - sdl2: ON - s2ver: 2.28.5 - - steps: - - name: Clone - uses: actions/checkout@v4 - - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - - name: Fetch OpenBLAS - if: matrix.blas == 'ON' - run: | - C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }} - 7z x blas.zip -oblas -y - copy blas/include/cblas.h . - copy blas/include/openblas_config.h . - echo "OPENBLAS_PATH=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV - - - name: Fetch SDL2 and set SDL2_DIR - if: matrix.sdl2 == 'ON' - run: | - C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${{ matrix.s2ver }}/SDL2-devel-${{ matrix.s2ver }}-VC.zip - 7z x sdl2.zip - echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV - - - name: Configure - run: > - cmake -S . -B ./build -A ${{ matrix.arch }} - -DCMAKE_BUILD_TYPE=${{ matrix.build }} - -DGGML_BLAS=${{ matrix.blas }} - -DGGML_BLAS_VENDOR=OpenBLAS - -DCMAKE_LIBRARY_PATH="$env:OPENBLAS_PATH/lib" - -DWHISPER_SDL2=${{ matrix.sdl2 }} - - - name: Build - run: | - cd ./build - msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }} - - - name: Copy libopenblas.dll - if: matrix.blas == 'ON' - run: copy "$env:OPENBLAS_PATH/bin/libopenblas.dll" build/bin/${{ matrix.build }} - - - name: Copy SDL2.dll - if: matrix.sdl2 == 'ON' - run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }} - - - name: Upload binaries - if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' - uses: actions/upload-artifact@v4 - with: - name: whisper-blas-bin-${{ matrix.arch }} - path: build/bin/${{ matrix.build }} +# TODO: fails for some reason: https://github.com/ggerganov/whisper.cpp/actions/runs/11516781296/job/32060139298?pr=2511 +# windows-blas: +# runs-on: windows-latest +# +# strategy: +# matrix: +# build: [Release] +# arch: [Win32, x64] +# blas: [ON] +# sdl2: [ON] +# include: +# - arch: Win32 +# obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x86.zip +# s2arc: x86 +# - arch: x64 +# obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x64.zip +# s2arc: x64 +# - sdl2: ON +# s2ver: 2.28.5 +# +# steps: +# - name: Clone +# uses: actions/checkout@v4 +# +# - name: Add msbuild to PATH +# uses: microsoft/setup-msbuild@v2 +# +# - name: Fetch OpenBLAS +# if: matrix.blas == 'ON' +# run: | +# C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }} +# 7z x blas.zip -oblas -y +# copy blas/include/cblas.h . +# copy blas/include/openblas_config.h . +# echo "OPENBLAS_PATH=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV +# +# - name: Fetch SDL2 and set SDL2_DIR +# if: matrix.sdl2 == 'ON' +# run: | +# C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${{ matrix.s2ver }}/SDL2-devel-${{ matrix.s2ver }}-VC.zip +# 7z x sdl2.zip +# echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV +# +# - name: Configure +# run: > +# cmake -S . -B ./build -A ${{ matrix.arch }} +# -DCMAKE_BUILD_TYPE=${{ matrix.build }} +# -DGGML_BLAS=${{ matrix.blas }} +# -DGGML_BLAS_VENDOR=OpenBLAS +# -DCMAKE_LIBRARY_PATH="$env:OPENBLAS_PATH/lib" +# -DWHISPER_SDL2=${{ matrix.sdl2 }} +# +# - name: Build +# run: | +# cd ./build +# msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }} +# +# - name: Copy libopenblas.dll +# if: matrix.blas == 'ON' +# run: copy "$env:OPENBLAS_PATH/bin/libopenblas.dll" build/bin/${{ matrix.build }} +# +# - name: Copy SDL2.dll +# if: matrix.sdl2 == 'ON' +# run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }} +# +# - name: Upload binaries +# if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' +# uses: actions/upload-artifact@v4 +# with: +# name: whisper-blas-bin-${{ matrix.arch }} +# path: build/bin/${{ matrix.build }} windows-cublas: runs-on: windows-2019 From b4a022878c2bf96476a478d97395c953c228af53 Mon Sep 17 00:00:00 2001 From: Tamotsu Takahashi Date: Mon, 28 Oct 2024 20:09:17 +0900 Subject: [PATCH 5/5] ci : fix openblas build with pkgconfiglite (#2517) - choco install pkgconfiglite (vcpkg-pkgconf doesn't contain pkg-config executable?) - vcpkg install openblas (otherwise it is not detected now) --- .github/workflows/build.yml | 144 ++++++++++++++++++------------------ 1 file changed, 73 insertions(+), 71 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d6c0d1a1eb..e9fe767302e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,6 +3,7 @@ on: [push, pull_request] env: ubuntu_image: "ubuntu:22.04" + VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" jobs: ubuntu-latest: @@ -371,77 +372,78 @@ jobs: name: whisper-bin-${{ matrix.arch }} path: build/bin/${{ matrix.build }} -# TODO: fails for some reason: https://github.com/ggerganov/whisper.cpp/actions/runs/11516781296/job/32060139298?pr=2511 -# windows-blas: -# runs-on: windows-latest -# -# strategy: -# matrix: -# build: [Release] -# arch: [Win32, x64] -# blas: [ON] -# sdl2: [ON] -# include: -# - arch: Win32 -# obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x86.zip -# s2arc: x86 -# - arch: x64 -# obzip: https://github.com/OpenMathLib/OpenBLAS/releases/download/v0.3.25/OpenBLAS-0.3.25-x64.zip -# s2arc: x64 -# - sdl2: ON -# s2ver: 2.28.5 -# -# steps: -# - name: Clone -# uses: actions/checkout@v4 -# -# - name: Add msbuild to PATH -# uses: microsoft/setup-msbuild@v2 -# -# - name: Fetch OpenBLAS -# if: matrix.blas == 'ON' -# run: | -# C:/msys64/usr/bin/wget.exe -qO blas.zip ${{ matrix.obzip }} -# 7z x blas.zip -oblas -y -# copy blas/include/cblas.h . -# copy blas/include/openblas_config.h . -# echo "OPENBLAS_PATH=$env:GITHUB_WORKSPACE/blas" >> $env:GITHUB_ENV -# -# - name: Fetch SDL2 and set SDL2_DIR -# if: matrix.sdl2 == 'ON' -# run: | -# C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${{ matrix.s2ver }}/SDL2-devel-${{ matrix.s2ver }}-VC.zip -# 7z x sdl2.zip -# echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV -# -# - name: Configure -# run: > -# cmake -S . -B ./build -A ${{ matrix.arch }} -# -DCMAKE_BUILD_TYPE=${{ matrix.build }} -# -DGGML_BLAS=${{ matrix.blas }} -# -DGGML_BLAS_VENDOR=OpenBLAS -# -DCMAKE_LIBRARY_PATH="$env:OPENBLAS_PATH/lib" -# -DWHISPER_SDL2=${{ matrix.sdl2 }} -# -# - name: Build -# run: | -# cd ./build -# msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }} -# -# - name: Copy libopenblas.dll -# if: matrix.blas == 'ON' -# run: copy "$env:OPENBLAS_PATH/bin/libopenblas.dll" build/bin/${{ matrix.build }} -# -# - name: Copy SDL2.dll -# if: matrix.sdl2 == 'ON' -# run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }} -# -# - name: Upload binaries -# if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' -# uses: actions/upload-artifact@v4 -# with: -# name: whisper-blas-bin-${{ matrix.arch }} -# path: build/bin/${{ matrix.build }} + windows-blas: + runs-on: windows-latest + + strategy: + matrix: + build: [Release] + arch: [Win32, x64] + blas: [ON] + sdl2: [ON] + include: + - arch: Win32 + s2arc: x86 + - arch: x64 + s2arc: x64 + - sdl2: ON + s2ver: 2.28.5 + + steps: + - name: Clone + uses: actions/checkout@v4 + + - name: Export GitHub Actions cache environment variables + uses: actions/github-script@v7 + with: + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); + + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v2 + + - name: Install OpenBLAS and pkgconfiglite + if: matrix.blas == 'ON' + run: | + vcpkg install --triplet=${{ matrix.s2arc }}-windows openblas + choco install pkgconfiglite + + - name: Fetch SDL2 and set SDL2_DIR + if: matrix.sdl2 == 'ON' + run: | + C:/msys64/usr/bin/wget.exe -qO sdl2.zip https://github.com/libsdl-org/SDL/releases/download/release-${{ matrix.s2ver }}/SDL2-devel-${{ matrix.s2ver }}-VC.zip + 7z x sdl2.zip + echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV + + - name: Configure + run: > + cmake -S . -B ./build -A ${{ matrix.arch }} + -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" + -DCMAKE_BUILD_TYPE=${{ matrix.build }} + -DGGML_BLAS=${{ matrix.blas }} + -DGGML_BLAS_VENDOR=OpenBLAS + -DWHISPER_SDL2=${{ matrix.sdl2 }} + + - name: Build + run: | + cd ./build + msbuild ALL_BUILD.vcxproj -t:build -p:configuration=${{ matrix.build }} -p:platform=${{ matrix.arch }} + + - name: Copy openblas.dll + if: matrix.blas == 'ON' + run: copy "C:/vcpkg/packages/openblas_${{ matrix.s2arc }}-windows/bin/openblas.dll" build/bin/${{ matrix.build }} + + - name: Copy SDL2.dll + if: matrix.sdl2 == 'ON' + run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }} + + - name: Upload binaries + if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' + uses: actions/upload-artifact@v4 + with: + name: whisper-blas-bin-${{ matrix.arch }} + path: build/bin/${{ matrix.build }} windows-cublas: runs-on: windows-2019