Skip to content

Commit 5657ac8

Browse files
committed
ci: add SYCL package and Docker builds
1 parent 8ae497f commit 5657ac8

3 files changed

Lines changed: 258 additions & 6 deletions

File tree

.devops/intel.Dockerfile

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ARG APP_REVISION=N/A
88
FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS build
99

1010
ARG GGML_SYCL_F16=OFF
11+
ARG SYCL_BUILD_TARGET=all
1112
ARG LEVEL_ZERO_VERSION=1.28.2
1213
ARG LEVEL_ZERO_UBUNTU_VERSION=u24.04
1314
RUN apt-get update && \
@@ -27,8 +28,21 @@ RUN if [ "${GGML_SYCL_F16}" = "ON" ]; then \
2728
&& export OPT_SYCL_F16="-DGGML_SYCL_F16=ON"; \
2829
fi && \
2930
echo "Building with dynamic libs" && \
30-
cmake -B build -DGGML_NATIVE=OFF -DGGML_SYCL=ON -DCMAKE_C_COMPILER=icx -DCMAKE_CXX_COMPILER=icpx -DGGML_BACKEND_DL=ON -DGGML_CPU_ALL_VARIANTS=ON -DLLAMA_BUILD_TESTS=OFF ${OPT_SYCL_F16} && \
31-
cmake --build build --config Release -j$(nproc)
31+
cmake -B build \
32+
-DCMAKE_BUILD_TYPE=Release \
33+
-DGGML_NATIVE=OFF \
34+
-DGGML_SYCL=ON \
35+
-DCMAKE_C_COMPILER=icx \
36+
-DCMAKE_CXX_COMPILER=icpx \
37+
-DGGML_BACKEND_DL=ON \
38+
-DGGML_CPU_ALL_VARIANTS=ON \
39+
-DLLAMA_BUILD_EXAMPLES=OFF \
40+
-DLLAMA_BUILD_TESTS=OFF \
41+
-DLLAMA_BUILD_TOOLS=ON \
42+
-DLLAMA_BUILD_SERVER=ON \
43+
-DGGML_RPC=ON \
44+
${OPT_SYCL_F16} && \
45+
cmake --build build --config Release -j$(nproc) --target ${SYCL_BUILD_TARGET}
3246

3347
RUN mkdir -p /app/lib && \
3448
find build -name "*.so*" -exec cp -P {} /app/lib \;
@@ -47,13 +61,13 @@ FROM intel/deep-learning-essentials:$ONEAPI_VERSION AS base
4761
ARG BUILD_DATE=N/A
4862
ARG APP_VERSION=N/A
4963
ARG APP_REVISION=N/A
50-
ARG IMAGE_URL=https://github.com/ggml-org/llama.cpp
51-
ARG IMAGE_SOURCE=https://github.com/ggml-org/llama.cpp
64+
ARG IMAGE_URL=https://github.com/Anbeeld/beellama.cpp
65+
ARG IMAGE_SOURCE=https://github.com/Anbeeld/beellama.cpp
5266
LABEL org.opencontainers.image.created=$BUILD_DATE \
5367
org.opencontainers.image.version=$APP_VERSION \
5468
org.opencontainers.image.revision=$APP_REVISION \
55-
org.opencontainers.image.title="llama.cpp" \
56-
org.opencontainers.image.description="LLM inference in C/C++" \
69+
org.opencontainers.image.title="BeeLlama.cpp" \
70+
org.opencontainers.image.description="BeeLlama.cpp GGUF inference with DFlash, TurboQuant, and TCQ cache types" \
5771
org.opencontainers.image.url=$IMAGE_URL \
5872
org.opencontainers.image.source=$IMAGE_SOURCE
5973

.github/workflows/docker.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ jobs:
139139
cache_name: vulkan
140140
platforms: linux/amd64
141141
free_disk_space: false
142+
- name: sycl
143+
display_suffix: " SYCL"
144+
dockerfile: .devops/intel.Dockerfile
145+
sycl_build_target: "llama-server"
146+
tag_suffixes: "-sycl"
147+
cache_name: sycl
148+
platforms: linux/amd64
149+
free_disk_space: true
142150
steps:
143151
- name: Check out the repo
144152
uses: actions/checkout@v6
@@ -234,6 +242,7 @@ jobs:
234242
${{ matrix.config.cuda_version && format('CUDA_VERSION={0}', matrix.config.cuda_version) || '' }}
235243
${{ matrix.config.cuda_arch && format('CUDA_DOCKER_ARCH={0}', matrix.config.cuda_arch) || '' }}
236244
${{ matrix.config.cuda_build_target && format('CUDA_BUILD_TARGET={0}', matrix.config.cuda_build_target) || '' }}
245+
${{ matrix.config.sycl_build_target && format('SYCL_BUILD_TARGET={0}', matrix.config.sycl_build_target) || '' }}
237246
annotations: |
238247
manifest:org.opencontainers.image.created=${{ steps.build_date.outputs.date }}
239248
manifest:org.opencontainers.image.version=${{ needs.docker-meta.outputs.version }}

.github/workflows/release.yml

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,106 @@ jobs:
325325
path: beellama-${{ needs.release-meta.outputs.tag_name }}-bin-ubuntu-rocm-7.2-x64.tar.gz
326326
name: beellama-bin-ubuntu-rocm-7.2-x64.tar.gz
327327

328+
ubuntu-sycl:
329+
name: Ubuntu x64 SYCL
330+
needs: release-meta
331+
runs-on: ubuntu-24.04
332+
env:
333+
ONEAPI_ROOT: /opt/intel/oneapi
334+
ONEAPI_INSTALLER_VERSION: "2025.3.3"
335+
ONEAPI_INSTALLER_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/56f7923a-adb8-43f3-8b02-2b60fcac8cab/intel-deep-learning-essentials-2025.3.3.16_offline.sh
336+
LEVEL_ZERO_VERSION: "1.28.2"
337+
LEVEL_ZERO_UBUNTU_VERSION: "u24.04"
338+
steps:
339+
- name: Clone
340+
uses: actions/checkout@v6
341+
with:
342+
fetch-depth: 0
343+
344+
- name: Setup Node.js
345+
uses: actions/setup-node@v6
346+
with:
347+
node-version: "24"
348+
cache: "npm"
349+
cache-dependency-path: "tools/ui/package-lock.json"
350+
351+
- name: Free up disk space
352+
uses: ggml-org/free-disk-space@v1.3.1
353+
with:
354+
tool-cache: true
355+
356+
- name: Prepare oneAPI cache path
357+
run: |
358+
sudo mkdir -p "${ONEAPI_ROOT}"
359+
sudo chown -R "${USER}:${USER}" /opt/intel
360+
361+
- name: Cache oneAPI installation
362+
id: cache-oneapi
363+
uses: actions/cache@v5
364+
with:
365+
path: ${{ env.ONEAPI_ROOT }}
366+
key: oneapi-linux-${{ env.ONEAPI_INSTALLER_VERSION }}-${{ runner.os }}
367+
368+
- name: ccache
369+
uses: ggml-org/ccache-action@v1.2.21
370+
with:
371+
key: release-ubuntu-sycl-${{ env.ONEAPI_INSTALLER_VERSION }}-x64
372+
evict-old-files: 1d
373+
374+
- name: Dependencies
375+
run: |
376+
sudo apt-get update
377+
sudo apt-get install -y build-essential git cmake ninja-build wget ca-certificates libssl-dev
378+
379+
- name: Install oneAPI
380+
if: steps.cache-oneapi.outputs.cache-hit != 'true'
381+
run: |
382+
installer="${RUNNER_TEMP}/intel-deep-learning-essentials-${ONEAPI_INSTALLER_VERSION}.sh"
383+
wget "${ONEAPI_INSTALLER_URL}" -O "${installer}"
384+
sudo bash "${installer}" -s -a --silent --eula accept
385+
sudo chown -R "${USER}:${USER}" "${ONEAPI_ROOT}"
386+
387+
- name: Install Level Zero SDK
388+
run: |
389+
cd /tmp
390+
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
391+
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
392+
sudo apt-get -o Dpkg::Options::="--force-overwrite" install -y ./level-zero.deb ./level-zero-devel.deb
393+
394+
- name: Build
395+
run: |
396+
source "${ONEAPI_ROOT}/setvars.sh"
397+
cmake -B build -G "Ninja" \
398+
-DCMAKE_BUILD_TYPE=Release \
399+
-DCMAKE_INSTALL_RPATH='$ORIGIN' \
400+
-DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
401+
-DGGML_SYCL=ON \
402+
-DGGML_SYCL_F16=OFF \
403+
-DCMAKE_C_COMPILER=icx \
404+
-DCMAKE_CXX_COMPILER=icpx \
405+
-DGGML_BACKEND_DL=ON \
406+
-DGGML_NATIVE=OFF \
407+
-DGGML_CPU_ALL_VARIANTS=ON \
408+
${{ env.CMAKE_ARGS }}
409+
cmake --build build --config Release -j "$(nproc)"
410+
411+
- name: ccache stats
412+
if: always()
413+
run: ccache --show-stats
414+
415+
- name: Pack artifacts
416+
run: |
417+
cp LICENSE ./build/bin/
418+
tar -czvf "beellama-${{ needs.release-meta.outputs.tag_name }}-bin-ubuntu-sycl-x64.tar.gz" \
419+
--transform "s,^\.,beellama-${{ needs.release-meta.outputs.tag_name }}," \
420+
-C ./build/bin .
421+
422+
- name: Upload artifacts
423+
uses: actions/upload-artifact@v6
424+
with:
425+
path: beellama-${{ needs.release-meta.outputs.tag_name }}-bin-ubuntu-sycl-x64.tar.gz
426+
name: beellama-bin-ubuntu-sycl-x64.tar.gz
427+
328428
windows-cpu:
329429
name: Windows x64 CPU
330430
needs: release-meta
@@ -388,6 +488,130 @@ jobs:
388488
path: beellama-bin-win-cpu-x64.zip
389489
name: beellama-bin-win-cpu-x64.zip
390490

491+
windows-sycl:
492+
name: Windows x64 SYCL
493+
needs: release-meta
494+
runs-on: windows-2022
495+
env:
496+
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
497+
WINDOWS_DPCPP_MKL: intel.oneapi.win.cpp-dpcpp-common:intel.oneapi.win.mkl.devel:intel.oneapi.win.dnnl:intel.oneapi.win.tbb.devel
498+
LEVEL_ZERO_SDK_URL: https://github.com/oneapi-src/level-zero/releases/download/v1.28.2/level-zero-win-sdk-1.28.2.zip
499+
ONEAPI_ROOT: 'C:\Program Files (x86)\Intel\oneAPI'
500+
ONEAPI_INSTALLER_VERSION: "2025.3.3"
501+
steps:
502+
- name: Clone
503+
uses: actions/checkout@v6
504+
505+
- name: Cache oneAPI installation
506+
id: cache-oneapi
507+
uses: actions/cache@v5
508+
with:
509+
path: ${{ env.ONEAPI_ROOT }}
510+
key: oneapi-windows-${{ env.ONEAPI_INSTALLER_VERSION }}-${{ runner.os }}
511+
512+
- name: Install oneAPI
513+
if: steps.cache-oneapi.outputs.cache-hit != 'true'
514+
shell: cmd
515+
run: scripts\install-oneapi.bat "%WINDOWS_BASEKIT_URL%" "%WINDOWS_DPCPP_MKL%"
516+
517+
- name: Install Level Zero SDK
518+
shell: pwsh
519+
run: |
520+
$ErrorActionPreference = "Stop"
521+
$archive = Join-Path $env:RUNNER_TEMP "level-zero-win-sdk.zip"
522+
$extractDir = Join-Path $env:RUNNER_TEMP "level-zero-sdk"
523+
Invoke-WebRequest -Uri "${{ env.LEVEL_ZERO_SDK_URL }}" -OutFile $archive
524+
Expand-Archive -Path $archive -DestinationPath $extractDir -Force
525+
$sdkRoot = Get-ChildItem -Path $extractDir -Directory | Select-Object -First 1
526+
if (-not $sdkRoot) {
527+
$sdkRoot = Get-Item $extractDir
528+
}
529+
"LEVEL_ZERO_V1_SDK_PATH=$($sdkRoot.FullName)" | Out-File -FilePath $env:GITHUB_ENV -Append
530+
531+
- name: ccache
532+
uses: ggml-org/ccache-action@v1.2.21
533+
with:
534+
key: release-windows-sycl-${{ env.ONEAPI_INSTALLER_VERSION }}-x64
535+
variant: ccache
536+
evict-old-files: 1d
537+
538+
- name: Install Ninja
539+
run: choco install ninja -y
540+
541+
- name: Build
542+
shell: cmd
543+
run: |
544+
call "%ONEAPI_ROOT%\setvars.bat" intel64 --force
545+
icx --version
546+
cmake -G "Ninja" -B build ^
547+
-DCMAKE_C_COMPILER=cl ^
548+
-DCMAKE_CXX_COMPILER=icx ^
549+
-DCMAKE_BUILD_TYPE=Release ^
550+
-DGGML_BACKEND_DL=ON ^
551+
-DBUILD_SHARED_LIBS=ON ^
552+
-DGGML_CPU=OFF ^
553+
-DGGML_SYCL=ON ^
554+
-DGGML_SYCL_F16=OFF ^
555+
-DLLAMA_BUILD_EXAMPLES=OFF ^
556+
-DLLAMA_BUILD_TESTS=OFF ^
557+
-DLLAMA_BUILD_TOOLS=OFF ^
558+
-DLLAMA_BUILD_SERVER=OFF ^
559+
-DLLAMA_BUILD_BORINGSSL=ON
560+
cmake --build build --config Release -j %NUMBER_OF_PROCESSORS% --target ggml-sycl
561+
562+
- name: ccache stats
563+
if: always()
564+
run: ccache --show-stats
565+
566+
- name: Pack SYCL backend
567+
shell: pwsh
568+
run: |
569+
$ErrorActionPreference = "Stop"
570+
$bin = ".\build\bin"
571+
Copy-Item ".\LICENSE" $bin -Force
572+
573+
$runtimeFiles = @(
574+
"$env:ONEAPI_ROOT\mkl\latest\bin\mkl_sycl_blas.5.dll",
575+
"$env:ONEAPI_ROOT\mkl\latest\bin\mkl_core.2.dll",
576+
"$env:ONEAPI_ROOT\mkl\latest\bin\mkl_tbb_thread.2.dll",
577+
"$env:ONEAPI_ROOT\compiler\latest\bin\ur_adapter_level_zero.dll",
578+
"$env:ONEAPI_ROOT\compiler\latest\bin\ur_adapter_level_zero_v2.dll",
579+
"$env:ONEAPI_ROOT\compiler\latest\bin\ur_adapter_opencl.dll",
580+
"$env:ONEAPI_ROOT\compiler\latest\bin\ur_loader.dll",
581+
"$env:ONEAPI_ROOT\compiler\latest\bin\ur_win_proxy_loader.dll",
582+
"$env:ONEAPI_ROOT\compiler\latest\bin\sycl8.dll",
583+
"$env:ONEAPI_ROOT\compiler\latest\bin\svml_dispmd.dll",
584+
"$env:ONEAPI_ROOT\compiler\latest\bin\libmmd.dll",
585+
"$env:ONEAPI_ROOT\compiler\latest\bin\libiomp5md.dll",
586+
"$env:ONEAPI_ROOT\compiler\latest\bin\sycl-ls.exe",
587+
"$env:ONEAPI_ROOT\compiler\latest\bin\libsycl-fallback-bfloat16.spv",
588+
"$env:ONEAPI_ROOT\compiler\latest\bin\libsycl-native-bfloat16.spv",
589+
"$env:ONEAPI_ROOT\dnnl\latest\bin\dnnl.dll",
590+
"$env:ONEAPI_ROOT\tbb\latest\bin\tbb12.dll",
591+
"$env:ONEAPI_ROOT\tcm\latest\bin\tcm.dll",
592+
"$env:ONEAPI_ROOT\tcm\latest\bin\libhwloc-15.dll",
593+
"$env:ONEAPI_ROOT\umf\latest\bin\umf.dll"
594+
)
595+
596+
foreach ($file in $runtimeFiles) {
597+
Copy-Item -LiteralPath $file -Destination $bin -Force
598+
}
599+
600+
$zeLoader = Get-ChildItem -Path @($env:ONEAPI_ROOT, $env:LEVEL_ZERO_V1_SDK_PATH) -Recurse -Filter "ze_loader.dll" -ErrorAction SilentlyContinue | Select-Object -First 1
601+
if ($zeLoader) {
602+
Copy-Item -LiteralPath $zeLoader.FullName -Destination $bin -Force
603+
} else {
604+
Write-Warning "ze_loader.dll was not found in oneAPI or the Level Zero SDK; relying on the system driver runtime"
605+
}
606+
607+
7z a -snl "beellama-bin-win-sycl-x64.zip" "$bin\*"
608+
609+
- name: Upload SYCL backend
610+
uses: actions/upload-artifact@v6
611+
with:
612+
path: beellama-bin-win-sycl-x64.zip
613+
name: beellama-bin-win-sycl-x64.zip
614+
391615
windows-cuda:
392616
name: Windows x64 CUDA ${{ matrix.cuda }}
393617
needs: release-meta
@@ -579,7 +803,9 @@ jobs:
579803
- ubuntu-cpu
580804
- ubuntu-vulkan
581805
- ubuntu-rocm
806+
- ubuntu-sycl
582807
- windows-cpu
808+
- windows-sycl
583809
- windows-cuda
584810
- windows-hip
585811
runs-on: ubuntu-24.04
@@ -662,9 +888,11 @@ jobs:
662888
- [Ubuntu x64 (CPU)](${release_url}/beellama-${TAG_NAME}-bin-ubuntu-x64.tar.gz)
663889
- [Ubuntu x64 (Vulkan)](${release_url}/beellama-${TAG_NAME}-bin-ubuntu-vulkan-x64.tar.gz)
664890
- [Ubuntu x64 (ROCm 7.2)](${release_url}/beellama-${TAG_NAME}-bin-ubuntu-rocm-7.2-x64.tar.gz)
891+
- [Ubuntu x64 (SYCL)](${release_url}/beellama-${TAG_NAME}-bin-ubuntu-sycl-x64.tar.gz)
665892
666893
**Windows:**
667894
- [Windows x64 (CPU)](${release_url}/beellama-${TAG_NAME}-bin-win-cpu-x64.zip)
895+
- [Windows x64 (SYCL)](${release_url}/beellama-${TAG_NAME}-bin-win-sycl-x64.zip)
668896
- [Windows x64 (CUDA 12)](${release_url}/beellama-${TAG_NAME}-bin-win-cuda-12.4-x64.zip) - [CUDA 12.4 DLLs](${release_url}/beellama-${TAG_NAME}-cudart-win-cuda-12.4-x64.zip)
669897
- [Windows x64 (CUDA 13)](${release_url}/beellama-${TAG_NAME}-bin-win-cuda-13.1-x64.zip) - [CUDA 13.1 DLLs](${release_url}/beellama-${TAG_NAME}-cudart-win-cuda-13.1-x64.zip)
670898
- [Windows x64 (HIP)](${release_url}/beellama-${TAG_NAME}-bin-win-hip-radeon-x64.zip)
@@ -675,6 +903,7 @@ jobs:
675903
- \`${image_repo}:server-cuda13-${TAG_NAME}\`
676904
- \`${image_repo}:server-rocm-${TAG_NAME}\`
677905
- \`${image_repo}:server-vulkan-${TAG_NAME}\`
906+
- \`${image_repo}:server-sycl-${TAG_NAME}\`
678907
EOF
679908
680909
- name: Upload release assets

0 commit comments

Comments
 (0)