From 68d8585586da8b1e9e85c40f9461526632c25c37 Mon Sep 17 00:00:00 2001 From: Angel Li Date: Mon, 18 Aug 2025 07:22:07 -0700 Subject: [PATCH 1/3] fixing torchao rocm ci test --- .../int4/test_int4_marlin_sparse_tensor.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py b/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py index 443a2c149b..0ef43a4173 100644 --- a/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py +++ b/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py @@ -9,21 +9,18 @@ import torch from torch.testing._internal.common_utils import ( - TestCase, instantiate_parametrized_tests, parametrize, run_tests, + TestCase, ) -from torchao.quantization import ( - Int4WeightOnlyConfig, - quantize_, -) +from torchao.quantization import Int4WeightOnlyConfig, quantize_ from torchao.quantization.utils import compute_error from torchao.sparsity.sparse_api import apply_fake_sparsity -from torchao.utils import ( - TORCH_VERSION_AT_LEAST_2_8, -) + +from torchao.utils import TORCH_VERSION_AT_LEAST_2_8 +from torchao.testing.utils import skip_if_rocm BF16_ACT_CONFIG = Int4WeightOnlyConfig( group_size=128, @@ -38,6 +35,7 @@ class TestInt4MarlinSparseTensor(TestCase): def setUp(self): self.GPU_DEVICES = ["cuda"] if torch.cuda.is_available() else [] + @skip_if_rocm("ROCm enablement in progress") @parametrize("config", [BF16_ACT_CONFIG]) @parametrize( "sizes", From 6c99110b672708ab233bfbbc27a31af4418f9bcf Mon Sep 17 00:00:00 2001 From: Angel Li Date: Mon, 18 Aug 2025 08:29:58 -0700 Subject: [PATCH 2/3] formatting --- .../workflows/int4/test_int4_marlin_sparse_tensor.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py b/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py index 0ef43a4173..f50d2f939d 100644 --- a/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py +++ b/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py @@ -9,18 +9,22 @@ import torch from torch.testing._internal.common_utils import ( + TestCase, instantiate_parametrized_tests, parametrize, run_tests, - TestCase, ) -from torchao.quantization import Int4WeightOnlyConfig, quantize_ +from torchao.quantization import ( + Int4WeightOnlyConfig, + quantize_, +) from torchao.quantization.utils import compute_error from torchao.sparsity.sparse_api import apply_fake_sparsity - -from torchao.utils import TORCH_VERSION_AT_LEAST_2_8 from torchao.testing.utils import skip_if_rocm +from torchao.utils import ( + TORCH_VERSION_AT_LEAST_2_8, +) BF16_ACT_CONFIG = Int4WeightOnlyConfig( group_size=128, From 7832a99b17f43890dad0e5e6c61392b7bb352746 Mon Sep 17 00:00:00 2001 From: Angel Li Date: Mon, 18 Aug 2025 09:00:02 -0700 Subject: [PATCH 3/3] add to other tests --- .../quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py b/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py index f50d2f939d..de7cd35feb 100644 --- a/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py +++ b/test/quantization/quantize_/workflows/int4/test_int4_marlin_sparse_tensor.py @@ -67,6 +67,7 @@ def test_linear(self, config, sizes): quantized_and_compiled = compiled_linear(input) self.assertTrue(compute_error(original, quantized_and_compiled) > 20) + @skip_if_rocm("ROCm enablement in progress") @unittest.skip("Fix later") @parametrize("config", [BF16_ACT_CONFIG]) def test_to_device(self, config): @@ -83,6 +84,7 @@ def test_to_device(self, config): quantize_(linear, config) linear.to(device) + @skip_if_rocm("ROCm enablement in progress") @parametrize("config", [BF16_ACT_CONFIG]) def test_module_path(self, config): linear = torch.nn.Linear(128, 256, dtype=torch.bfloat16)