char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
1744c6bde
char/aliceai-t5-moe
1name : Server (self-hosted) 2 3on : 4workflow_dispatch : # allows manual triggering 5inputs : 6sha : 7description : 'Commit SHA1 to build' 8required : false 9type : string 10slow_tests : 11description : 'Run slow tests' 12required : true 13type : boolean 14push : 15branches : 16- master 17paths : [ 18'.github/workflows/server-self-hosted.yml' , 19'**/CMakeLists.txt' , 20'**/Makefile' , 21'**/*.h' , 22'**/*.hpp' , 23'**/*.c' , 24'**/*.cpp' , 25'**/*.cu' , 26'**/*.swift' , 27'**/*.m' , 28'tools/server/**.*' 29] 30 31env : 32# note: this is dud token to avoid rate limiting (https://github.com/ggml-org/llama.cpp/pull/25706#issuecomment-4979941302) 33HF_TOKEN : ${{ secrets.HF_TOKEN_CI }} 34LLAMA_ARG_LOG_COLORS : 1 35LLAMA_ARG_LOG_PREFIX : 1 36LLAMA_ARG_LOG_TIMESTAMPS : 1 37LLAMA_ARG_LOG_VERBOSITY : 10 38 39concurrency : 40group : ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref || github.run_id }} 41cancel-in-progress : true 42 43jobs : 44server-metal : 45runs-on : [ self-hosted , llama-server , macOS , ARM64 ] 46 47steps : 48- name : Clone 49id : checkout 50uses : actions/checkout@v6 51with : 52fetch-depth : 0 53ref : ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }} 54 55- name : Build 56id : cmake_build 57run : | 58cmake -B build -DGGML_SCHED_NO_REALLOC=ON 59cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) --target llama-server 60 61- name : Python setup 62id : setup_python 63run : | 64cd tools/server/tests 65python3 -m venv venv 66source venv/bin/activate 67pip install -r requirements.txt 68 69- name : Tests (GPUx1) 70id : server_integration_tests 71if : ${{ !github.event.pull_request }} 72run : | 73cd tools/server/tests 74source venv/bin/activate 75PYTEST_WORKERS=1 ./tests.sh 76 77- name : Tests (GPUx1, backend-sampling) 78id : server_integration_tests_backend_sampling 79if : ${{ !github.event.pull_request }} 80run : | 81cd tools/server/tests 82source venv/bin/activate 83export LLAMA_ARG_BACKEND_SAMPLING=1 84PYTEST_WORKERS=1 ./tests.sh 85 86- name : Tests (GPUx2) 87id : server_integration_tests_gpu2 88if : ${{ !github.event.pull_request }} 89run : | 90cd tools/server/tests 91source venv/bin/activate 92export GGML_METAL_DEVICES=2 93PYTEST_WORKERS=1 ./tests.sh 94 95- name : Tests (GPUx2, backend-sampling) 96id : server_integration_tests_gpu2_backend_sampling 97if : ${{ !github.event.pull_request }} 98run : | 99cd tools/server/tests 100source venv/bin/activate 101export GGML_METAL_DEVICES=2 LLAMA_ARG_BACKEND_SAMPLING=1 102PYTEST_WORKERS=1 ./tests.sh 103 104server-cuda : 105runs-on : "hf-jobs-t4-small:cuda13" 106 107steps : 108- name : Clone 109id : checkout 110uses : actions/checkout@v6 111with : 112fetch-depth : 0 113ref : ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }} 114 115- name : Install dependencies 116run : | 117sudo apt update 118sudo apt install -y cmake libssl-dev python3 python3-venv python3-pip 119 120- name : ccache 121uses : ggml-org/ccache-action@v1.2.24 122with : 123restore : false 124save : false 125 126- name : ccache-buckets-restore 127uses : ./.github/actions/ccache-buckets 128with : 129key : self-hosted-server-cuda 130folder : llama.cpp 131hf_bucket : ggml-org/cache 132 133- name : Build 134id : cmake_build 135run : | 136cmake -B build -DGGML_CUDA=ON -DGGML_SCHED_NO_REALLOC=ON -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc 137cmake --build build --config Release -j $(nproc) --target llama-server 138 139- name : ccache-buckets-save 140if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} 141uses : ./.github/actions/ccache-buckets 142env : 143HF_TOKEN : ${{ secrets.HF_TOKEN_CACHE_OUTPUT }} 144with : 145key : self-hosted-server-cuda 146folder : llama.cpp 147evict-old-files : 1d 148hf_bucket : ggml-org/cache 149save : true 150 151- name : Python setup 152id : setup_python 153run : | 154cd tools/server/tests 155python3 -m venv venv 156source venv/bin/activate 157pip install -r requirements.txt 158 159- name : Tests (GPUx1) 160id : server_integration_tests 161if : ${{ !github.event.pull_request }} 162run : | 163cd tools/server/tests 164source venv/bin/activate 165PYTEST_WORKERS=1 ./tests.sh 166 167- name : Tests (GPUx1, backend-sampling) 168id : server_integration_tests_backend_sampling 169if : ${{ !github.event.pull_request }} 170run : | 171cd tools/server/tests 172source venv/bin/activate 173export LLAMA_ARG_BACKEND_SAMPLING=1 174PYTEST_WORKERS=1 ./tests.sh 175 176- name : Tests (GPUx2) 177id : server_integration_tests_gpu2 178if : ${{ !github.event.pull_request }} 179run : | 180cd tools/server/tests 181source venv/bin/activate 182export GGML_CUDA_DEVICES=2 183PYTEST_WORKERS=1 ./tests.sh 184 185- name : Tests (GPUx2, backend-sampling) 186id : server_integration_tests_gpu2_backend_sampling 187if : ${{ !github.event.pull_request }} 188run : | 189cd tools/server/tests 190source venv/bin/activate 191export GGML_CUDA_DEVICES=2 LLAMA_ARG_BACKEND_SAMPLING=1 192PYTEST_WORKERS=1 ./tests.sh 193 194server-kleidiai : 195runs-on : ah-ubuntu_22_04-c8g_8x 196 197steps : 198- name : Clone 199id : checkout 200uses : actions/checkout@v6 201with : 202fetch-depth : 0 203ref : ${{ github.event.inputs.sha || github.event.pull_request.head.sha || github.sha || github.head_ref || github.ref_name }} 204 205- name : Dependencies 206id : depends 207run : | 208set -euxo pipefail 209sudo apt-get update 210sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a \ 211apt-get install -y \ 212build-essential \ 213libssl-dev \ 214python3-venv \ 215gpg \ 216wget \ 217time \ 218git-lfs 219 220git lfs install 221 222# install the latest cmake 223sudo install -d /usr/share/keyrings 224wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc \ 225| gpg --dearmor \ 226| sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null 227echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ jammy main' \ 228| sudo tee /etc/apt/sources.list.d/kitware.list 229sudo apt-get update 230sudo apt-get install -y cmake 231 232- name : Build 233id : cmake_build 234run : | 235cmake -B build -DGGML_SCHED_NO_REALLOC=ON -DGGML_CPU_KLEIDIAI=ON 236cmake --build build --config Release -j $(nproc) --target llama-server 237 238- name : Python setup 239id : setup_python 240run : | 241cd tools/server/tests 242python3 -m venv venv 243source venv/bin/activate 244pip install -r requirements.txt 245 246- name : Tests 247id : server_integration_tests 248if : ${{ !github.event.pull_request }} 249run : | 250 cd tools/server/tests 251 source venv/bin/activate 252 ./tests.sh