char-fork/llama.cpp

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

Sigbjørn Skjæretci : move more jobs to ccache-buckets (#28375)8b4b3558f

char/aliceai-t5-moe
5.4 KiB171 linesraw
1name: CI (sycl)
2
3on:
4  workflow_dispatch: # allows manual triggering
5  push:
6    branches:
7      - master
8    paths: [
9      '.github/workflows/build-sycl.yml',
10      '**/CMakeLists.txt',
11      '**/.cmake',
12      '**/*.h',
13      '**/*.hpp',
14      '**/*.c',
15      '**/*.cpp'
16    ]
17
18  pull_request:
19    types: [opened, synchronize, reopened]
20    paths: [
21      '.github/workflows/build-sycl.yml',
22      'ggml/src/ggml-sycl/**'
23    ]
24
25concurrency:
26  group: ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
27  cancel-in-progress: true
28
29env:
30  GGML_NLOOP: 3
31  GGML_N_THREADS: 1
32  LLAMA_ARG_LOG_COLORS: 1
33  LLAMA_ARG_LOG_PREFIX: 1
34  LLAMA_ARG_LOG_TIMESTAMPS: 1
35
36jobs:
37  ubuntu-24-sycl:
38    strategy:
39      matrix:
40        build: [fp32, fp16]
41        include:
42          - build: fp32
43            fp16: OFF
44          - build: fp16
45            fp16: ON
46
47    runs-on: ubuntu-24.04
48
49    env:
50      ONEAPI_ROOT: /opt/intel/oneapi/
51      ONEAPI_INSTALLER_VERSION: "2025.3.3"
52      LEVEL_ZERO_VERSION: "1.28.2"
53      LEVEL_ZERO_UBUNTU_VERSION: "u24.04"
54
55    continue-on-error: true
56
57    steps:
58      - name: Clone
59        id: checkout
60        uses: actions/checkout@v6
61
62      - name: Download & Install oneAPI
63        shell: bash
64        run: |
65          cd /tmp
66          wget https://registrationcenter-download.intel.com/akdlm/IRC_NAS/56f7923a-adb8-43f3-8b02-2b60fcac8cab/intel-deep-learning-essentials-2025.3.3.16_offline.sh -O intel-deep-learning-essentials_offline.sh
67          sudo bash intel-deep-learning-essentials_offline.sh -s -a --silent --eula accept
68
69      - name: Install Level Zero SDK
70        shell: bash
71        run: |
72          cd /tmp
73          wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/level-zero_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O level-zero.deb
74          wget -q "https://github.com/oneapi-src/level-zero/releases/download/v${LEVEL_ZERO_VERSION}/level-zero-devel_${LEVEL_ZERO_VERSION}%2B${LEVEL_ZERO_UBUNTU_VERSION}_amd64.deb" -O level-zero-devel.deb
75          sudo apt-get install -y ./level-zero.deb ./level-zero-devel.deb
76
77      - name: ccache
78        uses: ggml-org/ccache-action@v1.2.24
79        with:
80          key: sycl-ubuntu-24-${{ matrix.build }}
81          save: false
82
83      - name: ccache-buckets-restore
84        uses: ./.github/actions/ccache-buckets
85        env:
86          HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}
87        with:
88          key: sycl-ubuntu-24-${{ matrix.build }}
89          folder: llama.cpp
90          hf_bucket: ggml-org/cache
91
92      - name: Build
93        id: cmake_build
94        run: |
95          source /opt/intel/oneapi/setvars.sh
96          cmake -B build \
97            -G "Ninja" \
98            -DCMAKE_BUILD_TYPE=Release \
99            -DGGML_SYCL=ON \
100            -DCMAKE_C_COMPILER=icx \
101            -DCMAKE_CXX_COMPILER=icpx \
102            -DLLAMA_OPENSSL=OFF \
103            -DGGML_NATIVE=OFF \
104            -DGGML_SYCL_F16=${{ matrix.fp16 }}
105          time cmake --build build --config Release -j $(nproc)
106
107      - name: ccache-buckets-save
108        if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
109        uses: ./.github/actions/ccache-buckets
110        env:
111          HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}
112        with:
113          key: sycl-ubuntu-24-${{ matrix.build }}
114          folder: llama.cpp
115          evict-old-files: 1d
116          hf_bucket: ggml-org/cache
117          save: true
118
119  windows-latest-sycl:
120    runs-on: windows-2022
121
122    defaults:
123      run:
124        shell: bash
125
126    env:
127      WINDOWS_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/b60765d1-2b85-4e85-86b6-cb0e9563a699/intel-deep-learning-essentials-2025.3.3.18_offline.exe
128      WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
129      LEVEL_ZERO_SDK_URL: https://github.com/oneapi-src/level-zero/releases/download/v1.28.2/level-zero-win-sdk-1.28.2.zip
130      ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"
131      ONEAPI_INSTALLER_VERSION: "2025.3.3"
132    steps:
133      - name: Clone
134        id: checkout
135        uses: actions/checkout@v6
136
137      - name: Download & Install oneAPI
138        shell: bash
139        run: |
140          scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL
141
142      - name: Install Level Zero SDK
143        shell: pwsh
144        run: |
145          Invoke-WebRequest -Uri "${{ env.LEVEL_ZERO_SDK_URL }}" -OutFile "level-zero-win-sdk.zip"
146          Expand-Archive -Path "level-zero-win-sdk.zip" -DestinationPath "C:/level-zero-sdk" -Force
147          "LEVEL_ZERO_V1_SDK_PATH=C:/level-zero-sdk" | Out-File -FilePath $env:GITHUB_ENV -Append
148
149      - name: ccache
150        uses: ggml-org/ccache-action@v1.2.24
151        with:
152          key: sycl-windows-latest
153          variant: ccache
154          evict-old-files: 1d
155          save: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
156
157      # TODO: add ssl support ; we will also need to modify win-build-sycl.bat to accept user-specified args
158
159      - name: Build
160        id: cmake_build
161        run:  examples/sycl/win-build-sycl.bat
162
163      - name: ccache-clear
164        uses: ./.github/actions/ccache-clear
165        env:
166          GH_TOKEN: ${{ github.token }}
167        with:
168          key: sycl-windows-latest
169          older: 5m
170          min: 1
171          dry-run: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}