danbev commited on
Commit
bafccd1
·
unverified ·
1 Parent(s): 9a681c7

ci : use dynamic libopenblas.dll for window-blas (#3177)

Browse files

* ci : use dynamic libopenblas.dll for window-blas

This commit updates the windows-blas job to use the dynamic (can load
different kernels depending of the CPU arch) libopenblas.dll instead of
the "static" openblas.dll that get installed by vcpgk.

The motivation for this change is that there have been reports of
performance drops in later version specifically related to blas. Please
see the links below for more details.

Resolves: https://github.com/ggml-org/whisper.cpp/issues/3166
Refs: https://github.com/ggml-org/whisper.cpp/issues/2666#issuecomment-2885978811

Files changed (1) hide show
  1. .github/workflows/build.yml +9 -8
.github/workflows/build.yml CHANGED
@@ -629,11 +629,14 @@ jobs:
629
  arch: [Win32, x64]
630
  blas: [ON]
631
  sdl2: [ON]
 
632
  include:
633
  - arch: Win32
634
  s2arc: x86
 
635
  - arch: x64
636
  s2arc: x64
 
637
  - sdl2: ON
638
  s2ver: 2.28.5
639
 
@@ -654,7 +657,8 @@ jobs:
654
  - name: Install OpenBLAS and pkgconfiglite
655
  if: matrix.blas == 'ON'
656
  run: |
657
- vcpkg install --triplet=${{ matrix.s2arc }}-windows openblas
 
658
  choco install pkgconfiglite
659
 
660
  - name: Fetch SDL2 and set SDL2_DIR
@@ -671,6 +675,8 @@ jobs:
671
  -DCMAKE_BUILD_TYPE=${{ matrix.build }}
672
  -DGGML_BLAS=${{ matrix.blas }}
673
  -DGGML_BLAS_VENDOR=OpenBLAS
 
 
674
  -DWHISPER_SDL2=${{ matrix.sdl2 }}
675
 
676
  - name: Build
@@ -680,17 +686,12 @@ jobs:
680
 
681
  - name: Copy openblas.dll
682
  if: matrix.blas == 'ON'
683
- run: copy "C:/vcpkg/packages/openblas_${{ matrix.s2arc }}-windows/bin/openblas.dll" build/bin/${{ matrix.build }}
684
 
685
  - name: Copy SDL2.dll
686
  if: matrix.sdl2 == 'ON'
687
  run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }}
688
 
689
- - name: Pack bin artifacts
690
- shell: pwsh
691
- run: |
692
- Compress-Archive -Path "build/bin/${{ matrix.build }}" -DestinationPath "whisper-blas-bin-${{ matrix.arch }}.zip"
693
-
694
  - name: Upload binaries
695
  if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' && ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
696
  github.event.inputs.create_release == 'true' ||
@@ -698,7 +699,7 @@ jobs:
698
  uses: actions/upload-artifact@v4
699
  with:
700
  name: whisper-blas-bin-${{ matrix.arch }}.zip
701
- path: whisper-blas-bin-${{ matrix.arch }}.zip
702
 
703
  windows-cublas:
704
  if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||
 
629
  arch: [Win32, x64]
630
  blas: [ON]
631
  sdl2: [ON]
632
+ blasver: [0.3.29]
633
  include:
634
  - arch: Win32
635
  s2arc: x86
636
+ blasfile: x86
637
  - arch: x64
638
  s2arc: x64
639
+ blasfile: x64_64
640
  - sdl2: ON
641
  s2ver: 2.28.5
642
 
 
657
  - name: Install OpenBLAS and pkgconfiglite
658
  if: matrix.blas == 'ON'
659
  run: |
660
+ Invoke-WebRequest "https://github.com/OpenMathLib/OpenBLAS/releases/download/v${{matrix.blasver}}/OpenBLAS-${{matrix.blasver}}_${{matrix.blasfile}}.zip" -OutFile "OpenBLAS-${{matrix.blasver}}.zip"
661
+ Expand-Archive "OpenBLAS-${{matrix.blasver}}.zip" -DestinationPath "OpenBLAS-${{matrix.blasver}}"
662
  choco install pkgconfiglite
663
 
664
  - name: Fetch SDL2 and set SDL2_DIR
 
675
  -DCMAKE_BUILD_TYPE=${{ matrix.build }}
676
  -DGGML_BLAS=${{ matrix.blas }}
677
  -DGGML_BLAS_VENDOR=OpenBLAS
678
+ -DBLAS_LIBRARIES="$env:GITHUB_WORKSPACE/OpenBLAS-${{matrix.blasver}}/lib/libopenblas.lib"
679
+ -DBLAS_INCLUDE_DIRS="$env:GITHUB_WORKSPACE/OpenBLAS-${{matrix.blasver}}/include"
680
  -DWHISPER_SDL2=${{ matrix.sdl2 }}
681
 
682
  - name: Build
 
686
 
687
  - name: Copy openblas.dll
688
  if: matrix.blas == 'ON'
689
+ run: copy "$env:GITHUB_WORKSPACE/OpenBLAS-${{matrix.blasver}}/bin/libopenblas.dll" build/bin/${{ matrix.build }}
690
 
691
  - name: Copy SDL2.dll
692
  if: matrix.sdl2 == 'ON'
693
  run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }}
694
 
 
 
 
 
 
695
  - name: Upload binaries
696
  if: matrix.blas == 'ON' && matrix.sdl2 == 'ON' && ${{ (github.event_name == 'push' && github.ref == 'refs/heads/master') ||
697
  github.event.inputs.create_release == 'true' ||
 
699
  uses: actions/upload-artifact@v4
700
  with:
701
  name: whisper-blas-bin-${{ matrix.arch }}.zip
702
+ path: "build/bin/${{ matrix.build }}/**"
703
 
704
  windows-cublas:
705
  if: ${{ github.event_name == 'push' || github.event_name == 'pull_request' ||