Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .devops/main-cuda.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ENV LD_LIBRARY_PATH /usr/local/cuda-${CUDA_MAIN_VERSION}/compat:$LD_LIBRARY_PATH

COPY .. .
# Enable cuBLAS
RUN make base.en CMAKE_ARGS="-DGGML_CUDA=1 -DCMAKE_CUDA_ARCHITECTURES='75;80;86;90'"
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'"

RUN find /app/build -name "*.o" -delete && \
find /app/build -name "*.a" -delete && \
Expand Down
9 changes: 5 additions & 4 deletions .devops/main-intel.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG ONEAPI_VERSION=2025.1.1-0-devel-ubuntu24.04
ARG ONEAPI_VERSION=2025.3.3-0-devel-ubuntu24.04

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

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

FROM intel/oneapi-basekit:$ONEAPI_VERSION AS runtime
FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS runtime
WORKDIR /app

RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion .devops/main-musa.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN apt-get update && \

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

RUN find /app/build -name "*.o" -delete && \
find /app/build -name "*.a" -delete && \
Expand Down
20 changes: 20 additions & 0 deletions .devops/main-vulkan.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM ubuntu:24.04 AS build
WORKDIR /app

RUN apt-get update && \
apt-get install -y build-essential wget cmake git libvulkan-dev spirv-headers glslc \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

COPY .. .
RUN --mount=type=secret,id=HF_TOKEN,required=false,env=HF_TOKEN make base.en CMAKE_ARGS="-DGGML_VULKAN=1"

FROM ubuntu:24.04 AS runtime
WORKDIR /app

RUN apt-get update && \
apt-get install -y curl ffmpeg libsdl2-dev wget cmake git libvulkan1 mesa-vulkan-drivers \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

COPY --from=build /app /app
ENV PATH=/app/build/bin:$PATH
ENTRYPOINT [ "bash", "-c" ]
2 changes: 1 addition & 1 deletion .devops/main.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN apt-get update && \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

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

FROM ubuntu:22.04 AS runtime
WORKDIR /app
Expand Down
22 changes: 22 additions & 0 deletions .github/actions/ccache-clear/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "ccache-clear"
description: "Delete all GitHub Actions caches matching a key prefix"
inputs:
key:
description: "Cache key prefix to match and delete"
required: true

runs:
using: "composite"
steps:
- name: Clear caches
shell: bash
run: |
CACHES=$(gh cache list --key "ccache-${{ inputs.key }}" --json id,key --jq '.[] | "\(.id) \(.key)"' 2>/dev/null)
if [ -z "$CACHES" ]; then
echo "No caches found with key prefix: ${{ inputs.key }}"
exit 0
fi
while read -r id key; do
echo "Deleting cache: $id ($key)"
gh cache delete "$id"
done <<< "$CACHES"
8 changes: 4 additions & 4 deletions .github/workflows/bindings-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ on:
push:
paths:
- bindings/go/**
- whisper.h
- include/whisper.h
pull_request:
paths:
- bindings/go/**
- whisper.h
- include/whisper.h

jobs:
ubuntu-22:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-go@v5
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '^1.23'
- uses: actions/checkout@v4
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- run: |
cd bindings/go
make test
17 changes: 14 additions & 3 deletions .github/workflows/bindings-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,19 @@ on:
push:
branches:
- master
paths:
- bindings/ruby/**
- include/whisper.h
- examples/common-whisper.h
- ggml/include/ggml.h

pull_request:
types: [opened, synchronize, reopened]
paths:
- bindings/ruby/**
- include/whisper.h
- examples/common-whisper.h
- ggml/include/ggml.h

jobs:
ubuntu-22:
Expand All @@ -14,8 +25,8 @@ jobs:
run:
working-directory: bindings/ruby
steps:
- uses: ruby/setup-ruby@v1
- uses: ruby/setup-ruby@afeafc3d1ab54a631816aba4c914a0081c12ff2f # v1.310.0
with:
ruby-version: '3.2'
- uses: actions/checkout@v4
ruby-version: '3.3'
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- run: rake test
80 changes: 80 additions & 0 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: CI (android)

on:
workflow_dispatch: # allows manual triggering
push:
branches:
- master
paths: ['.github/workflows/build-android.yml',
'**/CMakeLists.txt',
'**/*.h',
'**/*.hpp',
'**/*.c',
'**/*.cpp',
'**/*.java']

pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- 'bindings/ruby/**' # handled by bindings-ruby.yml
- 'bindings/go/**' # handled by bindings-go.yml
- 'examples/addon.node/**' # handled by examples.yml

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
cancel-in-progress: true

jobs:
android:
runs-on: ubuntu-22.04

steps:
- name: Clone
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
path: whisper

- name: Install Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
distribution: zulu
java-version: 21

- name: Setup Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1

- name: Build
run: |
cd whisper/examples/whisper.android
./gradlew assembleRelease --no-daemon

- name: Build with external ggml
run: |
export PATH_TO_GGML=$PWD/ggml
cd whisper/examples/whisper.android
./gradlew assembleRelease --no-daemon

android_java:
runs-on: ubuntu-22.04

steps:
- name: Clone
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6

- name: set up JDK 11
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
java-version: '11'
distribution: 'temurin'
cache: gradle

- name: Setup Android SDK
uses: android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1
with:
cmdline-tools-version: 9.0

- name: Build
run: |
cd examples/whisper.android.java
chmod +x ./gradlew
./gradlew assembleRelease
43 changes: 22 additions & 21 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ permissions:
contents: write

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

jobs:
build-macos-arm64:
Expand Down Expand Up @@ -190,21 +191,21 @@ jobs:
- name: Install Ninja
run: choco install ninja -y

- name: Install CUDA Toolkit 12.4.0
- name: Install CUDA Toolkit 12.9.1
run: |
$CUDA_VERSION = "12.4.0"
$CUDA_VERSION = "12.9.1"
$CUDA_TOOLKIT_DIR = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VERSION"
$CUDA_DOWNLOAD = "https://developer.download.nvidia.com/compute/cuda/redist"

# Component versions for CUDA 12.4.0
$CUDART_VER = "12.4.127"
$NVCC_VER = "12.4.131"
$NVRTC_VER = "12.4.127"
$CUBLAS_VER = "12.4.5.8"
$NVTX_VER = "12.4.127"
$PROFILER_VER = "12.4.127"
$VS_VER = "12.4.127"
$CCCL_VER = "12.4.127"
# Component versions for CUDA 12.9.1
$CUDART_VER = "12.9.79"
$NVCC_VER = "12.9.86"
$NVRTC_VER = "12.9.86"
$CUBLAS_VER = "12.9.1.4"
$NVTX_VER = "12.9.79"
$PROFILER_VER = "12.9.79"
$VS_VER = "12.9.79"
$CCCL_VER = "12.9.27"

# Create CUDA toolkit directory
New-Item -ItemType Directory -Force -Path $CUDA_TOOLKIT_DIR
Expand Down Expand Up @@ -400,24 +401,24 @@ jobs:
sudo apt-get update
sudo apt-get install -y build-essential cmake wget

- name: Install CUDA Toolkit 12.4
- name: Install CUDA Toolkit 12.9
run: |
# Download and install CUDA keyring
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update

# Install minimal CUDA toolkit (compiler and libraries only, no driver)
sudo apt-get install -y cuda-toolkit-12-4
sudo apt-get install -y cuda-toolkit-12-9

# Set environment variables
echo "/usr/local/cuda-12.4/bin" >> $GITHUB_PATH
echo "CUDA_PATH=/usr/local/cuda-12.4" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/cuda-12.4/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "/usr/local/cuda-12.9/bin" >> $GITHUB_PATH
echo "CUDA_PATH=/usr/local/cuda-12.9" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/cuda-12.9/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV

- name: Verify CUDA installation
run: |
export PATH=/usr/local/cuda-12.4/bin:$PATH
export PATH=/usr/local/cuda-12.9/bin:$PATH
nvcc --version

- name: Setup ccache
Expand All @@ -427,16 +428,16 @@ jobs:

- name: Build whisper.cpp with CUDA
run: |
export PATH=/usr/local/cuda-12.4/bin:$PATH
export CUDA_PATH=/usr/local/cuda-12.4
export PATH=/usr/local/cuda-12.9/bin:$PATH
export CUDA_PATH=/usr/local/cuda-12.9
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_NATIVE=OFF \
-DGGML_CUDA=ON \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.4/bin/nvcc \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.9/bin/nvcc \
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCHITECTURES }}"
cmake --build build --config Release -j $(nproc)

Expand Down
Loading
Loading