Skip to content

Commit b3ba0b5

Browse files
committed
fix format issue
1 parent 32e451a commit b3ba0b5

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

test/prototype/mx_formats/test_nvfp4_tensor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
from torchao.quantization.utils import compute_error
2323
from torchao.testing.utils import skip_if_rocm
2424
from torchao.utils import (
25+
get_current_accelerator_device,
2526
is_sm_at_least_100,
2627
torch_version_at_least,
27-
get_current_accelerator_device,
2828
)
2929

3030
torch.manual_seed(2)
@@ -456,7 +456,11 @@ def test_nvfp4_matmul_with_amax(
456456
shapes: tuple,
457457
):
458458
# DYNAMIC mode requires SM100+, but WEIGHT_ONLY works on older GPUs
459-
if quant_type == "dynamic" and torch.cuda.is_available() and not is_sm_at_least_100():
459+
if (
460+
quant_type == "dynamic"
461+
and torch.cuda.is_available()
462+
and not is_sm_at_least_100()
463+
):
460464
pytest.skip("CUDA capability >= 10.0 required for DYNAMIC float4 gemm")
461465

462466
if bias and inpt_dtype == torch.float32:

test/prototype/test_spinquant.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ def _init_model(name="7B", device="cpu", precision=torch.bfloat16):
1616
return model.eval()
1717

1818

19-
_AVAILABLE_DEVICES = ["cpu"] + (["cuda"] if torch.cuda.is_available() else []) + (["xpu"] if torch.xpu.is_available() else [])
19+
_AVAILABLE_DEVICES = (
20+
["cpu"]
21+
+ (["cuda"] if torch.cuda.is_available() else [])
22+
+ (["xpu"] if torch.xpu.is_available() else [])
23+
)
2024

2125

2226
@pytest.mark.parametrize("device", _AVAILABLE_DEVICES)

0 commit comments

Comments
 (0)