Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion .github/workflows/build-llamacpp-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,43 @@ jobs:
-DGGML_FMA=ON
-DGGML_F16C=ON
-DGGML_BMI2=ON
- os: windows-latest
name: windows-x64-cuda
cuda: true
cuda_version: '13.2.0'
cmake_flags: >-
-DGGML_NATIVE=OFF
-DGGML_CUDA=ON
-DGGML_CUDA_FA=OFF
-DGGML_CUDA_NCCL=OFF
-DGGML_CUDA_GRAPHS=OFF
-DGGML_AVX=OFF
-DGGML_AVX2=OFF
-DGGML_AVX_VNNI=OFF
-DGGML_AVX512=OFF
-DGGML_AVX512_VBMI=OFF
-DGGML_AVX512_VNNI=OFF
-DGGML_AVX512_BF16=OFF
-DGGML_FMA=OFF
-DGGML_F16C=OFF
-DGGML_BMI2=OFF
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: runtime/llama.cpp
steps:
- uses: actions/checkout@v4
- name: Install CUDA Toolkit
if: matrix.cuda
uses: Jimver/cuda-toolkit@v0.2.35
with:
cuda: ${{ matrix.cuda_version }}
method: network
log-file-suffix: ${{ matrix.name }}.txt
- name: Show CUDA compiler
if: matrix.cuda
run: nvcc --version
- name: Configure and build
run: |
# Release binaries must be portable across user machines, not tuned to
Expand Down Expand Up @@ -135,4 +165,4 @@ jobs:
gh release create "$tag" dist/* \
--repo "${{ github.repository }}" \
--title "FunASR llama.cpp runtime $version" \
--notes "Prebuilt self-contained binaries for the FunASR llama.cpp / GGUF runtime: SenseVoice, Paraformer and Fun-ASR-Nano with built-in FSMN-VAD. Download the default quantized model with \`bash download-funasr-model.sh <sensevoice|paraformer|nano>\` (the helper requires the Hugging Face CLI: \`pip install -U huggingface_hub\`), then run \`llama-funasr-cli\` / \`llama-funasr-sensevoice\` / \`llama-funasr-paraformer\`. Use the default x64 asset for maximum CPU compatibility; use the x64-avx2 asset on CPUs with AVX2/FMA/F16C/BMI2 for higher throughput. No Python ASR runtime or local build is required. Docs: $docs"
--notes "Prebuilt self-contained binaries for the FunASR llama.cpp / GGUF runtime: SenseVoice, Paraformer and Fun-ASR-Nano with built-in FSMN-VAD. Download the default quantized model with \`bash download-funasr-model.sh <sensevoice|paraformer|nano>\` (the helper requires the Hugging Face CLI: \`pip install -U huggingface_hub\`), then run \`llama-funasr-cli\` / \`llama-funasr-sensevoice\` / \`llama-funasr-paraformer\`. Use the default x64 asset for maximum CPU compatibility; use the x64-avx2 asset on CPUs with AVX2/FMA/F16C/BMI2 for higher throughput. The Windows CUDA asset is \`windows-x64-cuda\`; it requires an NVIDIA driver compatible with CUDA 13.2 and enables SenseVoiceSmall graph execution with \`llama-funasr-sensevoice ... --backend cuda\`. No Python ASR runtime or local build is required. Docs: $docs"
9 changes: 6 additions & 3 deletions runtime/llama.cpp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ cmake --build build-cuda -j --target llama-funasr-sensevoice
-m sensevoice-small-f16.gguf -a sample.wav --backend cuda
```

`--backend cpu` remains the default and is what the current cross-platform
prebuilt binaries use. A binary built without `-DGGML_CUDA=ON` exits with a clear
message if `--backend cuda` is requested.
`--backend cpu` remains the default and is what the portable cross-platform
prebuilt binaries use. Tagged runtime releases also publish a
`funasr-llamacpp-windows-x64-cuda.zip` package when the Windows CUDA release job
passes; it requires an NVIDIA driver compatible with CUDA 13.2. A binary built

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

CUDA 13.2 is not an existing CUDA version (the current major version is 12). This should be updated to the actual CUDA version configured in the workflow (e.g., 12.x or 12.2/12.3) to avoid user confusion.

Suggested change
passes; it requires an NVIDIA driver compatible with CUDA 13.2. A binary built
passes; it requires an NVIDIA driver compatible with CUDA 12.x. A binary built

without `-DGGML_CUDA=ON` exits with a clear message if `--backend cuda` is
requested.

## Build (shared)
```bash
Expand Down
31 changes: 31 additions & 0 deletions runtime/llama.cpp/tests/test_release_workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from pathlib import Path


ROOT = Path(__file__).resolve().parents[3]
WORKFLOW = ROOT / ".github" / "workflows" / "build-llamacpp-binaries.yml"


def test_windows_cuda_release_asset_is_in_matrix():
workflow = WORKFLOW.read_text(encoding="utf-8")

assert "name: windows-x64-cuda" in workflow
assert "cuda: true" in workflow
assert "windows-x64-cuda" in workflow


def test_windows_cuda_build_uses_cuda_toolkit_and_flags():
workflow = WORKFLOW.read_text(encoding="utf-8")

assert "Jimver/cuda-toolkit@v0.2.35" in workflow

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Asserting the exact version of a third-party GitHub Action makes the test brittle and prone to failure when the action is updated in the workflow. Asserting just the action name is more robust.

Suggested change
assert "Jimver/cuda-toolkit@v0.2.35" in workflow
assert "Jimver/cuda-toolkit" in workflow

assert "if: matrix.cuda" in workflow
assert "-DGGML_CUDA=ON" in workflow
assert "-DGGML_CUDA_FA=OFF" in workflow
assert "-DGGML_CUDA_NCCL=OFF" in workflow


def test_release_notes_explain_cpu_and_cuda_windows_assets():
workflow = WORKFLOW.read_text(encoding="utf-8")

assert "windows-x64-cuda" in workflow
assert "--backend cuda" in workflow
assert "Windows CUDA" in workflow

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The test reads the GitHub Actions workflow file (WORKFLOW) but asserts strings that are documented in the README.md (such as --backend cuda and Windows CUDA). This appears to be a copy-paste error from previous tests. Reading the README.md file instead makes the test correct and meaningful.

Suggested change
def test_release_notes_explain_cpu_and_cuda_windows_assets():
workflow = WORKFLOW.read_text(encoding="utf-8")
assert "windows-x64-cuda" in workflow
assert "--backend cuda" in workflow
assert "Windows CUDA" in workflow
def test_release_notes_explain_cpu_and_cuda_windows_assets():
readme_path = ROOT / "runtime" / "llama.cpp" / "README.md"
readme = readme_path.read_text(encoding="utf-8")
assert "windows-x64-cuda" in readme
assert "--backend cuda" in readme
assert "Windows CUDA" in readme

Loading