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