From b8f51bc0f6019038ddc71eda0a55e1b8f5c4bfb8 Mon Sep 17 00:00:00 2001 From: Divin Honnappa Date: Fri, 26 Sep 2025 09:03:49 -0500 Subject: [PATCH] [release/2.9] skip convolution tests on Navi4x Cherry-pick of next(should be reverted as soons as wino conv kernels will be added to miopen, work in progress): [AUTOGENERATED] [release/2.8] skip convolution tests on Navi4x (#2675) Cherry-pick of https://github.com/ROCm/pytorch/pull/2055, but changed due to these testcases work on Navi3x as expected, for Navi4x these testcases skipped until support of next kernels will be added: * for test_freeze_conv_relu_fusion_not_forward and test_freeze_conv_relu_fusion: `ConvBinWinogradRxSf2x3g1Fused` * for test_cudnn_convolution_relu: `ConvBinWinogradRxSf2x3g1`, `ConvBinWinogradRxSf2x3g1Fused` and `ConvWinoFuryRxS<2-3>` --------- Co-authored-by: Dmitry Nikolaev <139769634+dnikolaev-amd@users.noreply.github.com> Co-authored-by: Artem Kuzmitckii (cherry picked from commit 245bf6edbc7e4b6aabbb4a218b518b853225956c) --- test/jit/test_freezing.py | 4 ++++ test/nn/test_convolution.py | 3 +++ 2 files changed, 7 insertions(+) diff --git a/test/jit/test_freezing.py b/test/jit/test_freezing.py index 8258124680b47..626b9412a7b4e 100644 --- a/test/jit/test_freezing.py +++ b/test/jit/test_freezing.py @@ -16,8 +16,10 @@ from torch.testing._internal.common_quantized import override_quantized_engine from torch.testing._internal.common_utils import ( raise_on_run_directly, + NAVI4_ARCH, set_default_dtype, skipCUDAMemoryLeakCheckIf, + skipIfRocmArch, skipIfTorchDynamo, TEST_WITH_ROCM, ) @@ -2967,6 +2969,7 @@ def test_conv_to_mkldnn_no_mkldnn(self): self.assertEqual(frozen(inp), mod(inp)) @unittest.skipIf(not (TEST_CUDNN or TEST_WITH_ROCM), "requires CUDNN") + @skipIfRocmArch(NAVI4_ARCH) # not supported by MIOPEN on NAVI4x def test_freeze_conv_relu_fusion(self): with set_default_dtype(torch.float): conv_bias = [True, False] @@ -3029,6 +3032,7 @@ def forward(self, x): self.assertEqual(mod_eager(inp), frozen_mod(inp)) @unittest.skipIf(not (TEST_CUDNN or TEST_WITH_ROCM), "requires CUDNN") + @skipIfRocmArch(NAVI4_ARCH) # not supported by MIOPEN on NAVI4x def test_freeze_conv_relu_fusion_not_forward(self): with set_default_dtype(torch.float): diff --git a/test/nn/test_convolution.py b/test/nn/test_convolution.py index b12c99e74686d..7dacfeed003cc 100644 --- a/test/nn/test_convolution.py +++ b/test/nn/test_convolution.py @@ -48,10 +48,12 @@ gradgradcheck, instantiate_parametrized_tests, MACOS_VERSION, + NAVI4_ARCH, parametrize as parametrize_test, run_tests, set_default_dtype, skipIfNotMiopenSuggestNHWC, + skipIfRocmArch, skipIfRocmVersionLessThan, subtest, TEST_SCIPY, @@ -3874,6 +3876,7 @@ def test_conv2d_no_grad(self, device, dtype): @onlyCUDA @skipCUDAIfNoCudnn + @skipIfRocmArch(NAVI4_ARCH) # not supported by MIOPEN on NAVI4x @dtypes(torch.float, torch.float16) @precisionOverride({torch.half: 0.002, torch.float: 1e-4}) def test_cudnn_convolution_relu(self, device, dtype):