Skip to content

Commit 1027e4f

Browse files
authored
Merge branch 'ggerganov:master' into pipe-stream
2 parents f99263e + 99b011a commit 1027e4f

File tree

202 files changed

+38142
-28496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

202 files changed

+38142
-28496
lines changed

.github/workflows/build.yml

Lines changed: 188 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
name: CI
2-
on: [push, pull_request]
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, synchronize, reopened]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
12+
cancel-in-progress: true
313

414
env:
515
ubuntu_image: "ubuntu:22.04"
@@ -12,7 +22,7 @@ jobs:
1222
strategy:
1323
fail-fast: false
1424
matrix:
15-
arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
25+
arch: [linux/amd64, linux/ppc64le]
1626

1727
steps:
1828
- name: Clone
@@ -32,6 +42,58 @@ jobs:
3242
cmake -B build
3343
cmake --build build --config Release -j $(nproc)'
3444
45+
ubuntu-latest-arm64:
46+
runs-on: ubuntu-latest
47+
48+
strategy:
49+
fail-fast: false
50+
matrix:
51+
arch: [linux/arm64]
52+
53+
steps:
54+
- name: Clone
55+
uses: actions/checkout@v4
56+
57+
- name: Set up QEMU
58+
uses: docker/setup-qemu-action@v3
59+
60+
- name: Build ${{ matrix.arch }}
61+
run: |
62+
docker run --platform ${{ matrix.arch }} --rm \
63+
-v ${{ github.workspace }}:/workspace \
64+
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
65+
set -e
66+
apt update
67+
apt install -y build-essential libsdl2-dev cmake
68+
cmake -B build -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8-a
69+
cmake --build build --config Release -j $(nproc)'
70+
71+
ubuntu-latest-arm-v7:
72+
runs-on: ubuntu-latest
73+
74+
strategy:
75+
fail-fast: false
76+
matrix:
77+
arch: [linux/arm/v7]
78+
79+
steps:
80+
- name: Clone
81+
uses: actions/checkout@v4
82+
83+
- name: Set up QEMU
84+
uses: docker/setup-qemu-action@v3
85+
86+
- name: Build ${{ matrix.arch }}
87+
run: |
88+
docker run --platform ${{ matrix.arch }} --rm \
89+
-v ${{ github.workspace }}:/workspace \
90+
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
91+
set -e
92+
apt update
93+
apt install -y build-essential libsdl2-dev cmake
94+
cmake -B build -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv7-a+fp
95+
cmake --build build --config Release -j $(nproc)'
96+
3597
macOS-latest:
3698
runs-on: macOS-latest
3799

@@ -74,7 +136,7 @@ jobs:
74136
fail-fast: false
75137
matrix:
76138
build: [Debug, Release]
77-
arch: [linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le]
139+
arch: [linux/amd64, linux/ppc64le]
78140

79141
steps:
80142
- name: Clone
@@ -95,6 +157,62 @@ jobs:
95157
make
96158
ctest -L gh --output-on-failure'
97159
160+
ubuntu-latest-gcc-arm64:
161+
runs-on: ubuntu-latest
162+
163+
strategy:
164+
fail-fast: false
165+
matrix:
166+
build: [Debug, Release]
167+
arch: [linux/arm64]
168+
169+
steps:
170+
- name: Clone
171+
uses: actions/checkout@v4
172+
173+
- name: Set up QEMU
174+
uses: docker/setup-qemu-action@v3
175+
176+
- name: Build ${{ matrix.arch }}
177+
run: |
178+
docker run --platform ${{ matrix.arch }} --rm \
179+
-v ${{ github.workspace }}:/workspace \
180+
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
181+
set -e
182+
apt update
183+
apt install -y build-essential cmake libsdl2-dev
184+
cmake . -DWHISPER_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv8-a
185+
make
186+
ctest -L gh --output-on-failure'
187+
188+
ubuntu-latest-gcc-arm-v7:
189+
runs-on: ubuntu-latest
190+
191+
strategy:
192+
fail-fast: false
193+
matrix:
194+
build: [Debug, Release]
195+
arch: [linux/arm/v7]
196+
197+
steps:
198+
- name: Clone
199+
uses: actions/checkout@v4
200+
201+
- name: Set up QEMU
202+
uses: docker/setup-qemu-action@v3
203+
204+
- name: Build ${{ matrix.arch }}
205+
run: |
206+
docker run --platform ${{ matrix.arch }} --rm \
207+
-v ${{ github.workspace }}:/workspace \
208+
-w /workspace ${{ env.ubuntu_image }} /bin/sh -c '
209+
set -e
210+
apt update
211+
apt install -y build-essential cmake libsdl2-dev
212+
cmake . -DWHISPER_SDL2=ON -DCMAKE_BUILD_TYPE=${{ matrix.build }} -DGGML_NATIVE=OFF -DGGML_CPU_ARM_ARCH=armv7-a+fp
213+
make
214+
ctest -L gh --output-on-failure'
215+
98216
ubuntu-latest-clang:
99217
runs-on: ubuntu-latest
100218

@@ -430,72 +548,73 @@ jobs:
430548
name: whisper-blas-bin-${{ matrix.arch }}
431549
path: build/bin/${{ matrix.build }}
432550

433-
# TODO: fix and re-enable
434-
# windows-cublas:
435-
# runs-on: windows-2019
436-
#
437-
# strategy:
438-
# matrix:
439-
# build: [Release]
440-
# arch: [x64]
441-
# cublas: [ON]
442-
# sdl2: [ON]
443-
# cuda-toolkit: [12.2.0, 11.8.0]
444-
# include:
445-
# - arch: x64
446-
# s2arc: x64
447-
# - sdl2: ON
448-
# s2ver: 2.28.5
449-
#
450-
# steps:
451-
# - name: Clone
452-
# uses: actions/checkout@v4
453-
#
454-
# - name: Add msbuild to PATH
455-
# uses: microsoft/setup-msbuild@v2
456-
#
457-
# - name: Install CUDA Toolkit
458-
# id: cuda-toolkit
459-
# uses: Jimver/[email protected]
460-
# with:
461-
# cuda: '${{ matrix.cuda-toolkit }}'
462-
#
463-
# - name: Fetch SDL2 and set SDL2_DIR
464-
# if: matrix.sdl2 == 'ON'
465-
# run: |
466-
# 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
467-
# 7z x sdl2.zip
468-
# echo "SDL2_DIR=$env:GITHUB_WORKSPACE/SDL2-${{ matrix.s2ver }}/cmake" >> $env:GITHUB_ENV
469-
#
470-
# - name: Configure
471-
# run: >
472-
# cmake -S . -B ./build -A ${{ matrix.arch }}
473-
# -DCMAKE_BUILD_TYPE=${{ matrix.build }}
474-
# -DGGML_CUDA=${{ matrix.cublas }}
475-
# -DWHISPER_SDL2=${{ matrix.sdl2 }}
476-
#
477-
# - name: Build ${{ matrix.cuda-toolkit }}
478-
# run: |
479-
# cd ./build
480-
# cmake --build . --config ${{ matrix.build }}
481-
#
482-
# - name: Copy CUDA DLLs
483-
# run: >
484-
# Copy-Item -PassThru
485-
# -Path "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}/bin/*.dll"
486-
# -Include cudart64_*,cublas64_*,cublasLt64_*
487-
# -Destination build/bin/${{ matrix.build }}
488-
#
489-
# - name: Copy SDL2.dll
490-
# if: matrix.sdl2 == 'ON'
491-
# run: copy "$env:SDL2_DIR/../lib/${{ matrix.s2arc }}/SDL2.dll" build/bin/${{ matrix.build }}
492-
#
493-
# - name: Upload binaries
494-
# if: matrix.sdl2 == 'ON'
495-
# uses: actions/upload-artifact@v4
496-
# with:
497-
# name: whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}
498-
# path: build/bin/${{ matrix.build }}
551+
windows-cublas:
552+
runs-on: windows-2019
553+
strategy:
554+
matrix:
555+
build: [Release]
556+
arch: [x64]
557+
cublas: [ON]
558+
sdl2: [ON]
559+
cuda-toolkit: [12.2.0, 11.8.0]
560+
include:
561+
- arch: x64
562+
sdl2: ON
563+
sdl2_ver: 2.28.5
564+
steps:
565+
- name: Clone repository
566+
uses: actions/checkout@v4
567+
568+
- name: Add msbuild to PATH
569+
uses: microsoft/setup-msbuild@v2
570+
571+
- name: Install CUDA Toolkit
572+
id: cuda-toolkit
573+
uses: Jimver/[email protected]
574+
with:
575+
cuda: '${{ matrix.cuda-toolkit }}'
576+
577+
- name: Install 7-Zip
578+
run: choco install 7zip -y
579+
580+
- name: Fetch SDL2 and set SDL2_DIR
581+
if: matrix.sdl2 == 'ON'
582+
run: |
583+
Invoke-WebRequest -Uri https://github.com/libsdl-org/SDL/releases/download/release-${{ matrix.sdl2_ver }}/SDL2-devel-${{ matrix.sdl2_ver }}-VC.zip -OutFile sdl2.zip
584+
7z x sdl2.zip
585+
echo "SDL2_DIR=${{ github.workspace }}\SDL2-${{ matrix.sdl2_ver }}\cmake" | Out-File -FilePath $env:GITHUB_ENV -Append
586+
echo "${{ github.workspace }}\SDL2-${{ matrix.sdl2_ver }}\cmake" > SDL2_PATH.txt
587+
588+
- name: Configure CMake
589+
shell: cmd
590+
run: |
591+
cmake -S . -B ./build -A ${{ matrix.arch }} ^
592+
-DCMAKE_BUILD_TYPE=${{ matrix.build }} ^
593+
-DGGML_CUDA=${{ matrix.cublas }} ^
594+
-DCMAKE_CUDA_ARCHITECTURES=all ^
595+
-DWHISPER_SDL2=${{ matrix.sdl2 }} ^
596+
-DSDL2_DIR="%SDL2_DIR%"
597+
598+
- name: Build Project
599+
shell: cmd
600+
run: |
601+
cd ./build
602+
cmake --build . --config ${{ matrix.build }}
603+
604+
- name: Copy CUDA DLLs
605+
run: |
606+
Get-ChildItem "${{ steps.cuda-toolkit.outputs.CUDA_PATH }}/bin/" -Filter "*.dll" |
607+
Copy-Item -Destination "build/bin/${{ matrix.build }}"
608+
609+
- name: Copy SDL2.dll
610+
if: matrix.sdl2 == 'ON'
611+
run: copy "$env:SDL2_DIR/../lib/${{ matrix.arch }}/SDL2.dll" build/bin/${{ matrix.build }}
612+
613+
- name: Upload binaries
614+
uses: actions/upload-artifact@v4
615+
with:
616+
name: whisper-cublas-${{ matrix.cuda-toolkit }}-bin-${{ matrix.arch }}
617+
path: build/bin/${{ matrix.build }}
499618

500619
emscripten:
501620
runs-on: ubuntu-latest

.github/workflows/docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
matrix:
1919
config:
20-
- { tag: "main", dockerfile: ".devops/main.Dockerfile", platform: "linux/amd64,linux/arm64" }
20+
- { tag: "main", dockerfile: ".devops/main.Dockerfile", platform: "linux/amd64" }
2121
#TODO: the cuda image keeps failing - disable for now
2222
# https://github.com/ggerganov/whisper.cpp/actions/runs/11019444428/job/30602020339
2323
#- { tag: "main-cuda", dockerfile: ".devops/main-cuda.Dockerfile", platform: "linux/amd64" }

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cmake_minimum_required(VERSION 3.5) # for add_link_options and implicit target directories.
22
project("whisper.cpp" C CXX)
3-
project("whisper.cpp" VERSION 1.7.3)
3+
project("whisper.cpp" VERSION 1.7.4)
44
include(CheckIncludeFileCXX)
55

66
set(SOVERSION 1)

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,6 @@ tiny.en tiny base.en base small.en small medium.en medium large-v1 large-v2 larg
6464
echo "[+] Running $@ on $$f ... (run 'ffplay $$f' to listen)" ; \
6565
echo "----------------------------------------------" ; \
6666
echo "" ; \
67-
./build/bin/main -m models/ggml-$@.bin -f $$f ; \
67+
./build/bin/whisper-cli -m models/ggml-$@.bin -f $$f ; \
6868
echo "" ; \
6969
done

0 commit comments

Comments
 (0)