Felipe97/llama-cpp-compiled
01.2k
1name: CI (CUDA, ubuntu)2 3on:4 workflow_dispatch: # allows manual triggering5 push:6 branches:7 - master8 paths: [9 '.github/workflows/build-cuda-ubuntu.yml',10 '**/CMakeLists.txt',11 '**/.cmake',12 '**/*.h',13 '**/*.hpp',14 '**/*.c',15 '**/*.cpp',16 '**/*.cu',17 '**/*.cuh'18 ]19 20 pull_request:21 types: [opened, synchronize, reopened]22 paths: [23 '.github/workflows/build-cuda-ubuntu.yml',24 'ggml/src/ggml-cuda/**'25 ]26 27concurrency:28 group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}29 cancel-in-progress: true30 31env:32 GGML_NLOOP: 333 GGML_N_THREADS: 134 LLAMA_ARG_LOG_COLORS: 135 LLAMA_ARG_LOG_PREFIX: 136 LLAMA_ARG_LOG_TIMESTAMPS: 137 38jobs:39 cuda:40 runs-on: ubuntu-24.0441 container: nvidia/cuda:12.6.2-devel-ubuntu24.0442 43 steps:44 - name: Clone45 id: checkout46 uses: actions/checkout@v647 48 - name: Install dependencies49 env:50 DEBIAN_FRONTEND: noninteractive51 run: |52 apt update53 apt install -y cmake build-essential ninja-build libgomp1 git libssl-dev jq python3 python3-venv python3-pip54 55 - name: ccache56 uses: ggml-org/ccache-action@v1.2.2457 with:58 key: cuda-ubuntu-24.04-cuda59 save: false60 61 - name: ccache-buckets-restore62 uses: ./.github/actions/ccache-buckets63 env:64 HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}65 with:66 key: cuda-ubuntu-24.04-cuda67 folder: llama.cpp68 hf_bucket: ggml-org/cache69 70 - name: Build with CMake71 # TODO: Remove GGML_CUDA_CUB_3DOT2 flag once CCCL 3.2 is bundled within CTK and that CTK version is used in this project72 run: |73 cmake -S . -B build -G Ninja \74 -DLLAMA_FATAL_WARNINGS=ON \75 -DCMAKE_BUILD_TYPE=Release \76 -DCMAKE_CUDA_ARCHITECTURES=89-real \77 -DCMAKE_EXE_LINKER_FLAGS=-Wl,--allow-shlib-undefined \78 -DGGML_NATIVE=OFF \79 -DGGML_CUDA=ON \80 -DGGML_CUDA_CUB_3DOT2=ON81 cmake --build build82 83 - name: ccache-buckets-save84 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}85 uses: ./.github/actions/ccache-buckets86 env:87 HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}88 with:89 key: cuda-ubuntu-24.04-cuda90 folder: llama.cpp91 evict-old-files: 1d92 hf_bucket: ggml-org/cache93 save: true94 95 hip:96 runs-on: ubuntu-22.0497 container: rocm/dev-ubuntu-22.04:6.1.298 99 steps:100 - name: Clone101 id: checkout102 uses: actions/checkout@v6103 104 - name: Dependencies105 id: depends106 run: |107 sudo apt-get update108 sudo apt-get install -y build-essential git cmake rocblas-dev hipblas-dev libssl-dev rocwmma-dev jq python3-venv109 110 - name: ccache111 uses: ggml-org/ccache-action@v1.2.24112 with:113 key: cuda-ubuntu-22.04-hip114 save: false115 116 - name: ccache-buckets-restore117 uses: ./.github/actions/ccache-buckets118 env:119 HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}120 with:121 key: cuda-ubuntu-22.04-hip122 folder: llama.cpp123 hf_bucket: ggml-org/cache124 125 - name: Build with native CMake HIP support126 id: cmake_build127 run: |128 cmake -B build -S . \129 -DCMAKE_HIP_COMPILER="$(hipconfig -l)/clang" \130 -DGPU_TARGETS="gfx1030" \131 -DGGML_HIP=ON132 cmake --build build --config Release -j $(nproc)133 134 - name: ccache-buckets-save135 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}136 uses: ./.github/actions/ccache-buckets137 env:138 HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}139 with:140 key: cuda-ubuntu-22.04-hip141 folder: llama.cpp142 evict-old-files: 1d143 hf_bucket: ggml-org/cache144 save: true145 146 musa:147 runs-on: ubuntu-22.04148 container: mthreads/musa:rc4.3.0-devel-ubuntu22.04-amd64149 150 steps:151 - name: Clone152 id: checkout153 uses: actions/checkout@v6154 155 - name: Dependencies156 id: depends157 run: |158 apt-get update159 apt-get install -y build-essential git cmake libssl-dev jq160 161 - name: ccache162 uses: ggml-org/ccache-action@v1.2.24163 with:164 key: cuda-ubuntu-22.04-musa165 save: false166 167 - name: ccache-buckets-restore168 uses: ./.github/actions/ccache-buckets169 env:170 HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}171 with:172 key: cuda-ubuntu-22.04-musa173 folder: llama.cpp174 hf_bucket: ggml-org/cache175 176 - name: Build with native CMake MUSA support177 id: cmake_build178 run: |179 cmake -B build -S . \180 -DGGML_MUSA=ON \181 -DMUSA_ARCHITECTURES=21182 time cmake --build build --config Release -j $(nproc)183 184 - name: ccache-buckets-save185 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}186 uses: ./.github/actions/ccache-buckets187 env:188 HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}189 with:190 key: cuda-ubuntu-22.04-musa191 folder: llama.cpp192 evict-old-files: 1d193 hf_bucket: ggml-org/cache194 save: true195 