Skip to content

Commit 27dc5e9

Browse files
authored
Merge pull request #4 from xAlcahest/chore/whisper-v1.9.1-sm120
chore: update whisper.cpp to v1.9.1 with RTX 50 (sm_120) CUDA support
2 parents 844e40d + 26c538f commit 27dc5e9

1,046 files changed

Lines changed: 200323 additions & 58394 deletions

File tree

Some content is hidden

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

‎.devops/main-cuda.Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ENV LD_LIBRARY_PATH /usr/local/cuda-${CUDA_MAIN_VERSION}/compat:$LD_LIBRARY_PATH
2525

2626
COPY .. .
2727
# Enable cuBLAS
28-
RUN make base.en CMAKE_ARGS="-DGGML_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES='75;80;86;90'"
28+
RUN --mount=type=secret,id=HF_TOKEN,required=false,env=HF_TOKEN make base.en CMAKE_ARGS="-DGGML_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES='75;80;86;90'"
2929

3030
RUN find /app/build -name "*.o" -delete && \
3131
find /app/build -name "*.a" -delete && \

‎.devops/main-intel.Dockerfile‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ARG ONEAPI_VERSION=2025.1.1-0-devel-ubuntu24.04
1+
ARG ONEAPI_VERSION=2025.3.3-0-devel-ubuntu24.04
22

3-
FROM intel/oneapi-basekit:$ONEAPI_VERSION AS build
3+
FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS build
44
WORKDIR /app
55

66
RUN apt-get update && \
@@ -10,13 +10,14 @@ RUN apt-get update && \
1010
COPY .. .
1111
# Enable SYCL
1212
ARG GGML_SYCL_F16=OFF
13-
RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
13+
RUN --mount=type=secret,id=HF_TOKEN,required=false,env=HF_TOKEN \
14+
if [ "${GGML_SYCL_F16}" = "ON" ]; then \
1415
echo "GGML_SYCL_F16 is set" \
1516
&& export OPT_SYCL_F16="-DGGML_SYCL_F16=ON"; \
1617
fi && \
1718
make base.en CMAKE_ARGS="-DGGML_SYCL=1 -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx ${OPT_SYCL_F16}"
1819

19-
FROM intel/oneapi-basekit:$ONEAPI_VERSION AS runtime
20+
FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS runtime
2021
WORKDIR /app
2122

2223
RUN apt-get update && \

‎.devops/main-musa.Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN apt-get update && \
1616

1717
COPY .. .
1818
# Enable muBLAS
19-
RUN make base.en CMAKE_ARGS="-DGGML_MUSA=1"
19+
RUN --mount=type=secret,id=HF_TOKEN,required=false,env=HF_TOKEN make base.en CMAKE_ARGS="-DGGML_MUSA=1"
2020

2121
RUN find /app/build -name "*.o" -delete && \
2222
find /app/build -name "*.a" -delete && \

‎.devops/main-vulkan.Dockerfile‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM ubuntu:24.04 AS build
2+
WORKDIR /app
3+
4+
RUN apt-get update && \
5+
apt-get install -y build-essential wget cmake git libvulkan-dev spirv-headers glslc \
6+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
7+
8+
COPY .. .
9+
RUN --mount=type=secret,id=HF_TOKEN,required=false,env=HF_TOKEN make base.en CMAKE_ARGS="-DGGML_VULKAN=1"
10+
11+
FROM ubuntu:24.04 AS runtime
12+
WORKDIR /app
13+
14+
RUN apt-get update && \
15+
apt-get install -y curl ffmpeg libsdl2-dev wget cmake git libvulkan1 mesa-vulkan-drivers \
16+
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
17+
18+
COPY --from=build /app /app
19+
ENV PATH=/app/build/bin:$PATH
20+
ENTRYPOINT [ "bash", "-c" ]

‎.devops/main.Dockerfile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ RUN apt-get update && \
66
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
77

88
COPY .. .
9-
RUN make base.en
9+
RUN --mount=type=secret,id=HF_TOKEN,required=false,env=HF_TOKEN make base.en
1010

1111
FROM ubuntu:22.04 AS runtime
1212
WORKDIR /app
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: "ccache-clear"
2+
description: "Delete all GitHub Actions caches matching a key prefix"
3+
inputs:
4+
key:
5+
description: "Cache key prefix to match and delete"
6+
required: true
7+
8+
runs:
9+
using: "composite"
10+
steps:
11+
- name: Clear caches
12+
shell: bash
13+
run: |
14+
CACHES=$(gh cache list --key "ccache-${{ inputs.key }}" --json id,key --jq '.[] | "\(.id) \(.key)"' 2>/dev/null)
15+
if [ -z "$CACHES" ]; then
16+
echo "No caches found with key prefix: ${{ inputs.key }}"
17+
exit 0
18+
fi
19+
while read -r id key; do
20+
echo "Deleting cache: $id ($key)"
21+
gh cache delete "$id"
22+
done <<< "$CACHES"

‎.github/workflows/bindings-go.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@ on:
33
push:
44
paths:
55
- bindings/go/**
6-
- whisper.h
6+
- include/whisper.h
77
pull_request:
88
paths:
99
- bindings/go/**
10-
- whisper.h
10+
- include/whisper.h
1111

1212
jobs:
1313
ubuntu-22:
1414
runs-on: ubuntu-22.04
1515
steps:
16-
- uses: actions/setup-go@v5
16+
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
1717
with:
1818
go-version: '^1.23'
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2020
- run: |
2121
cd bindings/go
2222
make test

‎.github/workflows/bindings-ruby.yml‎

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,19 @@ on:
44
push:
55
branches:
66
- master
7+
paths:
8+
- bindings/ruby/**
9+
- include/whisper.h
10+
- examples/common-whisper.h
11+
- ggml/include/ggml.h
12+
713
pull_request:
814
types: [opened, synchronize, reopened]
15+
paths:
16+
- bindings/ruby/**
17+
- include/whisper.h
18+
- examples/common-whisper.h
19+
- ggml/include/ggml.h
920

1021
jobs:
1122
ubuntu-22:
@@ -14,8 +25,8 @@ jobs:
1425
run:
1526
working-directory: bindings/ruby
1627
steps:
17-
- uses: ruby/setup-ruby@v1
28+
- uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
1829
with:
19-
ruby-version: '3.2'
20-
- uses: actions/checkout@v4
30+
ruby-version: '3.3'
31+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
2132
- run: rake test
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI (android)
2+
3+
on:
4+
workflow_dispatch: # allows manual triggering
5+
push:
6+
branches:
7+
- master
8+
paths: ['.github/workflows/build-android.yml',
9+
'**/CMakeLists.txt',
10+
'**/*.h',
11+
'**/*.hpp',
12+
'**/*.c',
13+
'**/*.cpp',
14+
'**/*.java']
15+
16+
pull_request:
17+
types: [opened, synchronize, reopened]
18+
paths-ignore:
19+
- 'bindings/ruby/**' # handled by bindings-ruby.yml
20+
- 'bindings/go/**' # handled by bindings-go.yml
21+
- 'examples/addon.node/**' # handled by examples.yml
22+
23+
concurrency:
24+
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
android:
29+
runs-on: ubuntu-22.04
30+
31+
steps:
32+
- name: Clone
33+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
34+
with:
35+
path: whisper
36+
37+
- name: Install Java
38+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
39+
with:
40+
distribution: zulu
41+
java-version: 21
42+
43+
- name: Setup Android SDK
44+
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
45+
46+
- name: Build
47+
run: |
48+
cd whisper/examples/whisper.android
49+
./gradlew assembleRelease --no-daemon
50+
51+
- name: Build with external ggml
52+
run: |
53+
export PATH_TO_GGML=$PWD/ggml
54+
cd whisper/examples/whisper.android
55+
./gradlew assembleRelease --no-daemon
56+
57+
android_java:
58+
runs-on: ubuntu-22.04
59+
60+
steps:
61+
- name: Clone
62+
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
63+
64+
- name: set up JDK 11
65+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
66+
with:
67+
java-version: '11'
68+
distribution: 'temurin'
69+
cache: gradle
70+
71+
- name: Setup Android SDK
72+
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
73+
with:
74+
cmdline-tools-version: 9.0
75+
76+
- name: Build
77+
run: |
78+
cd examples/whisper.android.java
79+
chmod +x ./gradlew
80+
./gradlew assembleRelease

‎.github/workflows/build-binaries.yml‎

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ permissions:
1515
contents: write
1616

1717
env:
18-
CUDA_ARCHITECTURES: "75;80;86;89"
18+
# RTX 20-50 (Turing through Blackwell). sm_120 requires CUDA Toolkit >= 12.8.
19+
CUDA_ARCHITECTURES: "75;80;86;89;120"
1920

2021
jobs:
2122
build-macos-arm64:
@@ -190,21 +191,21 @@ jobs:
190191
- name: Install Ninja
191192
run: choco install ninja -y
192193

193-
- name: Install CUDA Toolkit 12.4.0
194+
- name: Install CUDA Toolkit 12.9.1
194195
run: |
195-
$CUDA_VERSION = "12.4.0"
196+
$CUDA_VERSION = "12.9.1"
196197
$CUDA_TOOLKIT_DIR = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VERSION"
197198
$CUDA_DOWNLOAD = "https://developer.download.nvidia.com/compute/cuda/redist"
198199
199-
# Component versions for CUDA 12.4.0
200-
$CUDART_VER = "12.4.127"
201-
$NVCC_VER = "12.4.131"
202-
$NVRTC_VER = "12.4.127"
203-
$CUBLAS_VER = "12.4.5.8"
204-
$NVTX_VER = "12.4.127"
205-
$PROFILER_VER = "12.4.127"
206-
$VS_VER = "12.4.127"
207-
$CCCL_VER = "12.4.127"
200+
# Component versions for CUDA 12.9.1
201+
$CUDART_VER = "12.9.79"
202+
$NVCC_VER = "12.9.86"
203+
$NVRTC_VER = "12.9.86"
204+
$CUBLAS_VER = "12.9.1.4"
205+
$NVTX_VER = "12.9.79"
206+
$PROFILER_VER = "12.9.79"
207+
$VS_VER = "12.9.79"
208+
$CCCL_VER = "12.9.27"
208209
209210
# Create CUDA toolkit directory
210211
New-Item -ItemType Directory -Force -Path $CUDA_TOOLKIT_DIR
@@ -400,24 +401,24 @@ jobs:
400401
sudo apt-get update
401402
sudo apt-get install -y build-essential cmake wget
402403
403-
- name: Install CUDA Toolkit 12.4
404+
- name: Install CUDA Toolkit 12.9
404405
run: |
405406
# Download and install CUDA keyring
406407
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
407408
sudo dpkg -i cuda-keyring_1.1-1_all.deb
408409
sudo apt-get update
409410
410411
# Install minimal CUDA toolkit (compiler and libraries only, no driver)
411-
sudo apt-get install -y cuda-toolkit-12-4
412+
sudo apt-get install -y cuda-toolkit-12-9
412413
413414
# Set environment variables
414-
echo "/usr/local/cuda-12.4/bin" >> $GITHUB_PATH
415-
echo "CUDA_PATH=/usr/local/cuda-12.4" >> $GITHUB_ENV
416-
echo "LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
415+
echo "/usr/local/cuda-12.9/bin" >> $GITHUB_PATH
416+
echo "CUDA_PATH=/usr/local/cuda-12.9" >> $GITHUB_ENV
417+
echo "LD_LIBRARY_PATH=/usr/local/cuda-12.9/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
417418
418419
- name: Verify CUDA installation
419420
run: |
420-
export PATH=/usr/local/cuda-12.4/bin:$PATH
421+
export PATH=/usr/local/cuda-12.9/bin:$PATH
421422
nvcc --version
422423
423424
- name: Setup ccache
@@ -427,16 +428,16 @@ jobs:
427428

428429
- name: Build whisper.cpp with CUDA
429430
run: |
430-
export PATH=/usr/local/cuda-12.4/bin:$PATH
431-
export CUDA_PATH=/usr/local/cuda-12.4
431+
export PATH=/usr/local/cuda-12.9/bin:$PATH
432+
export CUDA_PATH=/usr/local/cuda-12.9
432433
cmake -B build \
433434
-DCMAKE_BUILD_TYPE=Release \
434435
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
435436
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
436437
-DBUILD_SHARED_LIBS=OFF \
437438
-DGGML_NATIVE=OFF \
438439
-DGGML_CUDA=ON \
439-
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.4/bin/nvcc \
440+
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.9/bin/nvcc \
440441
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCHITECTURES }}"
441442
cmake --build build --config Release -j $(nproc)
442443

0 commit comments

Comments
 (0)