char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
234a6ebaa
char/aliceai-t5-moe
1name : CI (CUDA, windows) 2 3# TODO: this workflow is only triggered manually because it is very heavy on the CI 4# when we provision dedicated windows runners, we can enable it for pushes too 5# note: running this workflow manually will populate the ccache for the release builds 6# this can be used before merging a PR to speed up the release workflow 7on : 8workflow_dispatch : # allows manual triggering 9 10# note: this will run in queue with the release workflow 11concurrency : 12group : release 13queue : max 14 15env : 16GH_TOKEN : ${{ github.token }} 17GGML_NLOOP : 3 18GGML_N_THREADS : 1 19LLAMA_ARG_LOG_COLORS : 1 20LLAMA_ARG_LOG_PREFIX : 1 21LLAMA_ARG_LOG_TIMESTAMPS : 1 22 23jobs : 24cuda : 25name : windows-cuda (${{ matrix.cuda }}, ${{ matrix.arch }}) 26runs-on : windows-2022 27 28permissions : 29actions : write 30 31strategy : 32matrix : 33include : 34- cuda : '12.4' 35arch : x64 36defines : '-DGGML_CUDA_CUB_3DOT2=ON' 37- cuda : '13.3' 38arch : x64 39defines : '' 40- cuda : '13.4' 41arch : arm64 42defines : '-DCMAKE_TOOLCHAIN_FILE=cmake/arm64-windows-msvc-cuda.cmake' 43 44steps : 45- name : Clone 46id : checkout 47uses : actions/checkout@v6 48 49- name : ccache 50uses : ggml-org/ccache-action@v1.2.24 51with : 52key : release-windows-2022-${{ matrix.arch }}-cuda-${{ matrix.cuda }} 53 54- name : Install Cuda Toolkit 55uses : ./.github/actions/windows-setup-cuda 56with : 57cuda_version : ${{ matrix.cuda }} 58cuda_arch : ${{ matrix.arch }} 59 60- name : Install Ninja 61id : install_ninja 62run : | 63choco install ninja 64 65- name : Build 66id : cmake_build 67shell : cmd 68run : | 69call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" ${{ matrix.arch == 'x64' && 'x64' || 'amd64_arm64' }} 70cmake -S . -B build -G "Ninja Multi-Config" ^ 71-DGGML_BACKEND_DL=ON ^ 72-DGGML_NATIVE=OFF ^ 73-DGGML_CPU=OFF ^ 74-DGGML_CUDA=ON ^ 75-DLLAMA_BUILD_BORINGSSL=ON ${{ matrix.defines }} 76set /A NINJA_JOBS=%NUMBER_OF_PROCESSORS%-1 77cmake --build build --config Release -j %NINJA_JOBS% --target ggml-cuda 78 79- name : ccache-clear 80uses : ./.github/actions/ccache-clear 81with : 82key : release-windows-2022-${{ matrix.arch }}-cuda-${{ matrix.cuda }} 83 84hip : 85runs-on : windows-2022 86 87permissions : 88actions : write 89 90env : 91# Make sure this is in sync with build-cache.yml 92ROCM_VERSION : "7.14.0" 93 94strategy : 95matrix : 96include : 97# sync with release.yml 98- name : "radeon" 99gpu_targets : "gfx1150;gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032" 100 101steps : 102- name : Clone 103id : checkout 104uses : actions/checkout@v6 105 106# - name: Cache ROCm Installation 107# uses: actions/cache@v5 108# id: cache-rocm 109# with: 110# path: C:\TheRock\build 111# key: rocm-wheels-${{ env.ROCM_VERSION }}-multi-arch-${{ runner.os }} 112 113- name : Setup ROCm 114# if: steps.cache-rocm.outputs.cache-hit != 'true' 115uses : ./.github/actions/windows-setup-rocm 116with : 117version : ${{ env.ROCM_VERSION }} 118 119- name : Setup ROCm Environment 120run : | 121$ErrorActionPreference = "Stop" 122 123# Activate venv from cache or fresh install 124& C:\TheRock\build\.venv\Scripts\Activate.ps1 125 126# Expand the devel tree (idempotent; no-op if already done during install) 127rocm-sdk init 128if ($LASTEXITCODE -ne 0) { throw "rocm-sdk init failed with exit code $LASTEXITCODE" } 129 130# Get ROCm installation paths using the rocm-sdk CLI tool 131$rocmPath = (rocm-sdk path --root) 132if (-not $rocmPath) { throw "rocm-sdk path --root returned empty - devel package may not be installed" } 133$rocmPath = $rocmPath.Trim() 134$cmakePath = (rocm-sdk path --cmake).Trim() 135$binPath = (rocm-sdk path --bin).Trim() 136write-host "ROCm root: $rocmPath" 137 138echo "HIP_PATH=$rocmPath" >> $env:GITHUB_ENV 139echo "CMAKE_PREFIX_PATH=$cmakePath" >> $env:GITHUB_ENV 140echo "HIP_DEVICE_LIB_PATH=$rocmPath\lib\llvm\amdgcn\bitcode" >> $env:GITHUB_ENV 141echo "HIP_PLATFORM=amd" >> $env:GITHUB_ENV 142echo "LLVM_PATH=$rocmPath\lib\llvm" >> $env:GITHUB_ENV 143echo "$binPath" >> $env:GITHUB_PATH 144 145# Keep venv in PATH for subsequent steps 146echo "C:\TheRock\build\.venv\Scripts" >> $env:GITHUB_PATH 147 148- name : Verify ROCm 149id : verify 150run : | 151# Test the ROCm clang shipped in the installed wheel 152& "${env:HIP_PATH}\lib\llvm\bin\clang.exe" --version 153 154- name : ccache 155uses : ggml-org/ccache-action@v1.2.24 156with : 157# TODO: this build does not match the build in release.yml, so we use a different cache key 158# ideally, the builds should match, similar to the CUDA build above so that we would be able 159# to populate the ccache for the release with manual runs of this workflow 160#key: release-windows-2022-x64-hip-${{ env.ROCM_VERSION }}-${{ matrix.name }} 161key : cuda-windows-2022-x64-hip-${{ env.ROCM_VERSION }}-${{ matrix.name }} 162 163- name : Build 164id : cmake_build 165run : | 166cmake -G "Unix Makefiles" -B build -S . ` 167-DCMAKE_PREFIX_PATH="${env:HIP_PATH}" ` 168-DCMAKE_C_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang.exe" ` 169-DCMAKE_CXX_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang++.exe" ` 170-DCMAKE_HIP_COMPILER="${env:HIP_PATH}\lib\llvm\bin\clang.exe" ` 171-DCMAKE_BUILD_TYPE=Release ` 172-DLLAMA_BUILD_BORINGSSL=ON ` 173-DHIP_PATH="${env:HIP_PATH}" ` 174-DGGML_HIP=ON ` 175-DGPU_TARGETS="gfx1100" ` 176-DGGML_RPC=ON 177cmake --build build -j ${env:NUMBER_OF_PROCESSORS} 178 179- name : ccache-clear 180uses : ./.github/actions/ccache-clear 181with : 182#key: release-windows-2022-x64-hip-${{ env.ROCM_VERSION }}-${{ matrix.name }} 183key : cuda-windows-2022-x64-hip-${{ env.ROCM_VERSION }}-${{ matrix.name }}