Skip to content

Commit 09ea861

Browse files
Build/Package Intel XPU binary for Linux (#1763)
* Intel XPU: build and package binary for Linux * Update artifact name
1 parent b72b766 commit 09ea861

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

.github/scripts/build-xpu.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
declare build_os
3+
4+
set -xeuo pipefail
5+
6+
# We currently only build XPU on Linux.
7+
if [ "${build_os:0:6}" == ubuntu ]; then
8+
# TODO: We might want to pre-build this as our own customized image in the future.
9+
image=intel/deep-learning-essentials:2025.1.3-0-devel-ubuntu22.04
10+
echo "Using image $image"
11+
docker run --rm -i \
12+
-w /src -v "$PWD:/src" "$image" sh -c \
13+
"apt-get update \
14+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
15+
cmake bison intel-fw-gpu intel-ocloc \
16+
&& cmake -DCOMPUTE_BACKEND=xpu . \
17+
&& cmake --build . --config Release"
18+
fi
19+
20+
output_dir="output/${build_os}/x86_64"
21+
mkdir -p "${output_dir}"
22+
(shopt -s nullglob && cp bitsandbytes/*.{so,dylib,dll} "${output_dir}")

.github/workflows/python-package.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,24 @@ jobs:
104104
path: output/*
105105
retention-days: 7
106106

107+
build-shared-libs-xpu:
108+
strategy:
109+
matrix:
110+
os: [ubuntu-22.04]
111+
runs-on: ${{ matrix.os }}
112+
steps:
113+
- uses: actions/checkout@v4
114+
- name: Build C++
115+
run: bash .github/scripts/build-xpu.sh
116+
env:
117+
build_os: ${{ matrix.os }}
118+
- name: Upload build artifact
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: shared_library_xpu_${{ matrix.os }}_x86_64
122+
path: output/*
123+
retention-days: 7
124+
107125
build-shared-libs-rocm:
108126
strategy:
109127
matrix:
@@ -153,6 +171,7 @@ jobs:
153171
- build-shared-libs
154172
- build-shared-libs-cuda
155173
- build-shared-libs-rocm
174+
- build-shared-libs-xpu
156175
strategy:
157176
matrix:
158177
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-latest, macos-latest]

0 commit comments

Comments
 (0)