Skip to content

Enable ipex xpu op #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
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