Skip to content

QVAC-21928: CosyVoice3 native C++/ggml TTS engine (Qwen2 LM + DiT flow + CausalHiFT) #23

QVAC-21928: CosyVoice3 native C++/ggml TTS engine (Qwen2 LM + DiT flow + CausalHiFT)

QVAC-21928: CosyVoice3 native C++/ggml TTS engine (Qwen2 LM + DiT flow + CausalHiFT) #23

# Cross-platform lanes for the engines (engines/parakeet/, engines/tts/ —
# moved from parakeet-cpp/, tts-cpp/ by the repo reorg QIP, PR 1).
#
# Complements parakeet-ci.yml / tts-ci.yml (linux+mac build+test):
# - windows: full build + non-GPU ctest (MSVC, static ggml)
# - android: compile smoke, arm64-v8a via NDK (no device to run tests on)
# - ios: compile smoke, arm64 device slice, Metal embedded (flags
# mirror build-xcframework.sh)
# On-device e2e stays downstream in tetherto/qvac; these lanes exist to
# catch cross-compile/link breaks *before* the registry pin chain.
name: engines cross CI
on:
push:
branches: [master]
paths:
- 'engines/parakeet/**'
- 'engines/tts/**'
- '.github/workflows/engines-cross-ci.yml'
pull_request:
paths:
- 'engines/parakeet/**'
- 'engines/tts/**'
- '.github/workflows/engines-cross-ci.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: engines-cross-ci-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
GGML_REPO: https://github.com/tetherto/qvac-ext-ggml.git
GGML_BRANCH: speech # single ggml pin shared with parakeet-ci.yml / tts-ci.yml
jobs:
windows:
strategy:
fail-fast: false
matrix:
engine: [parakeet, tts]
include:
- engine: parakeet
src: engines/parakeet
cmake_flags: -DPARAKEET_USE_SYSTEM_GGML=ON -DPARAKEET_BUILD_TESTS=ON -DPARAKEET_BUILD_EXAMPLES=OFF
- engine: tts
src: engines/tts
cmake_flags: -DTTS_CPP_BUILD_TESTS=ON
runs-on: windows-2022
timeout-minutes: 90
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Resolve ggml pin (tip of ${{ env.GGML_BRANCH }})
id: ggml
run: echo "sha=$(git ls-remote "$GGML_REPO" "refs/heads/$GGML_BRANCH" | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache ggml install
id: ggml-cache
uses: actions/cache@v4
with:
path: ggml-install
key: ggml-install-portable-windows-2022-msvc-static-${{ steps.ggml.outputs.sha }}
# Static ggml on Windows sidesteps DLL discovery for the test exes.
- name: Build ggml (MSVC, static, CPU-only)
if: steps.ggml-cache.outputs.cache-hit != 'true'
run: |
# Fetch the exact SHA the cache key was derived from (the branch
# tip may advance between ls-remote and this step).
git init -q ggml-src
git -C ggml-src remote add origin "$GGML_REPO"
git -C ggml-src fetch --depth 1 origin ${{ steps.ggml.outputs.sha }}
git -C ggml-src checkout -q FETCH_HEAD
cmake -S ggml-src -B ggml-src/build -A x64 \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_NATIVE=OFF \
-DGGML_BUILD_TESTS=OFF \
-DGGML_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build --config Release -j4
cmake --install ggml-src/build --config Release
- name: Configure
run: |
cmake -S ${{ matrix.src }} -B build -A x64 \
${{ matrix.cmake_flags }} \
-DCMAKE_PREFIX_PATH="$PWD/ggml-install"
- name: Build
run: cmake --build build --config Release -j4
- name: Test (non-GPU)
run: ctest --test-dir build -C Release -LE 'gpu|perf' --output-on-failure --timeout 600
android:
strategy:
fail-fast: false
matrix:
engine: [parakeet, tts]
include:
- engine: parakeet
src: engines/parakeet
cmake_flags: -DPARAKEET_USE_SYSTEM_GGML=ON -DPARAKEET_BUILD_TESTS=OFF -DPARAKEET_BUILD_EXAMPLES=OFF
- engine: tts
src: engines/tts
cmake_flags: -DTTS_CPP_BUILD_TESTS=OFF
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Resolve ggml pin (tip of ${{ env.GGML_BRANCH }})
id: ggml
run: echo "sha=$(git ls-remote "$GGML_REPO" "refs/heads/$GGML_BRANCH" | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache ggml install
id: ggml-cache
uses: actions/cache@v4
with:
path: ggml-install
key: ggml-install-android-arm64-${{ steps.ggml.outputs.sha }}
- name: Build ggml (NDK arm64-v8a, static, CPU-only)
if: steps.ggml-cache.outputs.cache-hit != 'true'
run: |
# Fetch the exact SHA the cache key was derived from (the branch
# tip may advance between ls-remote and this step).
git init -q ggml-src
git -C ggml-src remote add origin "$GGML_REPO"
git -C ggml-src fetch --depth 1 origin ${{ steps.ggml.outputs.sha }}
git -C ggml-src checkout -q FETCH_HEAD
cmake -S ggml-src -B ggml-src/build \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake" \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-28 \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_OPENMP=OFF \
-DGGML_BUILD_TESTS=OFF \
-DGGML_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build -j4
cmake --install ggml-src/build
# Compile smoke only: hosted runners can't execute arm64 Android
# binaries. CMAKE_FIND_ROOT_PATH (not PREFIX_PATH) because the NDK
# toolchain restricts find_package() to the find-root.
- name: Configure + build engine (compile smoke)
run: |
cmake -S ${{ matrix.src }} -B build \
-DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_LATEST_HOME/build/cmake/android.toolchain.cmake" \
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM=android-28 \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.cmake_flags }} \
-DCMAKE_FIND_ROOT_PATH="$PWD/ggml-install"
cmake --build build -j4
ios:
strategy:
fail-fast: false
matrix:
engine: [parakeet, tts]
include:
- engine: parakeet
src: engines/parakeet
cmake_flags: -DPARAKEET_USE_SYSTEM_GGML=ON -DPARAKEET_BUILD_TESTS=OFF -DPARAKEET_BUILD_EXAMPLES=OFF
- engine: tts
src: engines/tts
cmake_flags: -DTTS_CPP_BUILD_TESTS=OFF
runs-on: macos-14
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Resolve ggml pin (tip of ${{ env.GGML_BRANCH }})
id: ggml
run: echo "sha=$(git ls-remote "$GGML_REPO" "refs/heads/$GGML_BRANCH" | cut -f1)" >> "$GITHUB_OUTPUT"
- name: Cache ggml install
id: ggml-cache
uses: actions/cache@v4
with:
path: ggml-install
key: ggml-install-ios-arm64-${{ steps.ggml.outputs.sha }}
# Flags mirror build-xcframework.sh's iOS-device slice (Metal embedded).
- name: Build ggml (iOS device arm64, static, Metal embedded)
if: steps.ggml-cache.outputs.cache-hit != 'true'
run: |
# Fetch the exact SHA the cache key was derived from (the branch
# tip may advance between ls-remote and this step).
git init -q ggml-src
git -C ggml-src remote add origin "$GGML_REPO"
git -C ggml-src fetch --depth 1 origin ${{ steps.ggml.outputs.sha }}
git -C ggml-src checkout -q FETCH_HEAD
cmake -S ggml-src -B ggml-src/build \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_SYSROOT=iphoneos \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=16.4 \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_METAL=ON \
-DGGML_METAL_EMBED_LIBRARY=ON \
-DGGML_METAL_USE_BF16=ON \
-DGGML_OPENMP=OFF \
-DGGML_BUILD_TESTS=OFF \
-DGGML_BUILD_EXAMPLES=OFF \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build -j4
cmake --install ggml-src/build
# Compile smoke only (no iOS device on hosted runners).
- name: Configure + build engine (compile smoke)
run: |
cmake -S ${{ matrix.src }} -B build \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_OSX_SYSROOT=iphoneos \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=16.4 \
-DCMAKE_BUILD_TYPE=Release \
${{ matrix.cmake_flags }} \
-DCMAKE_FIND_ROOT_PATH="$PWD/ggml-install"
cmake --build build -j4