Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Enable ipex xpu op #2

Closed
wants to merge 22 commits into from
Closed
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
16 changes: 8 additions & 8 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,42 +53,42 @@ jobs:
# - "3.13"
steps:
- uses: actions/checkout@v4

- name: Checkout bitsandbytes
uses: actions/checkout@v4
with:
repository: bitsandbytes-foundation/bitsandbytes
path: bitsandbytes

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip

- name: Install build tools
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake

- name: Compile bitsandbytes with CPU backend
run: |
cd bitsandbytes
cmake -DCOMPUTE_BACKEND=cpu -S . && make
cd ..

- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist/

- name: Install dependencies and built package
run: |
python -m pip install --upgrade pip
pip install ./bitsandbytes
pip install dist/*.whl

- name: Test import works
run: |
python -c "
Expand All @@ -98,7 +98,7 @@ jobs:
print('✅ bitsandbytes_intel import successful')
print('✅ All imports successful - no XPU operations tested, as for that we would need to configure the XPU runner..')
"

# - name: Test with pytest
# run: pytest

Expand Down
13 changes: 6 additions & 7 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,13 @@ RUN pip install --no-cache-dir \
ruff

# Then install PyTorch-dependent packages with constraint to use existing torch
RUN pip install --no-cache-dir \
--extra-index-url https://download.pytorch.org/whl/xpu \
-C torch==2.6.0+xpu \
transformers \
accelerate \
bitsandbytes
RUN pip install transformers accelerate bitsandbytes

# Copy the bitsandbytes-intel repository into /workspace/src/bnb and install it.
COPY .. ${WORKSPACE}/src/bnb
RUN cd ${WORKSPACE}/src/bnb && pip install .

COPY --chmod=755 docker/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

CMD ["sleep", "infinity"]
CMD ["sleep", "infinity"]
2 changes: 1 addition & 1 deletion docker/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ set -euo pipefail
pip install --no-deps -e /workspace/src/bnb
pip install --no-deps -e /workspace/src/bnb_intel

exec "$@"
exec "$@"
Loading