Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
matrix:
os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025, macos-15]
# Test with the oldest supported torch version, the newest two stable/RC.
torch_version: ["2.2.2", "2.7.1", "2.8.0"]
torch_version: ["2.3.1", "2.7.1", "2.8.0"]
include:
- os: ubuntu-22.04
arch: x86_64
Expand All @@ -118,7 +118,7 @@ jobs:
arch: arm64
exclude:
- os: ubuntu-22.04-arm
torch_version: "2.2.2"
torch_version: "2.3.1"

runs-on: ${{ matrix.runner || matrix.os }}
env:
Expand All @@ -144,13 +144,14 @@ jobs:

- name: Install dependencies
run: |
pip install torch==${{ matrix.torch_version }} --index-url https://download.pytorch.org/whl/${{ (matrix.torch_version == '2.8.0' && 'test/cpu') || 'cpu' }}
pip install torch==${{ matrix.torch_version }} --index-url https://download.pytorch.org/whl/cpu
pip install -e ".[test]"
pip install pytest-cov

# We need to downgrade to numpy<2 for torch<2.3 compatibility.
# We need to downgrade to numpy<2 for torch<2.4.1 compatibility on Windows
# See: https://github.com/pytorch/pytorch/issues/131668
- name: Downgrade NumPy
if: startsWith(matrix.torch_version, '2.2.')
if: startsWith(matrix.os, 'windows') && startsWith(matrix.torch_version, '2.3.')
run: pip install "numpy<2"

- name: Show installed packages
Expand Down Expand Up @@ -345,7 +346,7 @@ jobs:
cuda_version: ["11.8.0", "12.6.3", "12.8.1", "12.9.1"]
include:
- cuda_version: "11.8.0"
torch_version: "2.2.2"
torch_version: "2.3.1"
pypi_index: "https://download.pytorch.org/whl/cu118"
- cuda_version: "12.6.3"
torch_version: "2.6.0"
Expand Down Expand Up @@ -374,7 +375,7 @@ jobs:
gpu: T4
runner: CUDA-Windows-x64
cuda_version: "11.8.0"
torch_version: "2.2.0"
torch_version: "2.3.1"
pypi_index: "https://download.pytorch.org/whl/cu118"
- os: windows-2025
arch: x86_64
Expand Down Expand Up @@ -430,12 +431,6 @@ jobs:
pip install --pre torch~=${{ matrix.torch_version }}.dev0 --index-url ${{ matrix.pypi_index }}
pip install -e ".[test]"
pip install pytest-cov

# We need to downgrade to numpy<2 for torch<2.3 compatibility.
- name: Downgrade NumPy
if: startsWith(matrix.torch_version, '2.2.')
run: pip install "numpy<2"

- name: Show installed packages
run: pip list

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ The library includes quantization primitives for 8-bit & 4-bit operations, throu
bitsandbytes has the following minimum requirements for all platforms:

* Python 3.9+
* [PyTorch](https://pytorch.org/get-started/locally/) 2.2+
* [PyTorch](https://pytorch.org/get-started/locally/) 2.3+
* _Note: While we aim to provide wide backwards compatibility, we recommend using the latest version of PyTorch for the best experience._

#### Accelerator support:
Expand Down
6 changes: 1 addition & 5 deletions bitsandbytes/autograd/_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,7 @@ def get_inverse_transform_indices(
return permuted_tile_indices


# torch.compiler.is_compiling() is available only in torch >= 2.3
if hasattr(torch.compiler, "is_compiling"):
_is_compiling = torch.compiler.is_compiling
else:
_is_compiling = torch._dynamo.is_compiling
_is_compiling = torch.compiler.is_compiling


@deprecated(
Expand Down
7 changes: 2 additions & 5 deletions bitsandbytes/triton/triton_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@
@functools.lru_cache(None)
def is_triton_available():
try:
# torch>=2.2.0
from torch.utils._triton import has_triton, has_triton_package

return has_triton_package() and has_triton()
except ImportError:
from torch._inductor.utils import has_triton

return has_triton()
except Exception:
return False
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Artificial Intelligence"
]
dependencies = [
"torch>=2.2,<3",
"torch>=2.3,<3",
"numpy>=1.17",
"packaging>=20.9"
]
Expand Down
3 changes: 0 additions & 3 deletions tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -1413,9 +1413,6 @@ def test_gemv_4bit(self, device, dim, dtype, storage_type, quant_storage, double
reason="this test is not supported on ROCm with gfx90a architecture yet",
)
def test_gemv_eye_4bit(self, device, storage_type, dtype):
if device == "cpu" and dtype == torch.bfloat16 and torch.__version__ < (2, 3):
pytest.skip("eye doe not support bfloat16 on CPU in torch < 2.3")

if device == "hpu" and not is_supported_on_hpu(storage_type, dtype):
pytest.skip("This configuration is not supported on HPU.")

Expand Down
Loading