char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
391fac164
char/aliceai-t5-moe
1name : Release 2 3on : 4workflow_dispatch : # allows manual triggering 5inputs : 6create_release : 7description : 'Create new release' 8required : true 9type : boolean 10push : 11branches : 12- master 13paths : [ 14'.github/workflows/release.yml' , 15'**/CMakeLists.txt' , 16'**/.cmake' , 17'**/*.h' , 18'**/*.hpp' , 19'**/*.c' , 20'**/*.cpp' , 21'**/*.cu' , 22'**/*.cuh' , 23'**/*.swift' , 24'**/*.m' , 25'**/*.metal' , 26'**/*.comp' , 27'**/*.glsl' 28] 29 30env : 31GH_TOKEN : ${{ github.token }} 32BRANCH_NAME : ${{ github.head_ref || github.ref_name }} 33CMAKE_ARGS : "-DLLAMA_BUILD_EXAMPLES=OFF -DLLAMA_BUILD_TESTS=OFF -DLLAMA_BUILD_TOOLS=ON -DLLAMA_BUILD_SERVER=ON -DGGML_RPC=ON" 34 35# note: run this workflow one at a time for better cache reuse 36concurrency : 37group : release 38queue : max 39 40jobs : 41check-release : 42runs-on : ubuntu-slim 43 44outputs : 45should_release : ${{ steps.check.outputs.should_release }} 46 47steps : 48- id : check 49env : 50COMMIT_MESSAGE : ${{ github.event.head_commit.message }} 51run : | 52if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then 53echo "should_release=true" >> $GITHUB_OUTPUT 54elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/master" ]]; then 55if echo "$COMMIT_MESSAGE" | grep -q '\[no release\]'; then 56echo "should_release=false" >> $GITHUB_OUTPUT 57else 58echo "should_release=true" >> $GITHUB_OUTPUT 59fi 60else 61echo "should_release=false" >> $GITHUB_OUTPUT 62fi 63 64macos-cpu : 65needs : [ check-release , ui-build ] 66if : ${{ needs.check-release.outputs.should_release == 'true' }} 67strategy : 68matrix : 69include : 70- build : 'arm64' 71arch : 'arm64' 72os : macos-26 73defines : "-DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3" 74# TODO: this build is disabled to save Github Actions resources (https://github.com/ggml-org/llama.cpp/pull/23780) 75# in order to enable it again, we have to provision dedicated runners to run it 76#- build: 'arm64-kleidiai' 77# arch: 'arm64' 78# os: macos-14 79# defines: "-DGGML_METAL_EMBED_LIBRARY=ON -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 -DGGML_CPU_KLEIDIAI=ON" 80- build : 'x64' 81arch : 'x64' 82os : macos-15-intel 83# Metal is disabled on x64 due to intermittent failures with Github runners not having a GPU: 84# https://github.com/ggml-org/llama.cpp/actions/runs/8635935781/job/23674807267#step:5:2313 85defines : "-DGGML_METAL=OFF -DCMAKE_OSX_DEPLOYMENT_TARGET=13.3" 86 87runs-on : ${{ matrix.os }} 88 89permissions : 90actions : write 91 92steps : 93- name : Clone 94id : checkout 95uses : actions/checkout@v6 96with : 97fetch-depth : 0 98 99- name : Download UI build 100uses : actions/download-artifact@v7 101with : 102name : llama-ui.zip 103path : tools/ui/dist 104 105- name : ccache 106uses : ggml-org/ccache-action@v1.2.24 107with : 108key : release-${{ matrix.os }}-${{ matrix.arch }} 109 110- name : Build 111id : cmake_build 112run : | 113sysctl -a 114cmake -B build \ 115${{ matrix.defines }} \ 116-DCMAKE_INSTALL_RPATH='@loader_path' \ 117-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 118-DLLAMA_FATAL_WARNINGS=ON \ 119-DLLAMA_BUILD_BORINGSSL=ON \ 120${{ env.CMAKE_ARGS }} 121cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) 122 123- name : Determine tag name 124id : tag 125uses : ./.github/actions/get-tag-name 126 127- name : Pack artifacts 128id : pack_artifacts 129run : | 130cp LICENSE ./build/bin/ 131tar -czvf llama-${{ steps.tag.outputs.name }}-bin-macos-${{ matrix.build }}.tar.gz -s ",^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . 132 133- name : Upload artifacts 134uses : actions/upload-artifact@v6 135with : 136path : llama-${{ steps.tag.outputs.name }}-bin-macos-${{ matrix.build }}.tar.gz 137name : llama-bin-macos-${{ matrix.build }}.tar.gz 138 139- name : ccache-clear 140uses : ./.github/actions/ccache-clear 141with : 142key : release-${{ matrix.os }}-${{ matrix.arch }} 143 144ubuntu-cpu : 145needs : [ check-release , ui-build ] 146if : ${{ needs.check-release.outputs.should_release == 'true' }} 147strategy : 148matrix : 149include : 150- build : 'x64' 151os : ubuntu-22.04 152- build : 'arm64' 153os : ubuntu-24.04-arm 154- build : 's390x' 155os : ubuntu-24.04-s390x 156 157runs-on : ${{ matrix.os }} 158 159permissions : 160actions : write 161 162steps : 163- name : Clone 164id : checkout 165uses : actions/checkout@v6 166with : 167fetch-depth : 0 168 169- name : Download UI build 170uses : actions/download-artifact@v7 171with : 172name : llama-ui.zip 173path : tools/ui/dist 174 175- name : Dependencies 176id : depends 177run : | 178sudo apt-get update 179sudo apt-get install build-essential libssl-dev 180 181- name : Toolchain workaround (GCC 14) 182if : ${{ contains(matrix.os, 'ubuntu-24.04') }} 183run : | 184sudo apt-get install -y gcc-14 g++-14 185echo "CC=gcc-14" >> "$GITHUB_ENV" 186echo "CXX=g++-14" >> "$GITHUB_ENV" 187 188- name : ccache 189if : ${{ matrix.build != 's390x' }} 190uses : ggml-org/ccache-action@v1.2.24 191with : 192key : release-${{ matrix.os }}-cpu 193 194- name : Build 195id : cmake_build 196run : | 197cmake -B build \ 198-DCMAKE_INSTALL_RPATH='$ORIGIN' \ 199-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 200-DGGML_BACKEND_DL=ON \ 201-DGGML_NATIVE=OFF \ 202-DGGML_CPU_ALL_VARIANTS=ON \ 203-DLLAMA_FATAL_WARNINGS=ON \ 204${{ env.CMAKE_ARGS }} 205cmake --build build --config Release -j $(nproc) 206 207- name : Determine tag name 208id : tag 209uses : ./.github/actions/get-tag-name 210 211- name : Pack artifacts 212id : pack_artifacts 213run : | 214cp LICENSE ./build/bin/ 215tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . 216 217- name : Upload artifacts 218uses : actions/upload-artifact@v6 219with : 220path : llama-${{ steps.tag.outputs.name }}-bin-ubuntu-${{ matrix.build }}.tar.gz 221name : llama-bin-ubuntu-${{ matrix.build }}.tar.gz 222 223- name : ccache-clear 224if : ${{ matrix.build != 's390x' }} 225uses : ./.github/actions/ccache-clear 226with : 227key : release-${{ matrix.os }}-cpu 228 229ubuntu-vulkan : 230needs : [ check-release , ui-build ] 231if : ${{ needs.check-release.outputs.should_release == 'true' }} 232 233strategy : 234matrix : 235include : 236- build : 'x64' 237os : ubuntu-22.04 238- build : 'arm64' 239os : ubuntu-24.04-arm 240 241runs-on : ${{ matrix.os }} 242 243permissions : 244actions : write 245 246steps : 247- name : Clone 248id : checkout 249uses : actions/checkout@v6 250with : 251fetch-depth : 0 252 253- name : Download UI build 254uses : actions/download-artifact@v7 255with : 256name : llama-ui.zip 257path : tools/ui/dist 258 259- name : Dependencies 260id : depends 261run : | 262if [[ "${{ matrix.os }}" =~ "ubuntu-22.04" ]]; then 263wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo apt-key add - 264sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-jammy.list https://packages.lunarg.com/vulkan/lunarg-vulkan-jammy.list 265sudo apt-get update -y 266sudo apt-get install -y build-essential mesa-vulkan-drivers vulkan-sdk libssl-dev 267else 268sudo apt-get update -y 269sudo apt-get install -y gcc-14 g++-14 build-essential glslc libvulkan-dev spirv-headers libssl-dev ninja-build 270echo "CC=gcc-14" >> "$GITHUB_ENV" 271echo "CXX=g++-14" >> "$GITHUB_ENV" 272fi 273 274- name : ccache 275uses : ggml-org/ccache-action@v1.2.24 276with : 277key : release-${{ matrix.os }}-vulkan 278 279- name : Build 280id : cmake_build 281run : | 282cmake -B build \ 283-DCMAKE_INSTALL_RPATH='$ORIGIN' \ 284-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 285-DGGML_BACKEND_DL=ON \ 286-DGGML_NATIVE=OFF \ 287-DGGML_CPU_ALL_VARIANTS=ON \ 288-DGGML_VULKAN=ON \ 289${{ env.CMAKE_ARGS }} 290cmake --build build --config Release -j $(nproc) 291 292- name : Determine tag name 293id : tag 294uses : ./.github/actions/get-tag-name 295 296- name : Pack artifacts 297id : pack_artifacts 298run : | 299cp LICENSE ./build/bin/ 300tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . 301 302- name : Upload artifacts 303uses : actions/upload-artifact@v6 304with : 305path : llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz 306name : llama-bin-ubuntu-vulkan-${{ matrix.build }}.tar.gz 307 308- name : ccache-clear 309uses : ./.github/actions/ccache-clear 310with : 311key : release-${{ matrix.os }}-vulkan 312 313ubuntu-cuda : 314name : ubuntu-cuda (${{ matrix.label }}, ${{ matrix.build }}) 315needs : [ check-release , ui-build ] 316if : ${{ needs.check-release.outputs.should_release == 'true' }} 317 318strategy : 319matrix : 320include : 321# label = short version used in artifact names / release body 322# cuda = full container image tag 323- build : 'x64' 324os : ubuntu-24.04 325cuda : '12.8.2' 326label : '12.8' 327defines : '-DGGML_CUDA_CUB_3DOT2=ON' 328- build : 'x64' 329os : ubuntu-24.04 330cuda : '13.3.1' 331label : '13.3' 332defines : '' 333- build : 'arm64' 334os : ubuntu-24.04-arm 335cuda : '13.3.1' 336label : '13.3' 337defines : '' 338 339runs-on : ${{ matrix.os }} 340container : nvidia/cuda:${{ matrix.cuda }}-devel-ubuntu24.04 341 342permissions : 343actions : write 344 345steps : 346# the container has no git; install it before checkout so that a real git 347# repository is created (the get-tag-name action and the build both need it) 348- name : Install git 349run : | 350apt-get update 351apt-get install -y --no-install-recommends git 352 353- name : Clone 354id : checkout 355uses : actions/checkout@v6 356with : 357fetch-depth : 0 358 359# checkout runs as the host user; in-container steps run as root, so git 360# refuses to touch a repo it does not own. Mark the workspace as safe. 361# use the env var: the github.workspace context holds the HOST path, 362# GITHUB_WORKSPACE the container path 363- name : Git safe directory 364run : git config --global --add safe.directory "$GITHUB_WORKSPACE" 365 366- name : Download UI build 367uses : actions/download-artifact@v7 368with : 369name : llama-ui.zip 370path : tools/ui/dist 371 372- name : Dependencies 373id : depends 374# container jobs default to sh (dash); need bash for the [[ ]] below 375shell : bash 376run : | 377apt-get update 378apt-get install -y --no-install-recommends build-essential cmake ninja-build libssl-dev jq python3-venv 379# the container ships GCC 13, which does not know the 'sme' march 380# feature used by the armv9.2 CPU variant of GGML_CPU_ALL_VARIANTS 381if [[ "${{ matrix.build }}" == "arm64" ]]; then 382apt-get install -y --no-install-recommends gcc-14 g++-14 383echo "CC=gcc-14" >> "$GITHUB_ENV" 384echo "CXX=g++-14" >> "$GITHUB_ENV" 385fi 386 387- name : ccache 388uses : ggml-org/ccache-action@v1.2.24 389with : 390key : release-ubuntu-${{ matrix.os }}-cuda-${{ matrix.label }}-${{ matrix.build }} 391evict-old-files : 1d 392max-size : "1G" 393 394- name : Build 395id : cmake_build 396# no CMAKE_CUDA_ARCHITECTURES: use the broad default arch set from 397# ggml/src/ggml-cuda/CMakeLists.txt so the release binary covers many GPUs 398run : | 399cmake -B build \ 400-DCMAKE_INSTALL_RPATH='$ORIGIN' \ 401-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 402-DGGML_BACKEND_DL=ON \ 403-DGGML_NATIVE=OFF \ 404-DGGML_CPU_ALL_VARIANTS=ON \ 405-DGGML_CUDA=ON \ 406-DGGML_CUDA_NCCL=OFF \ 407${{ env.CMAKE_ARGS }} ${{ matrix.defines }} 408cmake --build build --config Release -j $(nproc) 409 410- name : Determine tag name 411id : tag 412uses : ./.github/actions/get-tag-name 413 414- name : Pack artifacts 415id : pack_artifacts 416run : | 417cp LICENSE ./build/bin/ 418tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . 419 420- name : Upload artifacts 421uses : actions/upload-artifact@v6 422with : 423path : llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz 424name : llama-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz 425 426# ship the CUDA runtime libraries the backend links against, mirroring 427# the windows-cuda cudart zip - extract next to the binaries ($ORIGIN rpath) 428- name : Pack CUDA runtime 429id : pack_cuda_runtime 430run : | 431major="${{ matrix.label }}" 432major="${major%%.*}" 433mkdir -p ./cudart 434# cp -L dereferences the SONAME symlinks into plain files, so the 435# tarball holds exactly 3 files with no versioned duplicates 436cp -L /usr/local/cuda/lib64/libcudart.so.${major} ./cudart/ 437cp -L /usr/local/cuda/lib64/libcublas.so.${major} ./cudart/ 438cp -L /usr/local/cuda/lib64/libcublasLt.so.${major} ./cudart/ 439tar -czvf cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz --transform "s,^\.,cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}," -C ./cudart . 440 441- name : Upload CUDA runtime 442uses : actions/upload-artifact@v6 443with : 444path : cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz 445name : cudart-llama-bin-ubuntu-cuda-${{ matrix.label }}-${{ matrix.build }}.tar.gz 446 447- name : ccache-clear 448uses : ./.github/actions/ccache-clear 449with : 450key : release-ubuntu-${{ matrix.os }}-cuda-${{ matrix.label }}-${{ matrix.build }} 451 452android-arm64 : 453needs : [ check-release , ui-build ] 454if : ${{ needs.check-release.outputs.should_release == 'true' }} 455 456runs-on : ubuntu-latest 457 458#permissions: 459# actions: write 460 461env : 462NDK_VERSION : "29.0.14206865" 463 464steps : 465- name : Clone 466id : checkout 467uses : actions/checkout@v6 468with : 469fetch-depth : 0 470 471- name : Download UI build 472uses : actions/download-artifact@v7 473with : 474name : llama-ui.zip 475path : tools/ui/dist 476 477- name : Set up JDK 478uses : actions/setup-java@v5 479with : 480java-version : 17 481distribution : temurin 482 483- name : Setup Android SDK 484uses : android-actions/setup-android@40fd30fb8d7440372e1316f5d1809ec01dcd3699 # v4.0.1 485with : 486log-accepted-android-sdk-licenses : false 487 488- name : Install NDK 489run : | 490sdkmanager "ndk;${{ env.NDK_VERSION }}" 491echo "ANDROID_NDK=${ANDROID_SDK_ROOT}/ndk/${{ env.NDK_VERSION }}" >> $GITHUB_ENV 492 493# note : disabled to spare some cache space (https://github.com/ggml-org/llama.cpp/pull/23789) 494# for some reason, the ccache does not improve the build time in this case 495# example: 496# cache off: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78160400831 497# cache on: https://github.com/ggerganov/tmp2/actions/runs/26534713799/job/78224189394 498# 499#- name: ccache 500# uses: ggml-org/ccache-action@v1.2.24 501# with: 502# key: release-android-arm64 503 504- name : Build 505id : cmake_build 506run : | 507cmake -B build \ 508-DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake \ 509-DANDROID_ABI=arm64-v8a \ 510-DANDROID_PLATFORM=android-28 \ 511-DCMAKE_INSTALL_RPATH='$ORIGIN' \ 512-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 513-DGGML_BACKEND_DL=ON \ 514-DGGML_NATIVE=OFF \ 515-DGGML_CPU_ALL_VARIANTS=ON \ 516-DLLAMA_FATAL_WARNINGS=ON \ 517-DGGML_OPENMP=OFF \ 518-DLLAMA_BUILD_BORINGSSL=ON \ 519${{ env.CMAKE_ARGS }} 520cmake --build build --config Release -j $(nproc) 521 522#- name: ccache-clear 523# uses: ./.github/actions/ccache-clear 524# with: 525# key: release-android-arm64 526 527- name : Determine tag name 528id : tag 529uses : ./.github/actions/get-tag-name 530 531- name : Pack artifacts 532id : pack_artifacts 533run : | 534cp LICENSE ./build/bin/ 535tar -czvf llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . 536 537- name : Upload artifacts 538uses : actions/upload-artifact@v6 539with : 540path : llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz 541name : llama-bin-android-arm64.tar.gz 542 543ubuntu-24-openvino : 544needs : [ check-release , ui-build ] 545if : ${{ needs.check-release.outputs.should_release == 'true' }} 546 547runs-on : ubuntu-24.04 548 549permissions : 550actions : write 551 552outputs : 553openvino_version : ${{ steps.openvino_version.outputs.value }} 554 555env : 556# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile 557OPENVINO_VERSION_MAJOR : "2026.3.1" 558OPENVINO_VERSION_FULL : "2026.3.1.22476.56d9685302d" 559 560steps : 561- name : Set OpenVINO version output 562id : openvino_version 563run : echo "value=${{ env.OPENVINO_VERSION_MAJOR }}" >> $GITHUB_OUTPUT 564 565- name : Clone 566id : checkout 567uses : actions/checkout@v6 568with : 569fetch-depth : 0 570 571- name : Download UI build 572uses : actions/download-artifact@v7 573with : 574name : llama-ui.zip 575path : tools/ui/dist 576 577- name : ccache 578uses : ggml-org/ccache-action@v1.2.24 579with : 580key : release-ubuntu-24.04-openvino-release-no-preset-v1 581 582- name : Dependencies 583run : | 584sudo apt-get update 585sudo apt-get install -y build-essential libssl-dev libtbb12 cmake ninja-build python3-pip 586sudo apt install ocl-icd-opencl-dev opencl-headers opencl-clhpp-headers intel-opencl-icd 587 588- name : Use OpenVINO Toolkit Cache 589uses : actions/cache@v5 590id : cache-openvino 591with : 592path : ./openvino_toolkit 593key : cache-gha-openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }} 594 595- name : Setup OpenVINO Toolkit 596if : steps.cache-openvino.outputs.cache-hit != 'true' 597uses : ./.github/actions/linux-setup-openvino 598with : 599path : ./openvino_toolkit 600version_major : ${{ env.OPENVINO_VERSION_MAJOR }} 601version_full : ${{ env.OPENVINO_VERSION_FULL }} 602 603- name : Install OpenVINO dependencies 604run : | 605cd ./openvino_toolkit 606chmod +x ./install_dependencies/install_openvino_dependencies.sh 607echo "Y" | sudo -E ./install_dependencies/install_openvino_dependencies.sh 608 609- name : Build 610id : cmake_build 611run : | 612source ./openvino_toolkit/setupvars.sh 613cmake -B build/ReleaseOV -G Ninja \ 614-DCMAKE_BUILD_TYPE=Release \ 615-DGGML_OPENVINO=ON \ 616-DCMAKE_INSTALL_RPATH='$ORIGIN' \ 617-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 618${{ env.CMAKE_ARGS }} 619cmake --build build/ReleaseOV --config Release --parallel 620 621- name : Determine tag name 622id : tag 623uses : ./.github/actions/get-tag-name 624 625- name : Pack artifacts 626id : pack_artifacts 627run : | 628dest=./build/ReleaseOV/bin 629OPENVINO_ROOT=./openvino_toolkit 630ov_lib="$OPENVINO_ROOT/runtime/lib/intel64" 631 632# Bundle OpenVINO runtime libs + TBB. Binaries built with RPATH=$ORIGIN 633# load these siblings without setupvars.sh / LD_LIBRARY_PATH. 634cp -P "$ov_lib"/libopenvino.so* \ 635"$ov_lib"/libopenvino_c.so* \ 636"$ov_lib"/libopenvino_*_plugin.so \ 637"$ov_lib"/libopenvino_intel_npu_compiler*.so \ 638"$OPENVINO_ROOT"/runtime/3rdparty/tbb/lib/*.so* \ 639"$dest" 640cp -P /usr/lib/x86_64-linux-gnu/libOpenCL.so.1* "$dest" 2>/dev/null || true 641cp "$ov_lib"/cache.json "$dest" 2>/dev/null || true 642 643# OpenVINO licensing 644cp -r "$OPENVINO_ROOT"/docs/licensing "$dest"/openvino-licensing 645 646cp LICENSE "$dest" 647tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C "$dest" . 648 649- name : Upload artifacts 650uses : actions/upload-artifact@v6 651with : 652path : llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz 653name : llama-bin-ubuntu-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.tar.gz 654 655- name : ccache-clear 656uses : ./.github/actions/ccache-clear 657with : 658key : release-ubuntu-24.04-openvino-release-no-preset-v1 659 660windows-openvino : 661needs : [ check-release , ui-build ] 662if : ${{ needs.check-release.outputs.should_release == 'true' }} 663 664runs-on : windows-2022 665 666outputs : 667openvino_version : ${{ steps.openvino_version.outputs.value }} 668 669env : 670# Sync versions in build-openvino.yml, build-self-hosted.yml, release.yml, build-cache.yml, .devops/openvino.Dockerfile 671OPENVINO_VERSION_MAJOR : "2026.3.1" 672OPENVINO_VERSION_FULL : "2026.3.1.22476.56d9685302d" 673 674steps : 675- name : Set OpenVINO version output 676id : openvino_version 677shell : bash 678run : echo "value=${{ env.OPENVINO_VERSION_MAJOR }}" >> $GITHUB_OUTPUT 679 680- name : Clone 681id : checkout 682uses : actions/checkout@v6 683with : 684fetch-depth : 0 685 686- name : Download UI build 687uses : actions/download-artifact@v7 688with : 689name : llama-ui.zip 690path : tools/ui/dist 691 692- name : ccache 693uses : ggml-org/ccache-action@v1.2.24 694with : 695key : release-windows-2022-openvino 696variant : ccache 697evict-old-files : 1d 698 699- name : Setup Cache 700uses : actions/cache@v5 701id : cache-openvino 702with : 703path : ./openvino_toolkit 704key : cache-gha-openvino-toolkit-v${{ env.OPENVINO_VERSION_FULL }}-${{ runner.os }} 705 706- name : Setup OpenVINO Toolkit 707if : steps.cache-openvino.outputs.cache-hit != 'true' 708uses : ./.github/actions/windows-setup-openvino 709with : 710path : ./openvino_toolkit 711version_major : ${{ env.OPENVINO_VERSION_MAJOR }} 712version_full : ${{ env.OPENVINO_VERSION_FULL }} 713 714- name : Install OpenCL using vcpkg 715shell : powershell 716run : | 717git clone https://github.com/microsoft/vcpkg C:\vcpkg 718C:\vcpkg\bootstrap-vcpkg.bat 719C:\vcpkg\vcpkg install opencl 720 721- name : Build 722id : cmake_build 723shell : cmd 724run : | 725REM Find extracted OpenVINO folder dynamically 726for /d %%i in (openvino_toolkit\*) do set OPENVINO_ROOT=%%i 727 728if not exist "%OPENVINO_ROOT%\runtime\cmake\OpenVINOConfig.cmake" ( 729echo ERROR: OpenVINOConfig.cmake not found 730exit /b 1 731) 732 733call "%OPENVINO_ROOT%\setupvars.bat" 734 735cmake -B build\ReleaseOV -G "Visual Studio 17 2022" ^ 736-A x64 ^ 737-DCMAKE_BUILD_TYPE=Release ^ 738-DGGML_OPENVINO=ON ^ 739-DLLAMA_BUILD_BORINGSSL=ON ^ 740-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ^ 741${{ env.CMAKE_ARGS }} 742 743cmake --build build\ReleaseOV --config Release -- /m 744 745- name : Determine tag name 746id : tag 747uses : ./.github/actions/get-tag-name 748 749- name : Pack artifacts 750id : pack_artifacts 751shell : powershell 752run : | 753# Locate the extracted OpenVINO toolkit root (same pattern as the Build step). 754$OPENVINO_ROOT = (Get-ChildItem -Directory openvino_toolkit | Select-Object -First 1).FullName 755if (-not $OPENVINO_ROOT) { 756Write-Error "OpenVINO toolkit folder not found under .\openvino_toolkit" 757exit 1 758} 759 760$dest = ".\build\ReleaseOV\bin\Release" 761 762$ovBin = Join-Path $OPENVINO_ROOT 'runtime\bin\intel64\Release' 763Copy-Item -Path (Join-Path $ovBin '*.dll') -Destination $dest -Force 764Copy-Item -Path (Join-Path $ovBin 'cache.json') -Destination $dest -Force 765 766$tbbBin = Join-Path $OPENVINO_ROOT 'runtime\3rdparty\tbb\bin' 767Copy-Item -Path (Join-Path $tbbBin 'tbb*.dll') -Destination $dest -Force 768 769# OpenVINO licensing 770$licensingDest = Join-Path $dest 'openvino-licensing' 771New-Item -ItemType Directory -Force -Path $licensingDest | Out-Null 772Copy-Item -Path (Join-Path $OPENVINO_ROOT 'docs\licensing\*') -Destination $licensingDest -Recurse -Force 773 774Copy-Item LICENSE $dest 7757z a -snl llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip $dest\* 776 777- name : Upload artifacts 778uses : actions/upload-artifact@v6 779with : 780path : llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip 781name : llama-bin-win-openvino-${{ env.OPENVINO_VERSION_MAJOR }}-x64.zip 782 783- name : ccache-clear 784uses : ./.github/actions/ccache-clear 785with : 786key : release-windows-2022-openvino 787 788windows-cpu : 789name : windows-cpu / ${{ matrix.arch }} 790needs : [ check-release , ui-build ] 791if : ${{ needs.check-release.outputs.should_release == 'true' }} 792 793runs-on : windows-2025-vs2026 794 795permissions : 796actions : write 797 798strategy : 799matrix : 800include : 801- arch : 'x64' 802- arch : 'arm64' 803 804steps : 805- name : Clone 806uses : actions/checkout@v6 807with : 808fetch-depth : 0 809 810- name : Download UI build 811uses : actions/download-artifact@v7 812with : 813name : llama-ui.zip 814path : tools/ui/dist 815 816- name : Install Ninja 817run : | 818choco install ninja 819 820- name : ccache 821uses : ggml-org/ccache-action@v1.2.24 822with : 823key : release-windows-2025-vs2026-${{ matrix.arch }}-cpu 824 825- name : Build 826shell : cmd 827run : | 828call "C:\Program Files\Microsoft Visual Studio\18\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch == 'x64' && 'x64' || 'amd64_arm64' }} 829cmake -S . -B build -G "Ninja Multi-Config" ^ 830-D CMAKE_TOOLCHAIN_FILE=cmake/${{ matrix.arch }}-windows-llvm.cmake ^ 831-DLLAMA_BUILD_BORINGSSL=ON ^ 832-DGGML_NATIVE=OFF ^ 833-DGGML_BACKEND_DL=ON ^ 834-DGGML_CPU_ALL_VARIANTS=${{ matrix.arch == 'x64' && 'ON' || 'OFF' }} ^ 835-DGGML_OPENMP=ON ^ 836-DGGML_OPENMP_FETCH=ON ^ 837${{ env.CMAKE_ARGS }} 838cmake --build build --config Release 839 840- name : Pack artifacts 841id : pack_artifacts 842run : | 8437z a -snl llama-bin-win-cpu-${{ matrix.arch }}.zip .\build\bin\Release\* 844 845- name : Upload artifacts 846uses : actions/upload-artifact@v6 847with : 848path : llama-bin-win-cpu-${{ matrix.arch }}.zip 849name : llama-bin-win-cpu-${{ matrix.arch }}.zip 850 851- name : ccache-clear 852uses : ./.github/actions/ccache-clear 853with : 854key : release-windows-2025-vs2026-${{ matrix.arch }}-cpu 855 856# note: builds only the ggml-hip backend - llama-server is injected from the 857# windows-cpu zip during the release "Merge artifacts" step 858windows-rocm : 859needs : [ check-release ] 860if : ${{ needs.check-release.outputs.should_release == 'true' }} 861 862runs-on : windows-2022 863 864strategy : 865matrix : 866include : 867- ROCM_VERSION : "10.0.0" 868gpu_targets : "gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201" 869build : x64 870 871steps : 872- name : Clone 873id : checkout 874uses : actions/checkout@v6 875with : 876fetch-depth : 0 877 878- name : Install Ninja 879run : | 880choco install ninja 881 882- name : ccache 883uses : ggml-org/ccache-action@v1.2.24 884with : 885key : windows-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }} 886evict-old-files : 1d 887max-size : "1G" 888 889# - name: Cache ROCm Installation 890# id: cache-rocm 891# uses: actions/cache@v5 892# with: 893# path: C:\TheRock\build 894# key: rocm-wheels-${{ matrix.ROCM_VERSION }}-multi-arch-${{ runner.os }} 895 896- name : Setup ROCm 897# if: steps.cache-rocm.outputs.cache-hit != 'true' 898uses : ./.github/actions/windows-setup-rocm 899with : 900version : ${{ matrix.ROCM_VERSION }} 901 902- name : Setup ROCm Environment 903run : | 904$ErrorActionPreference = "Stop" 905 906# Activate venv from cache or fresh install 907& C:\TheRock\build\.venv\Scripts\Activate.ps1 908 909# Expand the devel tree (idempotent; no-op if already done during install) 910rocm-sdk init 911if ($LASTEXITCODE -ne 0) { throw "rocm-sdk init failed with exit code $LASTEXITCODE" } 912 913# Get ROCm installation paths using the rocm-sdk CLI tool 914$rocmPath = (rocm-sdk path --root) 915if (-not $rocmPath) { throw "rocm-sdk path --root returned empty - devel package may not be installed" } 916$rocmPath = $rocmPath.Trim() 917$cmakePath = (rocm-sdk path --cmake).Trim() 918$binPath = (rocm-sdk path --bin).Trim() 919write-host "ROCm root: $rocmPath" 920write-host "CMake path: $cmakePath" 921write-host "Bin path: $binPath" 922 923echo "HIP_PATH=$rocmPath" >> $env:GITHUB_ENV 924echo "CMAKE_PREFIX_PATH=$cmakePath" >> $env:GITHUB_ENV 925echo "HIP_DEVICE_LIB_PATH=$rocmPath\lib\llvm\amdgcn\bitcode" >> $env:GITHUB_ENV 926echo "HIP_PLATFORM=amd" >> $env:GITHUB_ENV 927echo "LLVM_PATH=$rocmPath\lib\llvm" >> $env:GITHUB_ENV 928echo "$binPath" >> $env:GITHUB_PATH 929 930# Keep venv in PATH for subsequent steps 931echo "C:\TheRock\build\.venv\Scripts" >> $env:GITHUB_PATH 932 933- name : Build 934run : | 935cmake -S . -B build ` 936-G "Ninja Multi-Config" ` 937-DCMAKE_PREFIX_PATH="${env:HIP_PATH}" ` 938-DGGML_BACKEND_DL=ON ` 939-DGGML_NATIVE=OFF ` 940-DGGML_CPU=OFF ` 941-DGGML_HIP=ON ` 942-DCMAKE_C_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang.exe" ` 943-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang++.exe" ` 944-DCMAKE_C_FLAGS="-Wno-error=incompatible-pointer-types" ` 945-DCMAKE_HIP_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang.exe" ` 946-DHIP_PATH="${env:HIP_PATH}" ` 947-DAMDGPU_TARGETS="${{ matrix.gpu_targets }}" 948cmake --build build --config Release --parallel ${env:NUMBER_OF_PROCESSORS} --target ggml-hip 949 950- name : Verify HIP backend was built 951run : | 952$hipDll = Get-ChildItem -Path build\bin\Release -Filter "ggml-hip*.dll" -ErrorAction SilentlyContinue 953if (-not $hipDll) { 954Write-Host "##[error]ggml-hip*.dll was NOT produced. The HIP backend silently failed to build." 955Write-Host "Contents of build\bin\Release:" 956Get-ChildItem build\bin\Release | Format-Table -AutoSize 957exit 1 958} 959Write-Host "HIP backend artifact found:" 960$hipDll | Format-Table FullName, Length -AutoSize 961 962- name : Determine tag name 963id : tag 964uses : ./.github/actions/get-tag-name 965 966- name : Get ROCm short version 967run : | 968$rocmVersionShort = ('${{ matrix.ROCM_VERSION }}'.Split('.')[0..1] -join '.') 969echo "ROCM_VERSION_SHORT=$rocmVersionShort" >> $env:GITHUB_ENV 970 971- name : Bundle HIP runtime DLLs (amdhip64_7.dll, rocm_kpack.dll, amd_comgr.dll) 972run : | 973$ErrorActionPreference = "Stop" 974# See issue https://github.com/ggml-org/llama.cpp/issues/26929. 975# ggml-hip.dll loads amdhip64_7.dll at run time. The Adrenalin driver 976# ships an amdhip64_7.dll in System32, which the loader searches before PATH, 977# so a matching DLL from PATH cannot win. Copy amdhip64 next to the 978# binaries (exe directory is searched before System32) so the correct 979# runtime is used. rocm_kpack.dll is amdhip64_7's direct dependency, so 980# copy the matching version too. amd_comgr is copied as well to keep it 981# in sync with the bundled amdhip64, avoiding a version mismatch with a 982# amd_comgr from System32. 983# rocblas/hipblaslt kernels resolve fine via PATH and are not copied. 984$binPath = (rocm-sdk path --bin).Trim() 985if (-not $binPath) { throw "rocm-sdk path --bin returned empty" } 986write-host "ROCm bin path: $binPath" 987 988$patterns = @("amdhip64_7.dll", "rocm_kpack.dll", "amd_comgr.dll") 989foreach ($pattern in $patterns) { 990$files = Get-ChildItem -Path $binPath -Filter $pattern -ErrorAction SilentlyContinue 991if (-not $files) { throw "no match for $pattern in $binPath" } 992foreach ($f in $files) { 993Copy-Item $f.FullName -Destination build\bin\Release -Force 994write-host " copied $($f.Name)" 995} 996} 997 998- name : Pack artifacts 999run : | 10007z a -snl llama-bin-win-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.zip ` 1001.\build\bin\Release\ggml-hip.dll ` 1002.\build\bin\Release\amdhip64_7.dll ` 1003.\build\bin\Release\rocm_kpack.dll ` 1004.\build\bin\Release\amd_comgr.dll 1005 1006- name : Upload artifacts 1007uses : actions/upload-artifact@v6 1008with : 1009path : llama-bin-win-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.zip 1010name : llama-bin-win-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.zip 1011 1012- name : ccache-clear 1013uses : ./.github/actions/ccache-clear 1014with : 1015key : windows-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }} 1016 1017# note: builds only the backend library - llama-server (with the embedded UI) 1018# is injected from the windows-cpu zip during the release "Merge artifacts" step 1019windows : 1020needs : [ check-release ] 1021if : ${{ needs.check-release.outputs.should_release == 'true' }} 1022 1023runs-on : windows-2025 1024 1025permissions : 1026actions : write 1027 1028env : 1029OPENBLAS_VERSION : 0.3.23 1030VULKAN_VERSION : 1.4.357.0 1031 1032strategy : 1033matrix : 1034include : 1035- backend : 'vulkan' 1036arch : 'x64' 1037defines : '-DGGML_VULKAN=ON' 1038target : 'ggml-vulkan' 1039- backend : 'opencl-adreno' 1040arch : 'arm64' 1041defines : '-G "Ninja Multi-Config" -D CMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-llvm.cmake -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" -DGGML_OPENCL=ON -DGGML_OPENCL_USE_ADRENO_KERNELS=ON' 1042target : 'ggml-opencl' 1043 1044steps : 1045- name : Clone 1046id : checkout 1047uses : actions/checkout@v6 1048 1049- name : Install Vulkan SDK 1050id : get_vulkan 1051if : ${{ matrix.backend == 'vulkan' }} 1052run : | 1053curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe" 1054& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install 1055Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\${env:VULKAN_VERSION}" 1056Add-Content $env:GITHUB_PATH "C:\VulkanSDK\${env:VULKAN_VERSION}\bin" 1057 1058- name : Install Ninja 1059id : install_ninja 1060run : | 1061choco install ninja 1062 1063# TODO: these jobs need to use llvm toolchain in order to utilize the ccache 1064#- name: ccache 1065# uses: ggml-org/ccache-action@v1.2.24 1066# with: 1067# key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }} 1068 1069- name : Install OpenCL Headers and Libs 1070id : install_opencl 1071if : ${{ matrix.backend == 'opencl-adreno' && matrix.arch == 'arm64' }} 1072run : | 1073git clone https://github.com/KhronosGroup/OpenCL-Headers 1074cd OpenCL-Headers 1075cmake -B build ` 1076-DBUILD_TESTING=OFF ` 1077-DOPENCL_HEADERS_BUILD_TESTING=OFF ` 1078-DOPENCL_HEADERS_BUILD_CXX_TESTS=OFF ` 1079-DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release" 1080cmake --build build --target install 1081git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader 1082cd OpenCL-ICD-Loader 1083cmake -B build-arm64-release ` 1084-A arm64 ` 1085-DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/opencl-arm64-release" ` 1086-DCMAKE_INSTALL_PREFIX="$env:RUNNER_TEMP/opencl-arm64-release" 1087cmake --build build-arm64-release --target install --config release 1088 1089- name : Build 1090id : cmake_build 1091run : | 1092cmake -S . -B build ${{ matrix.defines }} -DGGML_NATIVE=OFF -DGGML_CPU=OFF -DGGML_BACKEND_DL=ON -DLLAMA_BUILD_BORINGSSL=ON 1093cmake --build build --config Release --target ${{ matrix.target }} 1094 1095#- name: ccache-clear 1096# uses: ./.github/actions/ccache-clear 1097# with: 1098# key: release-windows-2025-${{ matrix.arch }}-${{ matrix.backend }} 1099 1100- name : Pack artifacts 1101id : pack_artifacts 1102run : | 11037z a -snl llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip .\build\bin\Release\${{ matrix.target }}.dll 1104 1105- name : Upload artifacts 1106uses : actions/upload-artifact@v6 1107with : 1108path : llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip 1109name : llama-bin-win-${{ matrix.backend }}-${{ matrix.arch }}.zip 1110 1111# note: builds only the ggml-cuda backend - llama-server is injected from the 1112# windows-cpu zip during the release "Merge artifacts" step 1113windows-cuda : 1114name : windows-cuda (${{ matrix.cuda }}, ${{ matrix.arch }}) 1115needs : [ check-release ] 1116if : ${{ needs.check-release.outputs.should_release == 'true' }} 1117 1118runs-on : windows-2022 1119 1120permissions : 1121actions : write 1122 1123strategy : 1124matrix : 1125include : 1126- cuda : '12.4' 1127arch : x64 1128defines : '-DGGML_CUDA_CUB_3DOT2=ON' 1129- cuda : '13.3' 1130arch : x64 1131defines : '' 1132- cuda : '13.4' 1133arch : arm64 1134defines : '-DCMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc-cuda.cmake' 1135 1136steps : 1137- name : Clone 1138id : checkout 1139uses : actions/checkout@v6 1140 1141- name : Install Cuda Toolkit 1142uses : ./.github/actions/windows-setup-cuda 1143with : 1144cuda_version : ${{ matrix.cuda }} 1145cuda_arch : ${{ matrix.arch }} 1146 1147- name : Install Ninja 1148id : install_ninja 1149run : | 1150choco install ninja 1151 1152- name : ccache 1153uses : ggml-org/ccache-action@v1.2.24 1154with : 1155key : release-windows-2022-${{ matrix.arch }}-cuda-${{ matrix.cuda }} 1156 1157- name : Build 1158id : cmake_build 1159shell : cmd 1160# TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project 1161run : | 1162call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch == 'x64' && 'x64' || 'amd64_arm64' }} 1163cmake -S . -B build -G "Ninja Multi-Config" ^ 1164-DGGML_BACKEND_DL=ON ^ 1165-DGGML_NATIVE=OFF ^ 1166-DGGML_CPU=OFF ^ 1167-DGGML_CUDA=ON ^ 1168-DLLAMA_BUILD_BORINGSSL=ON ${{ matrix.defines }} 1169set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1 1170cmake --build build --config Release -j %NINJA_JOBS% --target ggml-cuda 1171 1172- name : Pack artifacts 1173id : pack_artifacts 1174run : | 11757z a -snl llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip .\build\bin\Release\ggml-cuda.dll 1176 1177- name : Upload artifacts 1178uses : actions/upload-artifact@v6 1179with : 1180path : llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip 1181name : llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip 1182 1183- name : Copy and pack Cuda runtime (x64) 1184if : ${{ matrix.arch == 'x64' }} 1185run : | 1186echo "Cuda install location: ${{ env.CUDA_PATH }}" 1187$dst='.\build\bin\cudart\' 1188robocopy "${{env.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll 1189robocopy "${{env.CUDA_PATH}}\lib" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll 1190robocopy "${{env.CUDA_PATH}}\bin\x64" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll 11917z a cudart-llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip $dst\* 1192 1193- name : Copy and pack Cuda runtime (ARM64) 1194if : ${{ matrix.arch == 'arm64' }} 1195run : | 1196echo "Cuda install location: ${{ env.CUDA_PATH }}" 1197$dst='.\build\bin\cudart\' 1198robocopy "${{env.CUDA_PATH}}\bin\arm64" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll 11997z a cudart-llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip $dst\* 1200 1201- name : Upload Cuda runtime 1202uses : actions/upload-artifact@v6 1203with : 1204path : cudart-llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip 1205name : cudart-llama-bin-win-cuda-${{ matrix.cuda }}-${{ matrix.arch }}.zip 1206 1207- name : ccache-clear 1208uses : ./.github/actions/ccache-clear 1209with : 1210key : release-windows-2022-${{ matrix.arch }}-cuda-${{ matrix.cuda }} 1211 1212# note: builds only the ggml-sycl backend - llama-server is injected from the 1213# windows-cpu zip during the release "Merge artifacts" step 1214windows-sycl : 1215needs : [ check-release ] 1216if : ${{ needs.check-release.outputs.should_release == 'true' }} 1217 1218runs-on : windows-2022 1219 1220defaults : 1221run : 1222shell : bash 1223 1224env : 1225WINDOWS_BASEKIT_URL : https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b60765d1-2b85-4e85-86b6-cb0e9563a699/intel-deep-learning-essentials-2025.3.3.18_offline.exe 1226WINDOWS_DPCPP_MKL : intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel 1227LEVEL_ZERO_SDK_URL : https://github.com/oneapi-src/level-zero/releases/download/v1.28.2/level-zero-win-sdk-1.28.2.zip 1228ONEAPI_ROOT : "C:/Program Files (x86)/Intel/oneAPI" 1229ONEAPI_INSTALLER_VERSION : "2025.3.3" 1230 1231steps : 1232- name : Clone 1233id : checkout 1234uses : actions/checkout@v6 1235 1236- name : Download & Install oneAPI 1237shell : bash 1238run : | 1239scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL 1240 1241- name : Install Level Zero SDK 1242shell : pwsh 1243run : | 1244Invoke-WebRequest -Uri "${{ env.LEVEL_ZERO_SDK_URL }}" -OutFile "level-zero-win-sdk.zip" 1245Expand-Archive -Path "level-zero-win-sdk.zip" -DestinationPath "C:/level-zero-sdk" -Force 1246"LEVEL_ZERO_V1_SDK_PATH=C:/level-zero-sdk" | Out-File -FilePath $env:GITHUB_ENV -Append 1247 1248- name : ccache 1249uses : ggml-org/ccache-action@v1.2.24 1250with : 1251key : release-windows-2022-x64-sycl 1252 1253- name : Build 1254id : cmake_build 1255shell : cmd 1256run : | 1257call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 --force 1258cmake -G "Ninja" -B build ^ 1259-DCMAKE_C_COMPILER=cl -DCMAKE_CXX_COMPILER=icx ^ 1260-DCMAKE_BUILD_TYPE=Release ^ 1261-DGGML_BACKEND_DL=ON -DBUILD_SHARED_LIBS=ON ^ 1262-DGGML_CPU=OFF -DGGML_SYCL=ON ^ 1263-DLLAMA_BUILD_BORINGSSL=ON 1264cmake --build build --target ggml-sycl -j %NUMBER_OF_PROCESSORS% 1265 1266- name : Build the release package 1267id : pack_artifacts 1268run : | 1269echo "cp oneAPI running time dll files in ${{ env.ONEAPI_ROOT }} to ./build/bin" 1270 1271cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_sycl_blas.5.dll" ./build/bin 1272cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_core.2.dll" ./build/bin 1273cp "${{ env.ONEAPI_ROOT }}/mkl/latest/bin/mkl_tbb_thread.2.dll" ./build/bin 1274 1275cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero.dll" ./build/bin 1276cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_level_zero_v2.dll" ./build/bin 1277cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_adapter_opencl.dll" ./build/bin 1278cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_loader.dll" ./build/bin 1279cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/ur_win_proxy_loader.dll" ./build/bin 1280ZE_LOADER_DLL=$(find "${{ env.ONEAPI_ROOT }}" "$LEVEL_ZERO_V1_SDK_PATH" -iname ze_loader.dll -print -quit 2>/dev/null || true) 1281if [ -n "$ZE_LOADER_DLL" ]; then 1282echo "Using Level Zero loader: $ZE_LOADER_DLL" 1283cp "$ZE_LOADER_DLL" ./build/bin 1284else 1285echo "Level Zero loader DLL not found in oneAPI or SDK; relying on system driver/runtime" 1286fi 1287 1288cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl8.dll" ./build/bin 1289cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/svml_dispmd.dll" ./build/bin 1290cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libmmd.dll" ./build/bin 1291cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libiomp5md.dll" ./build/bin 1292cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/sycl-ls.exe" ./build/bin 1293cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libsycl-fallback-bfloat16.spv" ./build/bin 1294cp "${{ env.ONEAPI_ROOT }}/compiler/latest/bin/libsycl-native-bfloat16.spv" ./build/bin 1295 1296cp "${{ env.ONEAPI_ROOT }}/dnnl/latest/bin/dnnl.dll" ./build/bin 1297cp "${{ env.ONEAPI_ROOT }}/tbb/latest/bin/tbb12.dll" ./build/bin 1298 1299cp "${{ env.ONEAPI_ROOT }}/tcm/latest/bin/tcm.dll" ./build/bin 1300cp "${{ env.ONEAPI_ROOT }}/tcm/latest/bin/libhwloc-15.dll" ./build/bin 1301cp "${{ env.ONEAPI_ROOT }}/umf/latest/bin/umf.dll" ./build/bin 1302 1303echo "cp oneAPI running time dll files to ./build/bin done" 13047z a -snl llama-bin-win-sycl-x64.zip ./build/bin/* 1305 1306- name : Upload the release package 1307uses : actions/upload-artifact@v6 1308with : 1309path : llama-bin-win-sycl-x64.zip 1310name : llama-bin-win-sycl-x64.zip 1311 1312- name : ccache-clear 1313uses : ./.github/actions/ccache-clear 1314with : 1315key : release-windows-2022-x64-sycl 1316 1317ubuntu-24-sycl : 1318needs : [ check-release , ui-build ] 1319if : ${{ needs.check-release.outputs.should_release == 'true' }} 1320 1321strategy : 1322matrix : 1323build : [ fp32 , fp16 ] 1324include : 1325- build : fp32 1326fp16 : OFF 1327- build : fp16 1328fp16 : ON 1329 1330runs-on : ubuntu-24.04 1331 1332env : 1333ONEAPI_ROOT : /opt/intel/oneapi/ 1334ONEAPI_INSTALLER_VERSION : "2025.3.3" 1335LEVEL_ZERO_VERSION : "1.28.2" 1336LEVEL_ZERO_UBUNTU_VERSION : "u24.04" 1337 1338steps : 1339- name : Clone 1340id : checkout 1341uses : actions/checkout@v6 1342with : 1343fetch-depth : 0 1344 1345- name : Download & Install oneAPI 1346shell : bash 1347run : | 1348cd /tmp 1349wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/56f7923a-adb8-43f3-8b02-2b60fcac8cab/intel-deep-learning-essentials-2025.3.3.16_offline.sh -O intel-deep-learning-essentials_offline.sh 1350sudo bash intel-deep-learning-essentials_offline.sh -s -a --silent --eula accept 1351 1352- name : Install Level Zero SDK 1353shell : bash 1354run : | 1355cd /tmp 1356wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/level-zero_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O level-zero.deb 1357wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/level-zero-devel_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O level-zero-devel.deb 1358sudo apt-get install -y ./level-zero.deb ./level-zero-devel.deb 1359 1360- name : Download UI build 1361uses : actions/download-artifact@v7 1362with : 1363name : llama-ui.zip 1364path : tools/ui/dist 1365 1366- name : ccache 1367uses : ggml-org/ccache-action@v1.2.24 1368with : 1369key : release-ubuntu-24.04-sycl-${{ matrix.build }} 1370 1371- name : Build 1372id : cmake_build 1373run : | 1374source /opt/intel/oneapi/setvars.sh 1375cmake -B build \ 1376-G "Ninja" \ 1377-DCMAKE_BUILD_TYPE=Release \ 1378-DGGML_SYCL=ON \ 1379-DCMAKE_C_COMPILER=icx \ 1380-DCMAKE_CXX_COMPILER=icpx \ 1381-DCMAKE_INSTALL_RPATH='$ORIGIN' \ 1382-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 1383-DLLAMA_OPENSSL=OFF \ 1384-DGGML_NATIVE=OFF \ 1385-DGGML_SYCL_F16=${{ matrix.fp16 }} 1386time cmake --build build --config Release -j $(nproc) 1387 1388- name : Determine tag name 1389id : tag 1390uses : ./.github/actions/get-tag-name 1391 1392- name : Pack artifacts 1393id : pack_artifacts 1394run : | 1395cp LICENSE ./build/bin/ 1396tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . 1397 1398- name : Upload artifacts 1399uses : actions/upload-artifact@v6 1400with : 1401path : llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz 1402name : llama-bin-ubuntu-sycl-${{ matrix.build }}-x64.tar.gz 1403 1404- name : ccache-clear 1405uses : ./.github/actions/ccache-clear 1406with : 1407key : release-ubuntu-24.04-sycl-${{ matrix.build }} 1408 1409ubuntu-24-rocm : 1410needs : [ check-release , ui-build ] 1411if : ${{ needs.check-release.outputs.should_release == 'true' }} 1412 1413runs-on : ubuntu-24.04 1414 1415permissions : 1416actions : write 1417 1418strategy : 1419matrix : 1420include : 1421- ROCM_VERSION : "10.0.0" 1422gpu_targets : "gfx908;gfx90a;gfx942;gfx950;gfx1010;gfx1011;gfx1012;gfx1030;gfx1031;gfx1032;gfx1033;gfx1034;gfx1035;gfx1036;gfx1100;gfx1101;gfx1102;gfx1103;gfx1150;gfx1151;gfx1152;gfx1200;gfx1201" 1423build : 'x64' 1424 1425steps : 1426- name : Clone 1427id : checkout 1428uses : actions/checkout@v6 1429with : 1430fetch-depth : 0 1431 1432- name : Download UI build 1433uses : actions/download-artifact@v7 1434with : 1435name : llama-ui.zip 1436path : tools/ui/dist 1437 1438- name : Free up disk space 1439uses : ggml-org/free-disk-space@v1.3.1 1440with : 1441tool-cache : true 1442 1443- name : ccache 1444uses : ggml-org/ccache-action@v1.2.24 1445with : 1446key : release-ubuntu-24.04-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }} 1447evict-old-files : 1d 1448max-size : "1G" 1449 1450- name : Tune ccache for reinstalled ROCm toolchain 1451run : | 1452# ROCm is pip-installed fresh each run, so the clang binary's mtime 1453# changes every time. With the default compiler_check=mtime that 1454# invalidates the cache; hash compiler contents instead so warm 1455# builds hit. 1456ccache --set-config=compiler_check=content 1457ccache --set-config=sloppiness=time_macros,include_file_mtime,include_file_ctime 1458 1459- name : Dependencies 1460id : depends 1461run : | 1462sudo apt install -y build-essential git cmake wget 1463 1464- name : Setup TheRock with Wheels 1465id : therock_env 1466run : | 1467# Create Python virtual environment 1468python3 -m venv .venv 1469source .venv/bin/activate 1470 1471# Install ROCm wheels for build 1472# libraries = HIP runtime and CMake configs needed for linking 1473# devel = compilers, headers, static libs 1474python -m pip install --upgrade pip 1475python -m pip install --index-url https://stable.repo.amd.com/rocm/whl-next/ "rocm[libraries,devel]==${{ matrix.ROCM_VERSION }}" 1476 1477# Get ROCm installation paths using the rocm-sdk CLI tool 1478ROCM_PATH=$(rocm-sdk path --root) 1479CMAKE_PATH=$(rocm-sdk path --cmake) 1480BIN_PATH=$(rocm-sdk path --bin) 1481echo "ROCM_PATH=$ROCM_PATH" 1482echo "CMAKE_PATH=$CMAKE_PATH" 1483echo "BIN_PATH=$BIN_PATH" 1484 1485# Set environment variables 1486echo "ROCM_PATH=$ROCM_PATH" >> $GITHUB_ENV 1487echo "CMAKE_PREFIX_PATH=$CMAKE_PATH" >> $GITHUB_ENV 1488echo "HIP_PATH=$ROCM_PATH" >> $GITHUB_ENV 1489echo "PATH=$BIN_PATH:${PATH}" >> $GITHUB_ENV 1490echo "LD_LIBRARY_PATH=$ROCM_PATH/lib:${LD_LIBRARY_PATH:-}" >> $GITHUB_ENV 1491 1492# Keep venv activated for subsequent steps 1493echo "$(pwd)/.venv/bin" >> $GITHUB_PATH 1494 1495- name : Build with native CMake HIP support 1496id : cmake_build 1497run : | 1498cmake -B build -S . \ 1499-DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \ 1500-DCMAKE_BUILD_TYPE=Release \ 1501-DGGML_BACKEND_DL=ON \ 1502-DGGML_NATIVE=OFF \ 1503-DCMAKE_INSTALL_RPATH='$ORIGIN' \ 1504-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \ 1505-DGGML_CPU_ALL_VARIANTS=ON \ 1506-DGPU_TARGETS="${{ matrix.gpu_targets }}" \ 1507-DGGML_HIP=ON \ 1508-DHIP_PLATFORM=amd \ 1509${{ env.CMAKE_ARGS }} 1510cmake --build build --config Release -j $(nproc) 1511 1512- name : Determine tag name 1513id : tag 1514uses : ./.github/actions/get-tag-name 1515 1516- name : Get ROCm short version 1517run : echo "ROCM_VERSION_SHORT=$(echo '${{ matrix.ROCM_VERSION }}' | cut -d '.' -f 1,2)" >> $GITHUB_ENV 1518 1519- name : Pack artifacts 1520id : pack_artifacts 1521run : | 1522cp LICENSE ./build/bin/ 1523tar -czvf llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . 1524 1525- name : Upload artifacts 1526uses : actions/upload-artifact@v6 1527with : 1528path : llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz 1529name : llama-bin-ubuntu-rocm-${{ env.ROCM_VERSION_SHORT }}-${{ matrix.build }}.tar.gz 1530 1531- name : ccache-clear 1532uses : ./.github/actions/ccache-clear 1533with : 1534key : release-ubuntu-24.04-rocm-${{ matrix.ROCM_VERSION }}-${{ matrix.build }} 1535 1536ios-xcode : 1537needs : [ check-release ] 1538if : ${{ needs.check-release.outputs.should_release == 'true' }} 1539runs-on : macos-26 1540 1541steps : 1542- name : Checkout code 1543uses : actions/checkout@v6 1544with : 1545fetch-depth : 0 1546 1547- name : Setup Xcode 1548run : | 1549sudo xcode-select -s /Applications/Xcode_26.4.app 1550 1551- name : Build 1552id : cmake_build 1553run : | 1554sysctl -a 1555cmake -B build -G Xcode \ 1556-DGGML_METAL_EMBED_LIBRARY=ON \ 1557-DLLAMA_OPENSSL=OFF \ 1558-DLLAMA_BUILD_APP=OFF \ 1559-DLLAMA_BUILD_EXAMPLES=OFF \ 1560-DLLAMA_BUILD_TOOLS=OFF \ 1561-DLLAMA_BUILD_TESTS=OFF \ 1562-DLLAMA_BUILD_SERVER=OFF \ 1563-DCMAKE_SYSTEM_NAME=iOS \ 1564-DCMAKE_OSX_DEPLOYMENT_TARGET=16.0 \ 1565-DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml 1566cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO 1567 1568- name : xcodebuild for swift package 1569id : xcodebuild 1570run : | 1571# note: only macos and ios-device due to long build time 1572# ref: https://github.com/ggml-org/llama.cpp/pull/27252 1573./build-xcframework.sh macos ios-device 1574 1575- name : Build Xcode project 1576run : xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' FRAMEWORK_FOLDER_PATH=./build-ios build 1577 1578- name : Determine tag name 1579id : tag 1580uses : ./.github/actions/get-tag-name 1581 1582- name : Pack artifacts 1583id : pack_artifacts 1584run : | 1585# Zip file is required for Swift Package Manager, which does not support tar.gz for binary targets. 1586# For more details, see https://developer.apple.com/documentation/xcode/distributing-binary-frameworks-as-swift-packages 1587zip -r -y llama-${{ steps.tag.outputs.name }}-xcframework.zip build-apple/llama.xcframework 1588 1589- name : Upload artifacts 1590uses : actions/upload-artifact@v6 1591with : 1592path : llama-${{ steps.tag.outputs.name }}-xcframework.zip 1593name : llama-${{ steps.tag.outputs.name }}-xcframework.zip 1594 1595# TODO: this build is disabled to save Github Actions resources (https://github.com/ggml-org/llama.cpp/pull/23705) 1596# in order to enable it again, we have to provision dedicated runners to run it 1597# openEuler-cann: 1598# strategy: 1599# matrix: 1600# include: 1601# # 910b with aclgraph (both architectures) 1602# - arch: x86 1603# chip_type: '910b' 1604# build: 'Release' 1605# use_acl_graph: 'on' 1606# - arch: aarch64 1607# chip_type: '910b' 1608# build: 'Release' 1609# use_acl_graph: 'on' 1610# # 310p without aclgraph (both architectures) 1611# - arch: x86 1612# chip_type: '310p' 1613# build: 'Release' 1614# use_acl_graph: 'off' 1615# - arch: aarch64 1616# chip_type: '310p' 1617# build: 'Release' 1618# use_acl_graph: 'off' 1619# runs-on: ${{ matrix.arch == 'aarch64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} 1620# steps: 1621# - name: Checkout 1622# uses: actions/checkout@v6 1623# with: 1624# fetch-depth: 0 1625# 1626# - name: Free up disk space 1627# uses: ggml-org/free-disk-space@v1.3.1 1628# with: 1629# tool-cache: true 1630# 1631# - name: Set container image 1632# id: cann-image 1633# run: | 1634# image="ascendai/cann:${{ matrix.chip_type == '910b' && '8.5.0-910b-openeuler24.03-py3.11' || '8.5.0-310p-openeuler24.03-py3.11' }}" 1635# echo "image=${image}" >> "${GITHUB_OUTPUT}" 1636# 1637# - name: Pull container image 1638# run: docker pull "${{ steps.cann-image.outputs.image }}" 1639# 1640# - name: Build 1641# env: 1642# BUILD_TYPE: ${{ matrix.build }} 1643# SOC_TYPE: ascend${{ matrix.chip_type }} 1644# USE_ACL_GRAPH: ${{ matrix.use_acl_graph }} 1645# run: | 1646# HOST_UID=$(id -u) 1647# HOST_GID=$(id -g) 1648# 1649# docker run --rm \ 1650# -v "${PWD}:/workspace" \ 1651# -w /workspace \ 1652# -e SOC_TYPE=${SOC_TYPE} \ 1653# -e BUILD_TYPE=${BUILD_TYPE} \ 1654# -e USE_ACL_GRAPH=${USE_ACL_GRAPH} \ 1655# "${{ steps.cann-image.outputs.image }}" \ 1656# bash -lc ' 1657# set -e 1658# yum install -y --setopt=install_weak_deps=False --setopt=tsflags=nodocs git gcc gcc-c++ make cmake openssl-devel 1659# yum clean all && rm -rf /var/cache/yum 1660# git config --global --add safe.directory "/workspace" 1661# export LD_LIBRARY_PATH=${ASCEND_TOOLKIT_HOME}/lib64:${ASCEND_TOOLKIT_HOME}/$(uname -m)-linux/devlib/:${LD_LIBRARY_PATH} 1662# cmake -S . -B build \ 1663# -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ 1664# -DGGML_CANN=on \ 1665# -DSOC_TYPE=${SOC_TYPE} \ 1666# -DUSE_ACL_GRAPH=${USE_ACL_GRAPH} 1667# cmake --build build -j $(nproc) 1668# 1669# chown -R '"${HOST_UID}"':'"${HOST_GID}"' /workspace/build 1670# ' 1671# 1672# - name: Determine tag name 1673# id: tag 1674# uses: ./.github/actions/get-tag-name 1675# 1676# - name: Pack artifacts 1677# run: | 1678# cp LICENSE ./build/bin/ 1679# tar -czvf llama-${{ steps.tag.outputs.name }}-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./build/bin . 1680# 1681# - name: Upload artifacts 1682# uses: actions/upload-artifact@v6 1683# with: 1684# path: llama-${{ steps.tag.outputs.name }}-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz 1685# name: llama-bin-${{ matrix.chip_type }}-openEuler-${{ matrix.arch }}${{ matrix.use_acl_graph == 'on' && '-aclgraph' || '' }}.tar.gz 1686 1687ui-build : 1688needs : [ check-release ] 1689if : ${{ needs.check-release.outputs.should_release == 'true' }} 1690uses : ./.github/workflows/ui-build.yml 1691 1692release : 1693if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} 1694 1695# Fine-grant permission 1696# https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token 1697permissions : 1698contents : write # for creating release 1699id-token : write 1700attestations : write 1701 1702runs-on : ubuntu-slim 1703 1704needs : 1705- windows 1706- windows-cpu 1707- windows-cuda 1708- windows-sycl 1709- windows-rocm 1710- windows-openvino 1711- ubuntu-24-rocm 1712- ubuntu-cpu 1713- ubuntu-vulkan 1714- ubuntu-cuda 1715- ubuntu-24-openvino 1716- ubuntu-24-sycl 1717- android-arm64 1718- macos-cpu 1719- ios-xcode 1720#- openEuler-cann 1721- ui-build 1722 1723outputs : 1724tag_name : ${{ steps.tag.outputs.name }} 1725 1726steps : 1727- name : Clone 1728id : checkout 1729uses : actions/checkout@v6 1730with : 1731fetch-depth : 0 1732ssh-key : ${{ secrets.DEPLOY_KEY_RELEASE }} 1733 1734- name : Determine tag name 1735id : tag 1736uses : ./.github/actions/get-tag-name 1737 1738- name : Download artifacts 1739id : download-artifact 1740uses : actions/download-artifact@v7 1741with : 1742path : ./artifact 1743merge-multiple : true 1744 1745- name : Merge artifacts 1746id : move_artifacts 1747run : | 1748mkdir -p release 1749 1750# the windows-cpu zip contains the full toolset (llama-server with the embedded 1751# UI, ggml-cpu) - inject it into the other windows zips so that every archive 1752# ships the same binaries, only with a different backend library on top 1753echo "Injecting windows-cpu binaries (llama-server + CPU backend) into the backend zips..." 1754for arch in x64 arm64; do 1755cpu_zip="artifact/llama-bin-win-cpu-${arch}.zip" 1756temp_dir=$(mktemp -d) 1757echo "Extracting windows-cpu-${arch} package..." 1758unzip "$cpu_zip" -d "$temp_dir" 1759 1760echo "Merging into $arch zips..." 1761for target_zip in artifact/llama-bin-win-*-${arch}.zip; do 1762if [[ "$target_zip" == "$cpu_zip" ]]; then 1763continue 1764fi 1765echo "Injecting into $(basename "$target_zip")" 1766realpath_target_zip=$(realpath "$target_zip") 1767(cd "$temp_dir" && zip -r "$realpath_target_zip" .) 1768done 1769 1770rm -rf "$temp_dir" 1771done 1772 1773echo "Renaming and moving zips to release..." 1774for zip_file in artifact/llama-bin-win-*.zip; do 1775base_name=$(basename "$zip_file" .zip) 1776zip_name="llama-${{ steps.tag.outputs.name }}-${base_name#llama-}.zip" 1777echo "Moving $zip_file to release/$zip_name" 1778mv "$zip_file" "release/$zip_name" 1779done 1780 1781echo "Moving other artifacts..." 1782mv -v artifact/*.zip release 1783mv -v artifact/*.tar.gz release 1784 1785- name : Download UI build 1786id : download_ui 1787uses : actions/download-artifact@v7 1788with : 1789name : llama-ui.zip 1790path : ./ui-dist 1791 1792- name : Package UI 1793id : package_ui 1794run : | 1795tar -czvf release/llama-${{ steps.tag.outputs.name }}-ui.tar.gz --transform "s,^\.,llama-${{ steps.tag.outputs.name }}," -C ./ui-dist . 1796 1797- name : Attest release artifacts 1798id : attest 1799uses : actions/attest@v4 1800with : 1801subject-path : 'release/*' 1802 1803- name : Create and push git tag 1804run : | 1805TAG="${{ steps.tag.outputs.name }}" 1806if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null 2>&1; then 1807echo "Tag ${TAG} already exists, skipping creation" 1808else 1809git tag "${TAG}" 1810git push origin "${TAG}" 1811fi 1812 1813- name : Create release 1814id : create_release 1815uses : ggml-org/action-create-release@v1 1816env : 1817GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} 1818with : 1819tag_name : ${{ steps.tag.outputs.name }} 1820prerelease : true 1821body : | 1822<details open> 1823 1824${{ github.event.head_commit.message }} 1825 1826</details> 1827 1828**Website:** 1829- <https://llama.app> 1830 1831**Attestations:** 1832- <${{ steps.attest.outputs.attestation-url }}> 1833 1834**macOS/iOS:** 1835- [macOS Apple Silicon (arm64)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-macos-arm64.tar.gz) 1836- macOS Apple Silicon (arm64, KleidiAI enabled) [DISABLED](https://github.com/ggml-org/llama.cpp/pull/23780) 1837- [macOS Intel (x64)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-macos-x64.tar.gz) 1838- [iOS XCFramework](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-xcframework.zip) 1839 1840**Linux:** 1841- [Ubuntu x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-x64.tar.gz) 1842- [Ubuntu arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-arm64.tar.gz) 1843- [Ubuntu s390x (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-s390x.tar.gz) 1844- [Ubuntu x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-x64.tar.gz) 1845- [Ubuntu arm64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-vulkan-arm64.tar.gz) 1846- [Ubuntu x64 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-12.8-x64.tar.gz) - [CUDA 12.8 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-12.8-x64.tar.gz) 1847- [Ubuntu x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.3-x64.tar.gz) - [CUDA 13.3 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.3-x64.tar.gz) 1848- [Ubuntu arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.3-arm64.tar.gz) - [CUDA 13.3 libraries](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-${{ steps.tag.outputs.name }}-bin-ubuntu-cuda-13.3-arm64.tar.gz) 1849- [Ubuntu x64 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-rocm-10.0-x64.tar.gz) 1850- [Ubuntu x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-openvino-${{ needs.ubuntu-24-openvino.outputs.openvino_version }}-x64.tar.gz) 1851- [Ubuntu x64 (SYCL FP32)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-fp32-x64.tar.gz) 1852- [Ubuntu x64 (SYCL FP16)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-ubuntu-sycl-fp16-x64.tar.gz) 1853 1854**Android:** 1855- [Android arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-android-arm64.tar.gz) 1856 1857**Windows:** 1858- [Windows x64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cpu-x64.zip) 1859- [Windows arm64 (CPU)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cpu-arm64.zip) 1860- [Windows arm64 (OpenCL Adreno)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-opencl-adreno-arm64.zip) 1861- [Windows x64 (CUDA 12)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-12.4-x64.zip) - [CUDA 12.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-12.4-x64.zip) 1862- [Windows x64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-13.3-x64.zip) - [CUDA 13.3 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.3-x64.zip) 1863- [Windows arm64 (CUDA 13)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-cuda-13.4-arm64.zip) - [CUDA 13.4 DLLs](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/cudart-llama-bin-win-cuda-13.4-arm64.zip) 1864- [Windows x64 (Vulkan)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-vulkan-x64.zip) 1865- [Windows x64 (OpenVINO)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-openvino-${{ needs.windows-openvino.outputs.openvino_version }}-x64.zip) 1866- [Windows x64 (SYCL)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-sycl-x64.zip) 1867- [Windows x64 (ROCm 10.0)](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-bin-win-rocm-10.0-x64.zip) 1868 1869**openEuler:** 1870- [DISABLED](https://github.com/ggml-org/llama.cpp/pull/23705) 1871- openEuler x86 (310p) 1872- openEuler x86 (910b, ACL Graph) 1873- openEuler aarch64 (310p) 1874- openEuler aarch64 (910b, ACL Graph) 1875 1876**UI:** 1877- [UI](https://github.com/ggml-org/llama.cpp/releases/download/${{ steps.tag.outputs.name }}/llama-${{ steps.tag.outputs.name }}-ui.tar.gz) 1878 1879- name : Upload release 1880id : upload_release 1881uses : actions/github-script@v8 1882with : 1883github-token : ${{secrets.GITHUB_TOKEN}} 1884script : | 1885const path = require('path'); 1886const fs = require('fs'); 1887const release_id = '${{ steps.create_release.outputs.id }}'; 1888for (let file of await fs.readdirSync('./release')) { 1889if (path.extname(file) === '.zip' || file.endsWith('.tar.gz')) { 1890console.log('uploadReleaseAsset', file); 1891await github.rest.repos.uploadReleaseAsset({ 1892owner: context.repo.owner, 1893repo: context.repo.repo, 1894release_id: release_id, 1895name: file, 1896data: await fs.readFileSync(`./release/${file}`) 1897}); 1898} 1899} 1900 1901ui-publish : 1902if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }} 1903 1904needs : 1905- release 1906 1907uses : ./.github/workflows/ui-publish.yml 1908with : 1909version_tag : ${{ needs.release.outputs.tag_name }} 1910secrets : 1911hf_token : ${{ secrets.HF_TOKEN_UI_STATIC_OUTPUT }}