From 9c8e93aa5be9bb4709eedd5a969993345b1a4291 Mon Sep 17 00:00:00 2001 From: "Peter Y. Yeh" Date: Mon, 31 Mar 2025 14:28:09 -0700 Subject: [PATCH] Skip tests in `test_galore_quant.py` if CUDA is unavailable or ROCM is enabled, improving test reliability across different environments. --- test/quantization/test_galore_quant.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/quantization/test_galore_quant.py b/test/quantization/test_galore_quant.py index a67f7775b1..88caa5c0b8 100644 --- a/test/quantization/test_galore_quant.py +++ b/test/quantization/test_galore_quant.py @@ -13,6 +13,14 @@ except ImportError: # noqa: F401 pytest.skip("triton is not installed", allow_module_level=True) # noqa: F401 import torch + +# Skip entire test if CUDA is not available or ROCM is enabled +if not torch.cuda.is_available() or torch.version.hip is not None: + pytest.skip( + "CUDA is not available/ ROCM support is under development", + allow_module_level=True, + ) + from bitsandbytes.functional import ( create_dynamic_map, dequantize_blockwise,