char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Mendy Bergerggml-webgpu: Update to a recent version of Dawn (#28683)d3146f2b5

char/aliceai-t5-moe
2.8 KiB110 linesraw
1name: CI (wasm)
2
3on:
4  workflow_dispatch: # allows manual triggering
5  push:
6    branches:
7      - master
8    paths: [
9      '.github/workflows/build-wasm.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
21  pull_request:
22    types: [opened, synchronize, reopened]
23    paths: [
24      '.github/workflows/build-wasm.yml',
25      '**/CMakeLists.txt',
26      '**/.cmake',
27      '**/*.h',
28      '**/*.hpp',
29      '**/*.c',
30      '**/*.cpp',
31      '**/*.wgsl',
32      '**/*.tmpl',
33      'ggml/src/ggml-webgpu/wgsl-shaders/embed_wgsl.py'
34    ]
35
36concurrency:
37  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
38  cancel-in-progress: true
39
40env:
41  GGML_NLOOP: 3
42  GGML_N_THREADS: 1
43  LLAMA_ARG_LOG_COLORS: 1
44  LLAMA_ARG_LOG_PREFIX: 1
45  LLAMA_ARG_LOG_TIMESTAMPS: 1
46
47jobs:
48  ubuntu-webgpu:
49    runs-on: ubuntu-24.04-arm
50
51    steps:
52      - name: Clone
53        id: checkout
54        uses: actions/checkout@v6
55
56      - name: ccache
57        uses: ggml-org/ccache-action@v1.2.24
58        with:
59          key: webgpu-ubuntu-24.04-arm-wasm
60          save: false
61
62      - name: Install Emscripten
63        run: |
64          git clone https://github.com/emscripten-core/emsdk.git
65          cd emsdk
66          ./emsdk install latest
67          ./emsdk activate latest
68
69      - name: Fetch emdawnwebgpu
70        run: |
71          DAWN_TAG="v20260908.214631"
72          EMDAWN_PKG="emdawnwebgpu_pkg-${DAWN_TAG}.zip"
73          echo "Downloading ${EMDAWN_PKG}"
74          curl -L -o emdawn.zip \
75            "https://github.com/google/dawn/releases/download/${DAWN_TAG}/${EMDAWN_PKG}"
76          unzip emdawn.zip
77
78      - name: ccache-buckets-restore
79        uses: ./.github/actions/ccache-buckets
80        env:
81          HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
82        with:
83          key: webgpu-ubuntu-24.04-arm-wasm
84          folder: llama.cpp
85          hf_bucket: ggml-org/cache
86
87      - name: Build WASM WebGPU
88        run: |
89          source emsdk/emsdk_env.sh
90          emcmake cmake -B build-wasm \
91            -G "Ninja" \
92            -DCMAKE_BUILD_TYPE=Release \
93            -DGGML_WEBGPU=ON \
94            -DGGML_OPENMP=OFF \
95            -DLLAMA_OPENSSL=OFF \
96            -DEMDAWNWEBGPU_DIR=emdawnwebgpu_pkg
97
98          time cmake --build build-wasm --config Release --target test-backend-ops -j $(nproc)
99
100      - name: ccache-buckets-save
101        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
102        uses: ./.github/actions/ccache-buckets
103        env:
104          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
105        with:
106          key: webgpu-ubuntu-24.04-arm-wasm
107          folder: llama.cpp
108          evict-old-files: 1d
109          hf_bucket: ggml-org/cache
110          save: true