Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/scripts/build-xpu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
declare build_os

set -xeuo pipefail

# We currently only build XPU on Linux.
if [ "${build_os:0:6}" == ubuntu ]; then
# TODO: We might want to pre-build this as our own customized image in the future.
image=intel/deep-learning-essentials:2025.1.3-0-devel-ubuntu22.04
echo "Using image $image"
docker run --rm -i \
-w /src -v "$PWD:/src" "$image" sh -c \
"apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
cmake bison intel-fw-gpu intel-ocloc \
&& cmake -DCOMPUTE_BACKEND=xpu . \
&& cmake --build . --config Release"
fi

output_dir="output/${build_os}/x86_64"
mkdir -p "${output_dir}"
(shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} "${output_dir}")
19 changes: 19 additions & 0 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,24 @@ jobs:
path: output/*
retention-days: 7

build-shared-libs-xpu:
strategy:
matrix:
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build C++
run: bash .github/scripts/build-xpu.sh
env:
build_os: ${{ matrix.os }}
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: shared_library_xpu_${{ matrix.os }}_x86_64
path: output/*
retention-days: 7

build-shared-libs-rocm:
strategy:
matrix:
Expand Down Expand Up @@ -153,6 +171,7 @@ jobs:
- build-shared-libs
- build-shared-libs-cuda
- build-shared-libs-rocm
- build-shared-libs-xpu
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-latest]
Expand Down
Loading