Skip to content

Commit 89a218d

Browse files
dnikolaev-amdAMD AMD
authored andcommitted
Cherry-picked commit with merge conflict
1 parent bd74018 commit 89a218d

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

test/jit/test_freezing.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515
from torch.testing._internal.common_quantization import skipIfNoFBGEMM
1616
from torch.testing._internal.common_quantized import override_quantized_engine
1717
from torch.testing._internal.common_utils import (
18+
<<<<<<< HEAD
1819
raise_on_run_directly,
20+
=======
21+
NAVI_ARCH,
22+
>>>>>>> 3b9e558b7c ([release/2.6] skip convolution tests on Navi (#2055))
1923
set_default_dtype,
2024
skipCUDAMemoryLeakCheckIf,
25+
skipIfRocmArch,
2126
skipIfTorchDynamo,
2227
TEST_WITH_ROCM,
2328
)
@@ -2967,6 +2972,7 @@ def test_conv_to_mkldnn_no_mkldnn(self):
29672972
self.assertEqual(frozen(inp), mod(inp))
29682973

29692974
@unittest.skipIf(not (TEST_CUDNN or TEST_WITH_ROCM), "requires CUDNN")
2975+
@skipIfRocmArch(NAVI_ARCH) # not supported by MIOPEN on NAVI
29702976
def test_freeze_conv_relu_fusion(self):
29712977
with set_default_dtype(torch.float):
29722978
conv_bias = [True, False]
@@ -3029,6 +3035,7 @@ def forward(self, x):
30293035
self.assertEqual(mod_eager(inp), frozen_mod(inp))
30303036

30313037
@unittest.skipIf(not (TEST_CUDNN or TEST_WITH_ROCM), "requires CUDNN")
3038+
@skipIfRocmArch(NAVI_ARCH) # not supported by MIOPEN on NAVI
30323039
def test_freeze_conv_relu_fusion_not_forward(self):
30333040
with set_default_dtype(torch.float):
30343041

test/nn/test_convolution.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848
gradgradcheck,
4949
instantiate_parametrized_tests,
5050
MACOS_VERSION,
51+
NAVI_ARCH,
5152
parametrize as parametrize_test,
5253
run_tests,
5354
set_default_dtype,
5455
skipIfNotMiopenSuggestNHWC,
56+
skipIfRocmArch,
5557
skipIfRocmVersionLessThan,
5658
subtest,
5759
TEST_SCIPY,
@@ -3883,6 +3885,7 @@ def test_conv2d_no_grad(self, device, dtype):
38833885

38843886
@onlyCUDA
38853887
@skipCUDAIfNoCudnn
3888+
@skipIfRocmArch(NAVI_ARCH) # not supported by MIOPEN on NAVI
38863889
@dtypes(torch.float, torch.float16)
38873890
@precisionOverride({torch.half: 0.002, torch.float: 1e-4})
38883891
def test_cudnn_convolution_relu(self, device, dtype):

torch/testing/_internal/common_utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105

106106
MI300_ARCH = ("gfx940", "gfx941", "gfx942")
107107
NAVI_ARCH = ("gfx1030", "gfx1100", "gfx1101", "gfx1200", "gfx1201")
108+
<<<<<<< HEAD
108109
NAVI3_ARCH = ("gfx1100", "gfx1101")
109110
NAVI4_ARCH = ("gfx1200", "gfx1201")
110111

@@ -115,6 +116,9 @@ def is_navi3_arch():
115116
if gfx_arch in NAVI3_ARCH:
116117
return True
117118
return False
119+
=======
120+
NAVI4_ARCH = ("gfx1200", "gfx1201")
121+
>>>>>>> 3b9e558b7c ([release/2.6] skip convolution tests on Navi (#2055))
118122

119123
def freeze_rng_state(*args, **kwargs):
120124
return torch.testing._utils.freeze_rng_state(*args, **kwargs)
@@ -1926,11 +1930,19 @@ def wrapper(*args, **kwargs):
19261930
return dec_fn(func)
19271931
return dec_fn
19281932

1933+
<<<<<<< HEAD
19291934
def skipIfRocmArch(arch: tuple[str, ...]):
19301935
def dec_fn(fn):
19311936
@wraps(fn)
19321937
def wrap_fn(self, *args, **kwargs):
19331938
if TEST_WITH_ROCM:
1939+
=======
1940+
def skipIfRocmArch(arch: Tuple[str, ...]):
1941+
def dec_fn(fn):
1942+
@wraps(fn)
1943+
def wrap_fn(self, *args, **kwargs):
1944+
if TEST_WITH_ROCM: # noqa: F821
1945+
>>>>>>> 3b9e558b7c ([release/2.6] skip convolution tests on Navi (#2055))
19341946
prop = torch.cuda.get_device_properties(0)
19351947
if prop.gcnArchName.split(":")[0] in arch:
19361948
reason = f"skipIfRocm: test skipped on {arch}"

0 commit comments

Comments
 (0)