Skip to content

Commit 9902d84

Browse files
authored
Skips for ROCm (X86 Inductor Tests) (#2202)
* Refactor ROCm skip decorators in quantization tests Updated the skip decorators for ROCm in the quantization test suite to use the new `skip_if_rocm` utility, providing more descriptive messages for each test case. This change enhances clarity regarding ROCm support status in the tests. * Reorganize ROCm skip decorator import in quantization tests Moved the import statement for `skip_if_rocm` to maintain consistency in the test file structure. This change ensures that the utility is properly utilized in the context of the x86 Inductor quantization tests. * Update ROCm skip decorator message in quantization test Changed the message for the `skip_if_rocm` decorator in the `test_qat_qconv2d` test case to clarify that ROCm support is not applicable, enhancing the clarity of the test's intent.
1 parent 846b433 commit 9902d84

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/quantization/pt2e/test_x86inductor_fusion.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
IS_X86,
2929
instantiate_parametrized_tests,
3030
parametrize,
31-
skipIfRocm,
3231
)
3332
from torch.testing._internal.inductor_utils import (
3433
HAS_CPU,
@@ -45,6 +44,7 @@
4544
from torchao.quantization.pt2e.quantizer.x86_inductor_quantizer import (
4645
X86InductorQuantizer,
4746
)
47+
from torchao.testing.utils import skip_if_rocm
4848
from torchao.utils import (
4949
TORCH_VERSION_AT_LEAST_2_6,
5050
TORCH_VERSION_AT_LEAST_2_8,
@@ -328,7 +328,7 @@ def matcher_check_fn():
328328

329329
@skipIfNoDynamoSupport
330330
@skipIfNoONEDNN
331-
@skipIfRocm
331+
@skip_if_rocm("Not applicable to ROCm")
332332
def test_qconv2d_cpu(self):
333333
r"""
334334
This testcase will quantize a single Conv2d module.
@@ -338,7 +338,7 @@ def test_qconv2d_cpu(self):
338338
@skipIfNoDynamoSupport
339339
@skipIfNoONEDNNBF16
340340
@skipIfNoONEDNN
341-
@skipIfRocm
341+
@skip_if_rocm("Not applicable to ROCm")
342342
def test_qconv2d_int8_mixed_bf16(self):
343343
r"""
344344
This testcase will quantize a single Conv2d module with int8_mixed_bf16 quantization.
@@ -932,7 +932,7 @@ def matcher_check_fn():
932932

933933
@skipIfNoDynamoSupport
934934
@skipIfNoONEDNN
935-
@skipIfRocm
935+
@skip_if_rocm("Not applicable to ROCm")
936936
def test_qat_qconv2d(self):
937937
r"""
938938
This testcase will quantize a single Conv2d module with qat flow.
@@ -1075,7 +1075,7 @@ def test_qat_qconv2d_hardswish(self):
10751075

10761076
@skipIfNoDynamoSupport
10771077
@skipIfNoONEDNN
1078-
@skipIfRocm
1078+
@skip_if_rocm("Not applicable to ROCm")
10791079
def test_qat_qconv2d_add(self):
10801080
r"""
10811081
This testcase will quantize a Conv2d->Add pattern as:
@@ -1141,7 +1141,7 @@ def matcher_check_fn():
11411141

11421142
@skipIfNoDynamoSupport
11431143
@skipIfNoONEDNN
1144-
@skipIfRocm
1144+
@skip_if_rocm("Not applicable to ROCm")
11451145
def test_qat_qconv2d_add_relu(self):
11461146
r"""
11471147
This testcase will quantize a Conv2d->Add->ReLU pattern as:
@@ -1281,7 +1281,7 @@ def matcher_check_fn():
12811281

12821282
@skipIfNoDynamoSupport
12831283
@skipIfNoONEDNN
1284-
@skipIfRocm
1284+
@skip_if_rocm("Not applicable to ROCm")
12851285
def test_qconv2d_dequant_promotion_cpu(self):
12861286
self._test_qconv2d_dequant_promotion_helper()
12871287

0 commit comments

Comments
 (0)