Felipe97/llama-cpp-compiled
01.2k
1name: CI (sycl)2 3on:4 workflow_dispatch: # allows manual triggering5 push:6 branches:7 - master8 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: true28 29env:30 GGML_NLOOP: 331 GGML_N_THREADS: 132 LLAMA_ARG_LOG_COLORS: 133 LLAMA_ARG_LOG_PREFIX: 134 LLAMA_ARG_LOG_TIMESTAMPS: 135 36jobs:37 ubuntu-24-sycl:38 strategy:39 matrix:40 build: [fp32, fp16]41 include:42 - build: fp3243 fp16: OFF44 - build: fp1645 fp16: ON46 47 runs-on: ubuntu-24.0448 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: true56 57 steps:58 - name: Clone59 id: checkout60 uses: actions/checkout@v661 62 - name: Download & Install oneAPI63 shell: bash64 run: |65 cd /tmp66 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.sh67 sudo bash intel-deep-learning-essentials_offline.sh -s -a --silent --eula accept68 69 - name: Install Level Zero SDK70 shell: bash71 run: |72 cd /tmp73 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.deb74 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.deb75 sudo apt-get install -y ./level-zero.deb ./level-zero-devel.deb76 77 - name: ccache78 uses: ggml-org/ccache-action@v1.2.2479 with:80 key: sycl-ubuntu-24-${{ matrix.build }}81 save: false82 83 - name: ccache-buckets-restore84 uses: ./.github/actions/ccache-buckets85 env:86 HF_TOKEN: ${{ secrets.HF_TOKEN_CI }}87 with:88 key: sycl-ubuntu-24-${{ matrix.build }}89 folder: llama.cpp90 hf_bucket: ggml-org/cache91 92 - name: Build93 id: cmake_build94 run: |95 source /opt/intel/oneapi/setvars.sh96 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-save108 if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}109 uses: ./.github/actions/ccache-buckets110 env:111 HF_TOKEN: ${{ secrets.HF_TOKEN_CACHE_OUTPUT }}112 with:113 key: sycl-ubuntu-24-${{ matrix.build }}114 folder: llama.cpp115 evict-old-files: 1d116 hf_bucket: ggml-org/cache117 save: true118 119 windows-latest-sycl:120 runs-on: windows-2022121 122 defaults:123 run:124 shell: bash125 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.exe128 WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel129 LEVEL_ZERO_SDK_URL: https://github.com/oneapi-src/level-zero/releases/download/v1.28.2/level-zero-win-sdk-1.28.2.zip130 ONEAPI_ROOT: "C:/Program Files (x86)/Intel/oneAPI"131 ONEAPI_INSTALLER_VERSION: "2025.3.3"132 steps:133 - name: Clone134 id: checkout135 uses: actions/checkout@v6136 137 - name: Download & Install oneAPI138 shell: bash139 run: |140 scripts/install-oneapi.bat $WINDOWS_BASEKIT_URL $WINDOWS_DPCPP_MKL141 142 - name: Install Level Zero SDK143 shell: pwsh144 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" -Force147 "LEVEL_ZERO_V1_SDK_PATH=C:/level-zero-sdk" | Out-File -FilePath $env:GITHUB_ENV -Append148 149 - name: ccache150 uses: ggml-org/ccache-action@v1.2.24151 with:152 key: sycl-windows-latest153 variant: ccache154 evict-old-files: 1d155 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 args158 159 - name: Build160 id: cmake_build161 run: examples/sycl/win-build-sycl.bat162 163 - name: ccache-clear164 uses: ./.github/actions/ccache-clear165 env:166 GH_TOKEN: ${{ github.token }}167 with:168 key: sycl-windows-latest169 older: 5m170 min: 1171 dry-run: ${{ github.event_name != 'push' || github.ref != 'refs/heads/master' }}172 