From 53d96351b26de02d6ae1e109c4ac912849b1b01f Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 15:17:37 +0000 Subject: [PATCH 1/9] Add Windows CUDA llama.cpp release asset --- .github/workflows/build-llamacpp-binaries.yml | 32 ++++++++++++++++++- runtime/llama.cpp/README.md | 9 ++++-- .../llama.cpp/tests/test_release_workflow.py | 31 ++++++++++++++++++ 3 files changed, 68 insertions(+), 4 deletions(-) create mode 100644 runtime/llama.cpp/tests/test_release_workflow.py diff --git a/.github/workflows/build-llamacpp-binaries.yml b/.github/workflows/build-llamacpp-binaries.yml index 0f46c69b6..18a018a56 100644 --- a/.github/workflows/build-llamacpp-binaries.yml +++ b/.github/workflows/build-llamacpp-binaries.yml @@ -82,6 +82,26 @@ 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: @@ -89,6 +109,16 @@ jobs: 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 @@ -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 \` (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 \` (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" diff --git a/runtime/llama.cpp/README.md b/runtime/llama.cpp/README.md index 1004000c0..3a9a0ee02 100644 --- a/runtime/llama.cpp/README.md +++ b/runtime/llama.cpp/README.md @@ -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 +without `-DGGML_CUDA=ON` exits with a clear message if `--backend cuda` is +requested. ## Build (shared) ```bash diff --git a/runtime/llama.cpp/tests/test_release_workflow.py b/runtime/llama.cpp/tests/test_release_workflow.py new file mode 100644 index 000000000..d71028673 --- /dev/null +++ b/runtime/llama.cpp/tests/test_release_workflow.py @@ -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 + 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 From b3ab11816d316ed3ec564b5ef1aac8ef69c2e287 Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 15:44:10 +0000 Subject: [PATCH 2/9] Limit Windows CUDA release build to SenseVoice --- .github/workflows/build-llamacpp-binaries.yml | 10 +++++++++- runtime/llama.cpp/tests/test_release_workflow.py | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-llamacpp-binaries.yml b/.github/workflows/build-llamacpp-binaries.yml index 18a018a56..390222ae6 100644 --- a/.github/workflows/build-llamacpp-binaries.yml +++ b/.github/workflows/build-llamacpp-binaries.yml @@ -86,6 +86,7 @@ jobs: name: windows-x64-cuda cuda: true cuda_version: '13.2.0' + build_target: llama-funasr-sensevoice cmake_flags: >- -DGGML_NATIVE=OFF -DGGML_CUDA=ON @@ -126,8 +127,15 @@ jobs: # AVX-VNNI instructions and then crash with SIGILL on ordinary CPUs. # Keep the default x64 package conservative, and publish explicit # x64-avx2 assets for machines that support AVX2/FMA/F16C/BMI2. + # The CUDA release asset is SenseVoiceSmall-specific for now; building + # only that target keeps the Windows CUDA job bounded and matches the + # backend currently exposed by `--backend cuda`. cmake -B build -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_flags }} - cmake --build build --config Release -j 2 + if [ -n "${{ matrix.build_target }}" ]; then + cmake --build build --config Release -j 2 --target "${{ matrix.build_target }}" + else + cmake --build build --config Release -j 2 + fi - name: Package run: | mkdir -p pkg diff --git a/runtime/llama.cpp/tests/test_release_workflow.py b/runtime/llama.cpp/tests/test_release_workflow.py index d71028673..de48b9fb8 100644 --- a/runtime/llama.cpp/tests/test_release_workflow.py +++ b/runtime/llama.cpp/tests/test_release_workflow.py @@ -11,6 +11,7 @@ def test_windows_cuda_release_asset_is_in_matrix(): assert "name: windows-x64-cuda" in workflow assert "cuda: true" in workflow assert "windows-x64-cuda" in workflow + assert "build_target: llama-funasr-sensevoice" in workflow def test_windows_cuda_build_uses_cuda_toolkit_and_flags(): @@ -21,6 +22,7 @@ def test_windows_cuda_build_uses_cuda_toolkit_and_flags(): assert "-DGGML_CUDA=ON" in workflow assert "-DGGML_CUDA_FA=OFF" in workflow assert "-DGGML_CUDA_NCCL=OFF" in workflow + assert "--target \"${{ matrix.build_target }}\"" in workflow def test_release_notes_explain_cpu_and_cuda_windows_assets(): From f0b08bcc7ce7d916cd13749b321771b9d5df9eb9 Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 16:04:14 +0000 Subject: [PATCH 3/9] Address Windows CUDA release review feedback --- runtime/llama.cpp/README.md | 6 +++--- runtime/llama.cpp/tests/test_release_workflow.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/runtime/llama.cpp/README.md b/runtime/llama.cpp/README.md index 3a9a0ee02..9128ab6a8 100644 --- a/runtime/llama.cpp/README.md +++ b/runtime/llama.cpp/README.md @@ -75,9 +75,9 @@ cmake --build build-cuda -j --target llama-funasr-sensevoice `--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 -without `-DGGML_CUDA=ON` exits with a clear message if `--backend cuda` is -requested. +passes; it requires an NVIDIA driver compatible with the CUDA Toolkit version +configured by that release job. A binary built without `-DGGML_CUDA=ON` exits +with a clear message if `--backend cuda` is requested. ## Build (shared) ```bash diff --git a/runtime/llama.cpp/tests/test_release_workflow.py b/runtime/llama.cpp/tests/test_release_workflow.py index de48b9fb8..12cdb1202 100644 --- a/runtime/llama.cpp/tests/test_release_workflow.py +++ b/runtime/llama.cpp/tests/test_release_workflow.py @@ -17,7 +17,7 @@ def test_windows_cuda_release_asset_is_in_matrix(): 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 + 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 @@ -26,8 +26,8 @@ def test_windows_cuda_build_uses_cuda_toolkit_and_flags(): def test_release_notes_explain_cpu_and_cuda_windows_assets(): - workflow = WORKFLOW.read_text(encoding="utf-8") + readme = (ROOT / "runtime" / "llama.cpp" / "README.md").read_text(encoding="utf-8") - assert "windows-x64-cuda" in workflow - assert "--backend cuda" in workflow - assert "Windows CUDA" in workflow + assert "windows-x64-cuda" in readme + assert "--backend cuda" in readme + assert "Windows CUDA" in readme From 1b9f41c288c4f618295b850bfd084ce4eed55c8d Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 16:27:31 +0000 Subject: [PATCH 4/9] Sync Windows CUDA release notes --- .github/workflows/build-llamacpp-binaries.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-llamacpp-binaries.yml b/.github/workflows/build-llamacpp-binaries.yml index 390222ae6..e4642b94f 100644 --- a/.github/workflows/build-llamacpp-binaries.yml +++ b/.github/workflows/build-llamacpp-binaries.yml @@ -173,4 +173,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 \` (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" + --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 \` (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 the CUDA Toolkit version configured by the release workflow and enables SenseVoiceSmall graph execution with \`llama-funasr-sensevoice ... --backend cuda\`. No Python ASR runtime or local build is required. Docs: $docs" From 1e1916c6f336841e6f1ebf82b9379fe05e78ada0 Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 16:54:10 +0000 Subject: [PATCH 5/9] Bound Windows CUDA release architectures --- .github/workflows/build-llamacpp-binaries.yml | 13 +++++++++++-- runtime/llama.cpp/README.md | 5 +++-- runtime/llama.cpp/tests/test_release_workflow.py | 4 ++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-llamacpp-binaries.yml b/.github/workflows/build-llamacpp-binaries.yml index e4642b94f..37abee44e 100644 --- a/.github/workflows/build-llamacpp-binaries.yml +++ b/.github/workflows/build-llamacpp-binaries.yml @@ -86,6 +86,7 @@ jobs: name: windows-x64-cuda cuda: true cuda_version: '13.2.0' + cuda_architectures: '75;86;89;120' build_target: llama-funasr-sensevoice cmake_flags: >- -DGGML_NATIVE=OFF @@ -130,7 +131,15 @@ jobs: # The CUDA release asset is SenseVoiceSmall-specific for now; building # only that target keeps the Windows CUDA job bounded and matches the # backend currently exposed by `--backend cuda`. - cmake -B build -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmake_flags }} + cmake_args=( + -B build + -DCMAKE_BUILD_TYPE=Release + ${{ matrix.cmake_flags }} + ) + if [ -n "${{ matrix.cuda_architectures }}" ]; then + cmake_args+=("-DCMAKE_CUDA_ARCHITECTURES=${{ matrix.cuda_architectures }}") + fi + cmake "${cmake_args[@]}" if [ -n "${{ matrix.build_target }}" ]; then cmake --build build --config Release -j 2 --target "${{ matrix.build_target }}" else @@ -173,4 +182,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 \` (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 the CUDA Toolkit version configured by the release workflow and enables SenseVoiceSmall graph execution with \`llama-funasr-sensevoice ... --backend cuda\`. 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 \` (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 the CUDA Toolkit version configured by the release workflow, targets CUDA architectures 75/86/89/120, and enables SenseVoiceSmall graph execution with \`llama-funasr-sensevoice ... --backend cuda\`. No Python ASR runtime or local build is required. Docs: $docs" diff --git a/runtime/llama.cpp/README.md b/runtime/llama.cpp/README.md index 9128ab6a8..46004e0a0 100644 --- a/runtime/llama.cpp/README.md +++ b/runtime/llama.cpp/README.md @@ -76,8 +76,9 @@ cmake --build build-cuda -j --target llama-funasr-sensevoice 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 the CUDA Toolkit version -configured by that release job. A binary built without `-DGGML_CUDA=ON` exits -with a clear message if `--backend cuda` is requested. +configured by that release job and targets CUDA architectures 75/86/89/120. A +binary built without `-DGGML_CUDA=ON` exits with a clear message if +`--backend cuda` is requested. ## Build (shared) ```bash diff --git a/runtime/llama.cpp/tests/test_release_workflow.py b/runtime/llama.cpp/tests/test_release_workflow.py index 12cdb1202..21299a5b9 100644 --- a/runtime/llama.cpp/tests/test_release_workflow.py +++ b/runtime/llama.cpp/tests/test_release_workflow.py @@ -11,6 +11,7 @@ def test_windows_cuda_release_asset_is_in_matrix(): assert "name: windows-x64-cuda" in workflow assert "cuda: true" in workflow assert "windows-x64-cuda" in workflow + assert "cuda_architectures: '75;86;89;120'" in workflow assert "build_target: llama-funasr-sensevoice" in workflow @@ -22,6 +23,8 @@ def test_windows_cuda_build_uses_cuda_toolkit_and_flags(): assert "-DGGML_CUDA=ON" in workflow assert "-DGGML_CUDA_FA=OFF" in workflow assert "-DGGML_CUDA_NCCL=OFF" in workflow + assert "CMAKE_CUDA_ARCHITECTURES=${{ matrix.cuda_architectures }}" in workflow + assert "cmake \"${cmake_args[@]}\"" in workflow assert "--target \"${{ matrix.build_target }}\"" in workflow @@ -31,3 +34,4 @@ def test_release_notes_explain_cpu_and_cuda_windows_assets(): assert "windows-x64-cuda" in readme assert "--backend cuda" in readme assert "Windows CUDA" in readme + assert "CUDA architectures 75/86/89/120" in readme From 3fa345603f57cbab7d6ebc0198c846387baf114f Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 17:38:20 +0000 Subject: [PATCH 6/9] Bound Windows CUDA release build time --- .github/workflows/build-llamacpp-binaries.yml | 5 +++-- runtime/llama.cpp/README.md | 6 +++--- runtime/llama.cpp/tests/test_release_workflow.py | 7 +++++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-llamacpp-binaries.yml b/.github/workflows/build-llamacpp-binaries.yml index 37abee44e..a7446059b 100644 --- a/.github/workflows/build-llamacpp-binaries.yml +++ b/.github/workflows/build-llamacpp-binaries.yml @@ -86,11 +86,12 @@ jobs: name: windows-x64-cuda cuda: true cuda_version: '13.2.0' - cuda_architectures: '75;86;89;120' + cuda_architectures: '86' build_target: llama-funasr-sensevoice cmake_flags: >- -DGGML_NATIVE=OFF -DGGML_CUDA=ON + -DGGML_CUDA_FORCE_CUBLAS=ON -DGGML_CUDA_FA=OFF -DGGML_CUDA_NCCL=OFF -DGGML_CUDA_GRAPHS=OFF @@ -182,4 +183,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 \` (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 the CUDA Toolkit version configured by the release workflow, targets CUDA architectures 75/86/89/120, and enables SenseVoiceSmall graph execution with \`llama-funasr-sensevoice ... --backend cuda\`. 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 \` (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 the CUDA Toolkit version configured by the release workflow, targets CUDA architecture 86, and enables SenseVoiceSmall graph execution with \`llama-funasr-sensevoice ... --backend cuda\`. Build from source for other GPU architectures. No Python ASR runtime or local build is required. Docs: $docs" diff --git a/runtime/llama.cpp/README.md b/runtime/llama.cpp/README.md index 46004e0a0..c71605e32 100644 --- a/runtime/llama.cpp/README.md +++ b/runtime/llama.cpp/README.md @@ -76,9 +76,9 @@ cmake --build build-cuda -j --target llama-funasr-sensevoice 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 the CUDA Toolkit version -configured by that release job and targets CUDA architectures 75/86/89/120. A -binary built without `-DGGML_CUDA=ON` exits with a clear message if -`--backend cuda` is requested. +configured by that release job and targets CUDA architecture 86. Build from source +for other GPU architectures. A binary built without `-DGGML_CUDA=ON` exits with a +clear message if `--backend cuda` is requested. ## Build (shared) ```bash diff --git a/runtime/llama.cpp/tests/test_release_workflow.py b/runtime/llama.cpp/tests/test_release_workflow.py index 21299a5b9..2734a56c1 100644 --- a/runtime/llama.cpp/tests/test_release_workflow.py +++ b/runtime/llama.cpp/tests/test_release_workflow.py @@ -11,7 +11,7 @@ def test_windows_cuda_release_asset_is_in_matrix(): assert "name: windows-x64-cuda" in workflow assert "cuda: true" in workflow assert "windows-x64-cuda" in workflow - assert "cuda_architectures: '75;86;89;120'" in workflow + assert "cuda_architectures: '86'" in workflow assert "build_target: llama-funasr-sensevoice" in workflow @@ -21,6 +21,7 @@ def test_windows_cuda_build_uses_cuda_toolkit_and_flags(): assert "Jimver/cuda-toolkit" in workflow assert "if: matrix.cuda" in workflow assert "-DGGML_CUDA=ON" in workflow + assert "-DGGML_CUDA_FORCE_CUBLAS=ON" in workflow assert "-DGGML_CUDA_FA=OFF" in workflow assert "-DGGML_CUDA_NCCL=OFF" in workflow assert "CMAKE_CUDA_ARCHITECTURES=${{ matrix.cuda_architectures }}" in workflow @@ -34,4 +35,6 @@ def test_release_notes_explain_cpu_and_cuda_windows_assets(): assert "windows-x64-cuda" in readme assert "--backend cuda" in readme assert "Windows CUDA" in readme - assert "CUDA architectures 75/86/89/120" in readme + assert "CUDA architecture 86" in readme + assert "Build from source" in readme + assert "other GPU architectures" in readme From 388c687b7bd010632bafdb07ea40365984096b47 Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 18:08:04 +0000 Subject: [PATCH 7/9] Skip long CUDA templates for cublas release build --- runtime/llama.cpp/CMakeLists.txt | 29 ++++++++++++++++++- .../llama.cpp/tests/test_release_workflow.py | 11 +++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/runtime/llama.cpp/CMakeLists.txt b/runtime/llama.cpp/CMakeLists.txt index 64ebad851..d4b858e28 100644 --- a/runtime/llama.cpp/CMakeLists.txt +++ b/runtime/llama.cpp/CMakeLists.txt @@ -24,6 +24,9 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) endif() include(FetchContent) +if(POLICY CMP0169) + cmake_policy(SET CMP0169 OLD) +endif() set(LLAMA_BUILD_TESTS OFF CACHE BOOL "" FORCE) set(LLAMA_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) set(LLAMA_BUILD_TOOLS OFF CACHE BOOL "" FORCE) @@ -32,7 +35,31 @@ set(LLAMA_CURL OFF CACHE BOOL "" FORCE) FetchContent_Declare(llama GIT_REPOSITORY https://github.com/ggml-org/llama.cpp.git GIT_TAG 8086439a4cea94c71a5dfb8fe4ad1546aebd640f) -FetchContent_MakeAvailable(llama) +FetchContent_GetProperties(llama) +if(NOT llama_POPULATED) + FetchContent_Populate(llama) + if(GGML_CUDA_FORCE_CUBLAS) + set(_funasr_ggml_cuda_cmake "${llama_SOURCE_DIR}/ggml/src/ggml-cuda/CMakeLists.txt") + file(READ "${_funasr_ggml_cuda_cmake}" _funasr_ggml_cuda_text) + string(REPLACE +" file(GLOB SRCS \"template-instances/fattn-mma*.cu\") + list(APPEND GGML_SOURCES_CUDA ${SRCS}) + file(GLOB SRCS \"template-instances/mmq*.cu\") + list(APPEND GGML_SOURCES_CUDA ${SRCS}) +" +" if (NOT GGML_CUDA_FORCE_CUBLAS) + file(GLOB SRCS \"template-instances/fattn-mma*.cu\") + list(APPEND GGML_SOURCES_CUDA ${SRCS}) + file(GLOB SRCS \"template-instances/mmq*.cu\") + list(APPEND GGML_SOURCES_CUDA ${SRCS}) + endif() +" + _funasr_ggml_cuda_text "${_funasr_ggml_cuda_text}") + file(WRITE "${_funasr_ggml_cuda_cmake}" "${_funasr_ggml_cuda_text}") + message(WARNING "FunASR CUDA release: skipping ggml CUDA MMQ/fattn-mma template sources for GGML_CUDA_FORCE_CUBLAS") + endif() + add_subdirectory(${llama_SOURCE_DIR} ${llama_BINARY_DIR}) +endif() find_package(Threads REQUIRED) set(FUNASR_COMMON ${CMAKE_CURRENT_SOURCE_DIR}/funasr-common) diff --git a/runtime/llama.cpp/tests/test_release_workflow.py b/runtime/llama.cpp/tests/test_release_workflow.py index 2734a56c1..3e86f4904 100644 --- a/runtime/llama.cpp/tests/test_release_workflow.py +++ b/runtime/llama.cpp/tests/test_release_workflow.py @@ -3,6 +3,7 @@ ROOT = Path(__file__).resolve().parents[3] WORKFLOW = ROOT / ".github" / "workflows" / "build-llamacpp-binaries.yml" +RUNTIME_CMAKE = ROOT / "runtime" / "llama.cpp" / "CMakeLists.txt" def test_windows_cuda_release_asset_is_in_matrix(): @@ -29,6 +30,16 @@ def test_windows_cuda_build_uses_cuda_toolkit_and_flags(): assert "--target \"${{ matrix.build_target }}\"" in workflow +def test_cublas_release_build_skips_long_mmq_template_sources(): + cmake = RUNTIME_CMAKE.read_text(encoding="utf-8") + + assert "GGML_CUDA_FORCE_CUBLAS" in cmake + assert "skipping ggml CUDA MMQ/fattn-mma template sources" in cmake + assert 'if (NOT GGML_CUDA_FORCE_CUBLAS)' in cmake + assert 'template-instances/fattn-mma*.cu' in cmake + assert 'template-instances/mmq*.cu' in cmake + + def test_release_notes_explain_cpu_and_cuda_windows_assets(): readme = (ROOT / "runtime" / "llama.cpp" / "README.md").read_text(encoding="utf-8") From cc45f4c7f81c7a5a8aeebdfda728f7e1ee539717 Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 18:29:41 +0000 Subject: [PATCH 8/9] Prune unused CUDA template sources in release build --- runtime/llama.cpp/CMakeLists.txt | 52 ++++++++++++++++--- .../llama.cpp/tests/test_release_workflow.py | 5 +- 2 files changed, 49 insertions(+), 8 deletions(-) diff --git a/runtime/llama.cpp/CMakeLists.txt b/runtime/llama.cpp/CMakeLists.txt index d4b858e28..f40122103 100644 --- a/runtime/llama.cpp/CMakeLists.txt +++ b/runtime/llama.cpp/CMakeLists.txt @@ -42,21 +42,59 @@ if(NOT llama_POPULATED) set(_funasr_ggml_cuda_cmake "${llama_SOURCE_DIR}/ggml/src/ggml-cuda/CMakeLists.txt") file(READ "${_funasr_ggml_cuda_cmake}" _funasr_ggml_cuda_text) string(REPLACE -" file(GLOB SRCS \"template-instances/fattn-mma*.cu\") - list(APPEND GGML_SOURCES_CUDA ${SRCS}) +" file(GLOB SRCS \"template-instances/fattn-tile*.cu\") + list(APPEND GGML_SOURCES_CUDA \${SRCS}) + file(GLOB SRCS \"template-instances/fattn-mma*.cu\") + list(APPEND GGML_SOURCES_CUDA \${SRCS}) file(GLOB SRCS \"template-instances/mmq*.cu\") - list(APPEND GGML_SOURCES_CUDA ${SRCS}) + list(APPEND GGML_SOURCES_CUDA \${SRCS}) + file(GLOB SRCS \"template-instances/mmf*.cu\") + list(APPEND GGML_SOURCES_CUDA \${SRCS}) " -" if (NOT GGML_CUDA_FORCE_CUBLAS) +" if (GGML_CUDA_FA) + file(GLOB SRCS \"template-instances/fattn-tile*.cu\") + list(APPEND GGML_SOURCES_CUDA \${SRCS}) file(GLOB SRCS \"template-instances/fattn-mma*.cu\") - list(APPEND GGML_SOURCES_CUDA ${SRCS}) + list(APPEND GGML_SOURCES_CUDA \${SRCS}) + endif() + if (NOT GGML_CUDA_FORCE_CUBLAS) file(GLOB SRCS \"template-instances/mmq*.cu\") - list(APPEND GGML_SOURCES_CUDA ${SRCS}) + list(APPEND GGML_SOURCES_CUDA \${SRCS}) + file(GLOB SRCS \"template-instances/mmf*.cu\") + list(APPEND GGML_SOURCES_CUDA \${SRCS}) + endif() +" + _funasr_ggml_cuda_text "${_funasr_ggml_cuda_text}") + string(REPLACE +" if (GGML_CUDA_FA_ALL_QUANTS) + file(GLOB SRCS \"template-instances/fattn-vec*.cu\") + list(APPEND GGML_SOURCES_CUDA \${SRCS}) + add_compile_definitions(GGML_CUDA_FA_ALL_QUANTS) + else() + list(APPEND GGML_SOURCES_CUDA + template-instances/fattn-vec-instance-f16-f16.cu + template-instances/fattn-vec-instance-q4_0-q4_0.cu + template-instances/fattn-vec-instance-q8_0-q8_0.cu + template-instances/fattn-vec-instance-bf16-bf16.cu) + endif() +" +" if (GGML_CUDA_FA) + if (GGML_CUDA_FA_ALL_QUANTS) + file(GLOB SRCS \"template-instances/fattn-vec*.cu\") + list(APPEND GGML_SOURCES_CUDA \${SRCS}) + add_compile_definitions(GGML_CUDA_FA_ALL_QUANTS) + else() + list(APPEND GGML_SOURCES_CUDA + template-instances/fattn-vec-instance-f16-f16.cu + template-instances/fattn-vec-instance-q4_0-q4_0.cu + template-instances/fattn-vec-instance-q8_0-q8_0.cu + template-instances/fattn-vec-instance-bf16-bf16.cu) + endif() endif() " _funasr_ggml_cuda_text "${_funasr_ggml_cuda_text}") file(WRITE "${_funasr_ggml_cuda_cmake}" "${_funasr_ggml_cuda_text}") - message(WARNING "FunASR CUDA release: skipping ggml CUDA MMQ/fattn-mma template sources for GGML_CUDA_FORCE_CUBLAS") + message(WARNING "FunASR CUDA release: pruning ggml CUDA template sources for GGML_CUDA_FORCE_CUBLAS/GGML_CUDA_FA") endif() add_subdirectory(${llama_SOURCE_DIR} ${llama_BINARY_DIR}) endif() diff --git a/runtime/llama.cpp/tests/test_release_workflow.py b/runtime/llama.cpp/tests/test_release_workflow.py index 3e86f4904..61ab6cd30 100644 --- a/runtime/llama.cpp/tests/test_release_workflow.py +++ b/runtime/llama.cpp/tests/test_release_workflow.py @@ -34,10 +34,13 @@ def test_cublas_release_build_skips_long_mmq_template_sources(): cmake = RUNTIME_CMAKE.read_text(encoding="utf-8") assert "GGML_CUDA_FORCE_CUBLAS" in cmake - assert "skipping ggml CUDA MMQ/fattn-mma template sources" in cmake + assert "pruning ggml CUDA template sources" in cmake + assert "if (GGML_CUDA_FA)" in cmake assert 'if (NOT GGML_CUDA_FORCE_CUBLAS)' in cmake + assert 'template-instances/fattn-tile*.cu' in cmake assert 'template-instances/fattn-mma*.cu' in cmake assert 'template-instances/mmq*.cu' in cmake + assert 'template-instances/mmf*.cu' in cmake def test_release_notes_explain_cpu_and_cuda_windows_assets(): From 6e40bea71fdc39c34339715b2107ed80d83f5194 Mon Sep 17 00:00:00 2001 From: zhifu gao Date: Sat, 18 Jul 2026 18:54:07 +0000 Subject: [PATCH 9/9] Fix Windows CUDA release link failure --- .github/workflows/build-llamacpp-binaries.yml | 2 + runtime/llama.cpp/CMakeLists.txt | 58 ------------------- .../llama.cpp/tests/test_release_workflow.py | 15 +---- 3 files changed, 3 insertions(+), 72 deletions(-) diff --git a/.github/workflows/build-llamacpp-binaries.yml b/.github/workflows/build-llamacpp-binaries.yml index a7446059b..18834dd83 100644 --- a/.github/workflows/build-llamacpp-binaries.yml +++ b/.github/workflows/build-llamacpp-binaries.yml @@ -88,6 +88,7 @@ jobs: cuda_version: '13.2.0' cuda_architectures: '86' build_target: llama-funasr-sensevoice + timeout_minutes: 90 cmake_flags: >- -DGGML_NATIVE=OFF -DGGML_CUDA=ON @@ -106,6 +107,7 @@ jobs: -DGGML_F16C=OFF -DGGML_BMI2=OFF runs-on: ${{ matrix.os }} + timeout-minutes: ${{ matrix.timeout_minutes || 30 }} defaults: run: shell: bash diff --git a/runtime/llama.cpp/CMakeLists.txt b/runtime/llama.cpp/CMakeLists.txt index f40122103..66fa28fd9 100644 --- a/runtime/llama.cpp/CMakeLists.txt +++ b/runtime/llama.cpp/CMakeLists.txt @@ -38,64 +38,6 @@ FetchContent_Declare(llama FetchContent_GetProperties(llama) if(NOT llama_POPULATED) FetchContent_Populate(llama) - if(GGML_CUDA_FORCE_CUBLAS) - set(_funasr_ggml_cuda_cmake "${llama_SOURCE_DIR}/ggml/src/ggml-cuda/CMakeLists.txt") - file(READ "${_funasr_ggml_cuda_cmake}" _funasr_ggml_cuda_text) - string(REPLACE -" file(GLOB SRCS \"template-instances/fattn-tile*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - file(GLOB SRCS \"template-instances/fattn-mma*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - file(GLOB SRCS \"template-instances/mmq*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - file(GLOB SRCS \"template-instances/mmf*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) -" -" if (GGML_CUDA_FA) - file(GLOB SRCS \"template-instances/fattn-tile*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - file(GLOB SRCS \"template-instances/fattn-mma*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - endif() - if (NOT GGML_CUDA_FORCE_CUBLAS) - file(GLOB SRCS \"template-instances/mmq*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - file(GLOB SRCS \"template-instances/mmf*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - endif() -" - _funasr_ggml_cuda_text "${_funasr_ggml_cuda_text}") - string(REPLACE -" if (GGML_CUDA_FA_ALL_QUANTS) - file(GLOB SRCS \"template-instances/fattn-vec*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - add_compile_definitions(GGML_CUDA_FA_ALL_QUANTS) - else() - list(APPEND GGML_SOURCES_CUDA - template-instances/fattn-vec-instance-f16-f16.cu - template-instances/fattn-vec-instance-q4_0-q4_0.cu - template-instances/fattn-vec-instance-q8_0-q8_0.cu - template-instances/fattn-vec-instance-bf16-bf16.cu) - endif() -" -" if (GGML_CUDA_FA) - if (GGML_CUDA_FA_ALL_QUANTS) - file(GLOB SRCS \"template-instances/fattn-vec*.cu\") - list(APPEND GGML_SOURCES_CUDA \${SRCS}) - add_compile_definitions(GGML_CUDA_FA_ALL_QUANTS) - else() - list(APPEND GGML_SOURCES_CUDA - template-instances/fattn-vec-instance-f16-f16.cu - template-instances/fattn-vec-instance-q4_0-q4_0.cu - template-instances/fattn-vec-instance-q8_0-q8_0.cu - template-instances/fattn-vec-instance-bf16-bf16.cu) - endif() - endif() -" - _funasr_ggml_cuda_text "${_funasr_ggml_cuda_text}") - file(WRITE "${_funasr_ggml_cuda_cmake}" "${_funasr_ggml_cuda_text}") - message(WARNING "FunASR CUDA release: pruning ggml CUDA template sources for GGML_CUDA_FORCE_CUBLAS/GGML_CUDA_FA") - endif() add_subdirectory(${llama_SOURCE_DIR} ${llama_BINARY_DIR}) endif() diff --git a/runtime/llama.cpp/tests/test_release_workflow.py b/runtime/llama.cpp/tests/test_release_workflow.py index 61ab6cd30..18f749952 100644 --- a/runtime/llama.cpp/tests/test_release_workflow.py +++ b/runtime/llama.cpp/tests/test_release_workflow.py @@ -3,7 +3,6 @@ ROOT = Path(__file__).resolve().parents[3] WORKFLOW = ROOT / ".github" / "workflows" / "build-llamacpp-binaries.yml" -RUNTIME_CMAKE = ROOT / "runtime" / "llama.cpp" / "CMakeLists.txt" def test_windows_cuda_release_asset_is_in_matrix(): @@ -14,6 +13,7 @@ def test_windows_cuda_release_asset_is_in_matrix(): assert "windows-x64-cuda" in workflow assert "cuda_architectures: '86'" in workflow assert "build_target: llama-funasr-sensevoice" in workflow + assert "timeout_minutes: 90" in workflow def test_windows_cuda_build_uses_cuda_toolkit_and_flags(): @@ -30,19 +30,6 @@ def test_windows_cuda_build_uses_cuda_toolkit_and_flags(): assert "--target \"${{ matrix.build_target }}\"" in workflow -def test_cublas_release_build_skips_long_mmq_template_sources(): - cmake = RUNTIME_CMAKE.read_text(encoding="utf-8") - - assert "GGML_CUDA_FORCE_CUBLAS" in cmake - assert "pruning ggml CUDA template sources" in cmake - assert "if (GGML_CUDA_FA)" in cmake - assert 'if (NOT GGML_CUDA_FORCE_CUBLAS)' in cmake - assert 'template-instances/fattn-tile*.cu' in cmake - assert 'template-instances/fattn-mma*.cu' in cmake - assert 'template-instances/mmq*.cu' in cmake - assert 'template-instances/mmf*.cu' in cmake - - def test_release_notes_explain_cpu_and_cuda_windows_assets(): readme = (ROOT / "runtime" / "llama.cpp" / "README.md").read_text(encoding="utf-8")