Skip to content

Commit 318a86e

Browse files
Add CPU + IPEX to nightly CI (#1667)
* Tests: add linux x64 cpu+ipex to nightly CI workflow * typo * Tests: guard linear8bit compile test for ipex cpu issue
1 parent 945f7c1 commit 318a86e

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

.github/workflows/tests.yml

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,46 @@ jobs:
161161
- name: Run tests
162162
run: pytest --durations=100
163163

164+
test-cpu-ipex:
165+
if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
166+
needs: build-cpu
167+
runs-on: banb-aws-general-8-plus-use1-public-80
168+
env:
169+
BNB_TEST_DEVICE: cpu
170+
steps:
171+
- uses: actions/checkout@v4
172+
173+
- name: Download build artifact
174+
uses: actions/download-artifact@v4
175+
with:
176+
name: lib_cpu_ubuntu-22.04_x86_64
177+
path: bitsandbytes/
178+
merge-multiple: true
179+
180+
- name: Setup Python
181+
uses: actions/setup-python@v5
182+
with:
183+
python-version: 3.9
184+
185+
- name: Install dependencies
186+
run: |
187+
pip install torch==2.7.0 --index-url https://download.pytorch.org/whl/cpu
188+
pip install intel_extension_for_pytorch==2.7.0 --extra-index-url https://pytorch-extension.intel.com/release-whl/stable/cpu/us/
189+
pip install -e ".[test]"
190+
pip install pytest-cov
191+
192+
- name: Show installed packages
193+
run: pip list
194+
195+
- name: Show environment information
196+
run: python -m torch.utils.collect_env
197+
198+
- name: IPEX smoke test
199+
run: python -c "import torch; import intel_extension_for_pytorch as ipex; print(torch.__version__); print(ipex.__version__);"
200+
201+
- name: Run tests
202+
run: pytest --durations=100
203+
164204
# test-cuda-aarch64:
165205
# if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
166206
# needs: build-cuda
@@ -182,8 +222,6 @@ jobs:
182222
# - name: Show pip packages
183223
# run: pip list
184224

185-
186-
187225
test-cuda:
188226
if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
189227
needs: build-cuda

tests/test_linear8bitlt.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,14 @@ def test_linear8bitlt_torch_compile(device, threshold, bias, fullgraph, mode):
271271

272272
# Test with gradients. Currently only works with threshold=0.
273273
# Has a strange regression on Linux aarch64 CPU in torch==2.6.0.
274+
# There is also an issue with torch==2.7.0 on x86-64 with IPEX.
274275
is_broken_platform = (
275276
device == "cpu"
276-
and platform.machine() == "aarch64"
277277
and platform.system() == "Linux"
278-
and ((2, 7) > torch.__version__ >= (2, 6))
278+
and (
279+
(platform.machine() == "aarch64" and (2, 6) <= torch.__version__ < (2, 7))
280+
or (platform.machine() == "x86_64" and bnb.functional.ipex_cpu)
281+
)
279282
)
280283

281284
if threshold == 0 and not is_broken_platform:

0 commit comments

Comments
 (0)