Skip to content

QVAC-21921 audiogen: native ACE-Step music generation on CPU #1

QVAC-21921 audiogen: native ACE-Step music generation on CPU

QVAC-21921 audiogen: native ACE-Step music generation on CPU #1

Workflow file for this run

# CI for the audiogen engine (engines/audiogen/ — ACE-Step music generation,
# added alongside the repo reorg QIP that moved engines under engines/).
#
# Scope: build the audiogen-cpp library + its CPU-only unit tests against
# system ggml (qvac-ext-ggml @ speech — mandatory here: AUDIOGEN_USE_SYSTEM_GGML
# defaults ON and the engine needs the custom snake / col2im_1d ops that live
# on that branch), then run the non-GPU ctest suite (weight-free units;
# model-dependent smoke harnesses stay downstream on-device). GPU suites need
# real GPUs → self-hosted lane, mirrored from tts-ci.yml's gpu stub.
name: audiogen CI
on:
push:
branches: [master]
paths:
- 'engines/audiogen/**'
- '.github/workflows/audiogen-ci.yml'
pull_request:
paths:
- 'engines/audiogen/**'
- '.github/workflows/audiogen-ci.yml'
workflow_dispatch:
inputs:
run_gpu:
description: 'Also run the GPU ctest lane (needs a [self-hosted, gpu] runner)'
type: boolean
default: false
permissions:
contents: read
concurrency:
group: audiogen-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:
build-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-24.04, macos-14]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- name: Install ccache
run: |
if [ "$RUNNER_OS" = "macOS" ]; then brew install ccache; else sudo apt-get update -q && sudo apt-get install -y ccache; fi
echo "CCACHE_DIR=${{ github.workspace }}/.ccache" >> "$GITHUB_ENV"
- 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
# Shared portable (CPU-only) key with parakeet-ci.yml / tts-ci.yml:
# whichever engine lane builds ggml first serves the others.
key: ggml-install-portable-${{ matrix.os }}-${{ steps.ggml.outputs.sha }}
- name: Cache ccache
uses: actions/cache@v4
with:
path: .ccache
key: ccache-audiogen-${{ matrix.os }}-${{ github.sha }}
restore-keys: ccache-audiogen-${{ matrix.os }}-
# CPU-only ggml: this lane runs `-LE gpu` tests, and hosted runners
# have no Vulkan/OpenCL; Metal is exercised by the gpu lane instead.
- name: Build ggml (system ggml, qvac-ext-ggml@${{ env.GGML_BRANCH }})
if: steps.ggml-cache.outputs.cache-hit != 'true'
run: |
# Fetch the exact SHA the cache key was derived from — the branch
# tip may have advanced since the ls-remote resolution, and a
# tip-only shallow clone would then silently build (and cache)
# a different commit than the key claims.
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_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DGGML_NATIVE=OFF \
-DGGML_METAL=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
- name: Configure
run: |
cmake -S engines/audiogen -B build \
-DCMAKE_BUILD_TYPE=Release \
-DAUDIOGEN_BUILD_TESTS=ON \
-DCMAKE_PREFIX_PATH="$PWD/ggml-install"
- name: Build
run: cmake --build build -j4
# Excludes gpu (no GPU on hosted runners) and perf (timing gates are
# meaningless on shared runners). LD_LIBRARY_PATH: the ggml install ships
# libqvac-speech-ggml.so whose dependency on the ggml-cpu/base siblings is
# resolved transitively — Linux RUNPATH doesn't apply to transitive loads,
# so the loader needs the directory explicitly (macOS @rpath handles it).
- name: Test (non-GPU)
env:
LD_LIBRARY_PATH: ${{ github.workspace }}/ggml-install/lib
run: ctest --test-dir build -LE 'gpu|perf' --output-on-failure --timeout 600
# GPU lane stub: opt-in until self-hosted GPU runners exist (mirrors
# tts-ci.yml). hosted macos-14 exposes Metal, so folding `-L gpu` into the
# macOS build-test job is a cheap first experiment once GPU suites land.
gpu:
if: github.event_name == 'workflow_dispatch' && inputs.run_gpu
runs-on: [self-hosted, gpu]
timeout-minutes: 90
steps:
- uses: actions/checkout@v4
- name: Build ggml + engine (native backends) and run GPU suites
run: |
git clone --depth 1 --branch "$GGML_BRANCH" "$GGML_REPO" ggml-src
cmake -S ggml-src -B ggml-src/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON \
-DGGML_VULKAN=ON \
-DCMAKE_INSTALL_PREFIX="$PWD/ggml-install"
cmake --build ggml-src/build -j && cmake --install ggml-src/build
cmake -S engines/audiogen -B build -DCMAKE_BUILD_TYPE=Release \
-DAUDIOGEN_BUILD_TESTS=ON \
-DCMAKE_PREFIX_PATH="$PWD/ggml-install"
cmake --build build -j
ctest --test-dir build -L gpu --output-on-failure --timeout 1200