From 75c89eaeb52ae2917016681b79511de4835c60a4 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Tue, 28 Jul 2026 22:22:39 +0000 Subject: [PATCH] amd: stop reporting the bitsandbytes PyPI fallback as broken --- install.sh | 5 +++-- studio/install_python_stack.py | 2 +- tests/python/test_cross_platform_parity.py | 14 +++++++++++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index bfe45a2c96..a770464a60 100755 --- a/install.sh +++ b/install.sh @@ -263,6 +263,7 @@ run_install_cmd_retry() { # pre-release URL is unreachable: 0.50.0 (2026-07-24) is the first PyPI release # carrying that fix, and its manylinux x86_64 wheel ships the same # libbitsandbytes_rocm{64,70,71,714,72}.so set as the pre-release. +_BNB_ROCM_PYPI_FALLBACK="bitsandbytes>=0.50.0" _install_bnb_rocm() { _label="$1" _venv_py="$2" @@ -304,10 +305,10 @@ _install_bnb_rocm() { fi rm -f "$_bnb_log" step "warning" "$_label (pre-release) failed (exit code $_bnb_rc)" "$C_WARN" >&2 - substep "[WARN] bnb pre-release install failed; falling back to PyPI (4-bit decode broken on ROCm)" "$C_WARN" + substep "[WARN] bnb pre-release install failed; falling back to PyPI $_BNB_ROCM_PYPI_FALLBACK, which carries the ROCm 4-bit fix" "$C_WARN" fi run_install_cmd "$_label (pypi fallback)" "$_venv_py" -m pip install \ - --force-reinstall --no-cache-dir --no-deps "bitsandbytes>=0.50.0" + --force-reinstall --no-cache-dir --no-deps "$_BNB_ROCM_PYPI_FALLBACK" } if [ "$_next_is_package" = true ]; then diff --git a/studio/install_python_stack.py b/studio/install_python_stack.py index c4d9c1049f..adb1420941 100644 --- a/studio/install_python_stack.py +++ b/studio/install_python_stack.py @@ -2025,7 +2025,7 @@ def _ensure_rocm_torch() -> None: print( _red( " bnb pre-release install failed; falling back to PyPI " - "(4-bit decode will be broken on ROCm)" + f"{_BNB_ROCM_PYPI_FALLBACK}, which carries the ROCm 4-bit fix" ) ) if not _bnb_installed: diff --git a/tests/python/test_cross_platform_parity.py b/tests/python/test_cross_platform_parity.py index 818473bb02..9a183d2b4e 100644 --- a/tests/python/test_cross_platform_parity.py +++ b/tests/python/test_cross_platform_parity.py @@ -833,7 +833,7 @@ class TestAmdBnbFloorParity: def test_install_sh_pypi_fallback_floor(self): text = INSTALL_SH.read_text(encoding = "utf-8") assert ( - f'"bitsandbytes>={self.FLOOR}"' in text + f'_BNB_ROCM_PYPI_FALLBACK="bitsandbytes>={self.FLOOR}"' in text ), f"install.sh _install_bnb_rocm PyPI fallback must floor at {self.FLOOR}" def test_stack_py_pypi_fallback_floor(self): @@ -864,3 +864,15 @@ class TestAmdBnbFloorParity: raise AssertionError( f"{path.name} still floors bitsandbytes in the broken ROCm range: {line.strip()!r}" ) + + def test_fallback_is_not_reported_as_broken(self): + """The fallback now installs the first fixed release, so neither installer may + still tell the user it leaves 4-bit decode broken on ROCm.""" + for path in (INSTALL_SH, STACK_PY): + text = path.read_text(encoding = "utf-8") + assert ( + "4-bit decode broken on ROCm" not in text + ), f"{path.name} still reports the repaired PyPI fallback as broken" + assert ( + "4-bit decode will be broken on ROCm" not in text + ), f"{path.name} still reports the repaired PyPI fallback as broken"