Skip to content

Commit 59ec4b9

Browse files
committed
Merge upstream/main into IFU-master-2025-06-04
2 parents 47ac97d + 76d3e2b commit 59ec4b9

40 files changed

Lines changed: 1614 additions & 1013 deletions

.github/workflows/python-package.yml

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,15 @@ jobs:
218218
merge-multiple: true
219219

220220
- name: Inspect tmp directory after downloading artifacts
221-
run: ls -alFR tmp/
221+
222+
run: |
223+
ls -alFR tmp/
224+
WHEEL_COUNT=$(find tmp/ -type f -name "*.whl" | wc -l)
225+
echo "Found $WHEEL_COUNT wheel files"
226+
if [ "$WHEEL_COUNT" -eq 0 ]; then
227+
echo "::error::No wheel files found in tmp directory! Cannot proceed with release."
228+
exit 1
229+
fi
222230
223231
- name: Move and rename wheel files with pattern replacement
224232
run: |
@@ -245,16 +253,28 @@ jobs:
245253
- name: Inspect wheels directory after renaming files
246254
run: ls -alFR wheels/
247255

256+
- uses: actions/checkout@v4
257+
with:
258+
path: repo
259+
248260
- name: Delete old pre-release (if exists)
249261
run: |
250-
gh release delete continuous-release_main --cleanup-tag -y || true
262+
cd repo && gh release delete continuous-release_main --cleanup-tag -y
263+
env:
264+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
265+
266+
- name: Ensure tag exists
267+
run: |
268+
cd repo
269+
git tag -f continuous-release_main
270+
git push -f origin continuous-release_main
251271
env:
252272
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
253273

254274
- name: Generate pip install commands for release body
255275
run: |
256276
cat > body.md << 'ENDOFMARKDOWN'
257-
## Latest `main` Wheel Pre-release
277+
## Latest `main` pre-release wheel
258278
259279
This pre-release contains the latest development wheels for all supported platforms, rebuilt automatically on every commit to the `main` branch.
260280
@@ -266,15 +286,34 @@ jobs:
266286
for whl in wheels/*.whl; do
267287
fname=$(basename "$whl")
268288
url="https://github.com/bitsandbytes-foundation/bitsandbytes/releases/download/continuous-release_main/$fname"
289+
290+
if [[ "$fname" == *"manylinux_2_24_x86_64"* ]]; then
291+
echo "### Linux (x86_64)" >> body.md
292+
elif [[ "$fname" == *"manylinux_2_24_aarch64"* ]]; then
293+
echo "### Linux (ARM/aarch64)" >> body.md
294+
elif [[ "$fname" == *"win_amd64"* ]]; then
295+
echo "### Windows (x86_64)" >> body.md
296+
else
297+
echo "### Other platform" >> body.md
298+
fi
299+
269300
echo "\`\`\`sh" >> body.md
270-
echo "pip install $url" >> body.md
301+
echo "pip install --force-reinstall $url" >> body.md
271302
echo "\`\`\`" >> body.md
272303
echo "" >> body.md
273304
done
274305
275306
cat >> body.md << 'ENDOFMARKDOWN'
276307
> **Note:**
277308
> These wheels are updated automatically with every commit to `main` and become available as soon as the [python-package.yml](.github/workflows/python-package.yml) workflow finishes.
309+
310+
The version number is replaced with 1.33.7-preview in order to keep the link stable, this however does not affect the installed version at all:
311+
```
312+
> pip install https://.../bitsandbytes-1.33.7-preview-py3-none-manylinux_2_24_x86_64.whl
313+
Collecting bitsandbytes==1.33.7rc0
314+
...
315+
Successfully installed bitsandbytes-0.46.0.dev0
316+
```
278317
ENDOFMARKDOWN
279318
280319
# for debugging:
@@ -290,7 +329,6 @@ jobs:
290329
tag_name: continuous-release_main
291330
make_latest: false
292331
draft: false
293-
target_commitish: ${{ github.sha }}
294332

295333
audit-wheels:
296334
needs: build-wheels

.github/workflows/tests.yml

Lines changed: 130 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
build-cuda:
5050
strategy:
5151
matrix:
52-
cuda_version: ["11.8.0", "12.8.1"]
52+
cuda_version: ["11.8.0", "12.6.3", "12.8.1"]
5353
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025]
5454
include:
5555
- os: ubuntu-22.04
@@ -93,24 +93,32 @@ jobs:
9393
path: output/${{ matrix.os }}/${{ matrix.arch }}/*
9494
retention-days: 7
9595

96-
cpu-tests:
96+
test-cpu:
9797
if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
9898
needs: build-cpu
9999
strategy:
100100
fail-fast: false
101101
matrix:
102102
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025, macos-15]
103-
torch_version: ["2.7.0"]
103+
# Test with the oldest supported torch version and the two newest.
104+
torch_version: ["2.2.2", "2.6.0", "2.7.0"]
104105
include:
105106
- os: ubuntu-22.04
106107
arch: x86_64
107108
runner: banb-aws-general-8-plus-use1-public-80
108109
- os: ubuntu-22.04-arm
109110
arch: aarch64
111+
- os: ubuntu-22.04-arm
112+
arch: aarch64
113+
torch_version: "2.5.1"
110114
- os: windows-2025
111115
arch: x86_64
112116
- os: macos-15
113117
arch: arm64
118+
exclude:
119+
- os: ubuntu-22.04-arm
120+
torch_version: "2.2.2"
121+
114122
runs-on: ${{ matrix.runner || matrix.os }}
115123
env:
116124
BNB_TEST_DEVICE: cpu
@@ -129,57 +137,157 @@ jobs:
129137
with:
130138
python-version: 3.9
131139

140+
- name: Setup MSVC
141+
if: startsWith(matrix.os, 'windows')
142+
uses: ilammy/msvc-dev-cmd@v1.13.0 # to use cl for torch.compile
143+
132144
- name: Install dependencies
133145
run: |
134146
pip install torch==${{ matrix.torch_version }} --index-url https://download.pytorch.org/whl/cpu
135147
pip install -e ".[test]"
136148
pip install pytest-cov
137149
150+
# We need to downgrade to numpy<2 for torch<2.3 compatibility.
151+
- name: Downgrade NumPy
152+
if: startsWith(matrix.torch_version, '2.2.')
153+
run: pip install "numpy<2"
154+
138155
- name: Show installed packages
139156
run: pip list
140157

158+
- name: Show environment information
159+
run: python -m torch.utils.collect_env
160+
141161
- name: Run tests
142162
run: pytest --durations=100
143163

144-
cuda-tests:
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+
204+
# test-cuda-aarch64:
205+
# if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
206+
# needs: build-cuda
207+
# strategy:
208+
# fail-fast: false
209+
# matrix:
210+
# os: [ubuntu-22.04-arm]
211+
# arch: [aarch64]
212+
# torch_version: ["2.7.0"]
213+
# cuda_version: ["11.8.0", "12.8.1"]
214+
215+
# runs-on: bandb-aws-g5g-4xlarge-plus-use1-public-80
216+
# env:
217+
# BNB_TEST_DEVICE: cuda
218+
# steps:
219+
# - name: Show GPU Information
220+
# run: nvidia-smi
221+
222+
# - name: Show pip packages
223+
# run: pip list
224+
225+
test-cuda:
145226
if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
146227
needs: build-cuda
147228
strategy:
148229
fail-fast: false
149230
matrix:
150231
os: [ubuntu-22.04, windows-2025]
151232
arch: [x86_64]
152-
gpu: [T4, L4]
153-
cuda_version: ["11.8.0", "12.8.1"]
233+
gpu: [T4, L40S]
234+
cuda_version: ["11.8.0", "12.6.3", "12.8.1"]
154235
include:
155236
- cuda_version: "11.8.0"
156-
torch_version: "2.4.1"
237+
torch_version: "2.2.2"
157238
pypi_index: "https://download.pytorch.org/whl/cu118"
239+
- cuda_version: "12.6.3"
240+
torch_version: "2.6.0"
241+
pypi_index: "https://download.pytorch.org/whl/cu126"
158242
- cuda_version: "12.8.1"
159243
torch_version: "2.7.0"
160244
pypi_index: "https://download.pytorch.org/whl/cu128"
161245

162-
# L4 runners
246+
247+
# Linux L40S runners
163248
- os: ubuntu-22.04
164-
gpu: L4
165-
runner: bandb-aws-g6-4xlarge-plus-use1-public-80
249+
gpu: L40S
250+
runner: bandb-aws-g6e-4xlarge-plus-use1-public-80
166251

167-
# T4 runners
252+
# Linux T4 runners
168253
- os: ubuntu-22.04
169254
gpu: T4
170-
runner: CUDA-Linux-x64
255+
runner: bandb-aws-g4dn-4xlarge-plus-use1-public-80
256+
257+
# Specific Windows runners using cu118
171258
- os: windows-2025
259+
arch: x86_64
172260
gpu: T4
173261
runner: CUDA-Windows-x64
262+
cuda_version: "11.8.0"
263+
torch_version: "2.2.0"
264+
pypi_index: "https://download.pytorch.org/whl/cu118"
265+
- os: windows-2025
266+
arch: x86_64
267+
gpu: T4
268+
runner: CUDA-Windows-x64
269+
cuda_version: "11.8.0"
270+
torch_version: "2.6.0"
271+
pypi_index: "https://download.pytorch.org/whl/cu118"
272+
- os: windows-2025
273+
arch: x86_64
274+
gpu: T4
275+
runner: CUDA-Windows-x64
276+
cuda_version: "11.8.0"
277+
torch_version: "2.7.0"
278+
pypi_index: "https://download.pytorch.org/whl/cu118"
279+
174280
exclude:
175281
# Our current T4 Windows runner has a driver too old (471.11)
176282
# and cannot support CUDA 12+. Skip for now.
177283
- os: windows-2025
178284
cuda_version: "12.8.1"
285+
- os: windows-2025
286+
cuda_version: "12.6.3"
179287

180-
# No Windows L4 runners.
288+
# No Windows L40S runners.
181289
- os: windows-2025
182-
gpu: L4
290+
gpu: L40S
183291
runs-on: ${{ matrix.runner }}
184292
env:
185293
BNB_TEST_DEVICE: cuda
@@ -207,8 +315,16 @@ jobs:
207315
pip install -e ".[test]"
208316
pip install pytest-cov
209317
318+
# We need to downgrade to numpy<2 for torch<2.3 compatibility.
319+
- name: Downgrade NumPy
320+
if: startsWith(matrix.torch_version, '2.2.')
321+
run: pip install "numpy<2"
322+
210323
- name: Show installed packages
211324
run: pip list
212325

326+
- name: Show environment information
327+
run: python -m torch.utils.collect_env
328+
213329
- name: Run tests
214330
run: pytest --durations=100

0 commit comments

Comments
 (0)