Skip to content

Commit 48b9672

Browse files
Merge branch 'main' into compile-tests
2 parents f176eab + 503d243 commit 48b9672

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
@@ -135,6 +143,11 @@ jobs:
135143
pip install -e ".[test]"
136144
pip install pytest-cov
137145
146+
# We need to downgrade to numpy<2 for torch<2.3 compatibility.
147+
- name: Downgrade NumPy
148+
if: startsWith(matrix.torch_version, '2.2.')
149+
run: pip install "numpy<2"
150+
138151
- name: Show installed packages
139152
run: pip list
140153

@@ -144,7 +157,7 @@ jobs:
144157
- name: Run tests
145158
run: pytest --durations=100
146159

147-
# cuda-aarch64-tests:
160+
# test-cuda-aarch64:
148161
# if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
149162
# needs: build-cuda
150163
# strategy:
@@ -167,7 +180,7 @@ jobs:
167180

168181

169182

170-
cuda-tests:
183+
test-cuda:
171184
if: github.repository == 'bitsandbytes-foundation/bitsandbytes'
172185
needs: build-cuda
173186
strategy:
@@ -179,7 +192,7 @@ jobs:
179192
cuda_version: ["11.8.0", "12.6.3", "12.8.1"]
180193
include:
181194
- cuda_version: "11.8.0"
182-
torch_version: "2.4.1"
195+
torch_version: "2.2.2"
183196
pypi_index: "https://download.pytorch.org/whl/cu118"
184197
- cuda_version: "12.6.3"
185198
torch_version: "2.6.0"
@@ -238,6 +251,11 @@ jobs:
238251
pip install -e ".[test]"
239252
pip install pytest-cov
240253
254+
# We need to downgrade to numpy<2 for torch<2.3 compatibility.
255+
- name: Downgrade NumPy
256+
if: startsWith(matrix.torch_version, '2.2.')
257+
run: pip install "numpy<2"
258+
241259
- name: Show installed packages
242260
run: pip list
243261

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)