char-fork/llama.cpp
git clone https://git.t4t.associates/char-fork/llama.cpp
d3146f2b5
char/aliceai-t5-moe
1name : CI (webgpu) 2 3on : 4workflow_dispatch : # allows manual triggering 5push : 6branches : 7- master 8paths : [ 9'.github/workflows/build-webgpu.yml' , 10'**/CMakeLists.txt' , 11'**/.cmake' , 12'**/*.h' , 13'**/*.hpp' , 14'**/*.c' , 15'**/*.cpp' , 16'**/*.wgsl' , 17'**/*.tmpl' , 18'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py' 19] 20 21pull_request : 22types : [ opened , synchronize , reopened ] 23paths : [ 24'.github/workflows/build-webgpu.yml' , 25'ggml/src/ggml-webgpu/**' 26] 27 28concurrency : 29group : ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }} 30cancel-in-progress : true 31 32env : 33GGML_NLOOP : 3 34GGML_N_THREADS : 1 35LLAMA_ARG_LOG_COLORS : 1 36LLAMA_ARG_LOG_PREFIX : 1 37LLAMA_ARG_LOG_TIMESTAMPS : 1 38 39jobs : 40format : 41runs-on : ubuntu-24.04 42 43steps : 44- name : Clone 45uses : actions/checkout@v6 46 47- name : Install clang-format 22 48run : | 49wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | 50sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc > /dev/null 51sudo add-apt-repository -y \ 52"deb http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" 53sudo apt-get update 54sudo apt-get install -y clang-format-22 55 56- name : Check formatting 57run : | 58find ggml/src/ggml-webgpu \ 59-type f \( -name '*.cpp' -o -name '*.hpp' -o -name '*.h' \) \ 60-print0 | 61xargs -0 clang-format-22 --dry-run --Werror 62 63macos : 64runs-on : macos-latest 65 66steps : 67- name : Clone 68id : checkout 69uses : actions/checkout@v6 70 71- name : ccache 72uses : ggml-org/ccache-action@v1.2.24 73with : 74key : webgpu-macos-latest 75save : false 76 77- name : Dawn Dependency 78id : dawn-depends 79run : | 80DAWN_VERSION="v20260908.214631" 81DAWN_OWNER="google" 82DAWN_REPO="dawn" 83DAWN_ASSET_NAME="Dawn-94c3c9cc0d5fb2e85aebb370fa8d37b71aa34655-macos-latest-Release" 84echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz" 85curl -L -o artifact.tar.gz \ 86"https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz" 87mkdir dawn 88tar -xvf artifact.tar.gz -C dawn --strip-components=1 89 90- name : ccache-buckets-restore 91uses : ./.github/actions/ccache-buckets 92env : 93HF_TOKEN : ${{ secrets.HF_TOKEN_CI }} 94with : 95key : webgpu-macos-latest 96folder : llama.cpp 97hf_bucket : ggml-org/cache 98 99- name : Build 100id : cmake_build 101run : | 102export CMAKE_PREFIX_PATH=dawn 103cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DGGML_WEBGPU=ON -DGGML_METAL=OFF -DGGML_BLAS=OFF 104time cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) 105 106- name : ccache-buckets-save 107if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} 108uses : ./.github/actions/ccache-buckets 109env : 110HF_TOKEN : ${{ secrets.HF_TOKEN_CACHE_OUTPUT }} 111with : 112key : webgpu-macos-latest 113folder : llama.cpp 114evict-old-files : 1d 115hf_bucket : ggml-org/cache 116save : true 117 118- name : Test 119id : cmake_test 120run : | 121cd build 122ctest -L main --verbose --timeout 900 123 124ubuntu : 125runs-on : ubuntu-24.04 126 127steps : 128- name : Clone 129id : checkout 130uses : actions/checkout@v6 131 132- name : ccache 133uses : ggml-org/ccache-action@v1.2.24 134with : 135key : webgpu-ubuntu-24.04 136save : false 137 138- name : Dependencies 139id : depends 140run : | 141sudo add-apt-repository -y ppa:kisak/kisak-mesa 142sudo apt-get update -y 143sudo apt-get install -y build-essential mesa-vulkan-drivers \ 144libxcb-xinput0 libxcb-xinerama0 libxcb-cursor-dev libssl-dev 145 146- name : Dawn Dependency 147id : dawn-depends 148run : | 149sudo apt-get install -y libxrandr-dev libxinerama-dev libxcursor-dev mesa-common-dev libx11-xcb-dev libxi-dev 150DAWN_VERSION="v20260908.214631" 151DAWN_OWNER="google" 152DAWN_REPO="dawn" 153DAWN_ASSET_NAME="Dawn-94c3c9cc0d5fb2e85aebb370fa8d37b71aa34655-ubuntu-latest-Release" 154echo "Fetching release asset from https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz" 155curl -L -o artifact.tar.gz \ 156"https://github.com/google/dawn/releases/download/${DAWN_VERSION}/${DAWN_ASSET_NAME}.tar.gz" 157mkdir dawn 158tar -xvf artifact.tar.gz -C dawn --strip-components=1 159 160- name : ccache-buckets-restore 161uses : ./.github/actions/ccache-buckets 162env : 163HF_TOKEN : ${{ secrets.HF_TOKEN_CI }} 164with : 165key : webgpu-ubuntu-24.04 166folder : llama.cpp 167hf_bucket : ggml-org/cache 168 169- name : Build 170id : cmake_build 171run : | 172export Dawn_DIR=dawn/lib64/cmake/Dawn 173cmake -B build \ 174-DGGML_WEBGPU=ON 175time cmake --build build --config Release -j $(nproc) 176 177- name : ccache-buckets-save 178if : ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} 179uses : ./.github/actions/ccache-buckets 180env : 181HF_TOKEN : ${{ secrets.HF_TOKEN_CACHE_OUTPUT }} 182with : 183key : webgpu-ubuntu-24.04 184folder : llama.cpp 185evict-old-files : 1d 186hf_bucket : ggml-org/cache 187save : true 188 189- name : Test 190id : cmake_test 191run : | 192 cd build 193 ctest -L main --verbose --timeout 900