Skip to content

Commit 3e8c348

Browse files
Merge branch 'compile-tests' of https://github.com/TimDettmers/bitsandbytes into compile-tests
2 parents 9c49d09 + 48b9672 commit 3e8c348

File tree

10 files changed

+62
-400
lines changed

10 files changed

+62
-400
lines changed

.github/workflows/tests.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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.6.0", "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
@@ -139,6 +147,11 @@ jobs:
139147
pip install -e ".[test]"
140148
pip install pytest-cov
141149
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+
142155
- name: Show installed packages
143156
run: pip list
144157

@@ -148,7 +161,7 @@ jobs:
148161
- name: Run tests
149162
run: pytest --durations=100
150163

151-
# cuda-aarch64-tests:
164+
# test-cuda-aarch64:
152165
# if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
153166
# needs: build-cuda
154167
# strategy:
@@ -171,7 +184,7 @@ jobs:
171184

172185

173186

174-
cuda-tests:
187+
test-cuda:
175188
if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
176189
needs: build-cuda
177190
strategy:
@@ -183,7 +196,7 @@ jobs:
183196
cuda_version: ["11.8.0", "12.6.3", "12.8.1"]
184197
include:
185198
- cuda_version: "11.8.0"
186-
torch_version: "2.4.1"
199+
torch_version: "2.2.2"
187200
pypi_index: "https://download.pytorch.org/whl/cu118"
188201
- cuda_version: "12.6.3"
189202
torch_version: "2.6.0"
@@ -251,6 +264,11 @@ jobs:
251264
pip install -e ".[test]"
252265
pip install pytest-cov
253266
267+
# We need to downgrade to numpy<2 for torch<2.3 compatibility.
268+
- name: Downgrade NumPy
269+
if: startsWith(matrix.torch_version, '2.2.')
270+
run: pip install "numpy<2"
271+
254272
- name: Show installed packages
255273
run: pip list
256274

benchmarking/int8/row_scale_benchmark.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

bitsandbytes/optim/optimizer.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -303,9 +303,9 @@ def get_config(self, gindex, pindex, group):
303303
config["eps"] = group["eps"]
304304
config["weight_decay"] = group["weight_decay"]
305305
config["lr"] = group["lr"]
306-
config["alpha"] = group.get("alpha")
307-
config["t_alpha"] = group.get("t_alpha")
308-
config["t_beta3"] = group.get("t_beta3")
306+
config["alpha"] = group.get("alpha", 0.0)
307+
config["t_alpha"] = group.get("t_alpha", 0)
308+
config["t_beta3"] = group.get("t_beta3", 0)
309309
config["optim_bits"] = self.args.optim_bits
310310
config["min_8bit_size"] = self.args.min_8bit_size
311311
config["percentile_clipping"] = self.args.percentile_clipping
@@ -530,7 +530,7 @@ def update_step(self, group, p, gindex, pindex):
530530
state["state2"],
531531
config["betas"][1],
532532
config["betas"][2] if len(config["betas"]) >= 3 else 0.0,
533-
config["alpha"],
533+
config.get("alpha", 0.0),
534534
config["weight_decay"],
535535
gnorm_scale,
536536
state["unorm_vec"] if config["max_unorm"] > 0.0 else None,
@@ -575,7 +575,7 @@ def update_step(self, group, p, gindex, pindex):
575575
config["betas"][0],
576576
config["betas"][1],
577577
config["betas"][2] if len(config["betas"]) >= 3 else 0.0,
578-
config["alpha"],
578+
config.get("alpha", 0.0),
579579
config["eps"],
580580
step,
581581
config["lr"],

0 commit comments

Comments
 (0)