Skip to content

Commit a87c9a9

Browse files
[AUTOGENERATED] [release/2.6] [rocm6.4_internal_testing] [NAVI32] Skipped sdpa_2 test in test_aot_inductor for Navi32 (#2092)
Cherry-pick of #1882 Need to resolve conflicts --------- Co-authored-by: iupaikov-amd <[email protected]>
1 parent faf900e commit a87c9a9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

test/inductor/test_aot_inductor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@
4141
IS_MACOS,
4242
IS_WINDOWS,
4343
skipIfRocm,
44+
skipIfRocmArch,
4445
skipIfXpu,
4546
TEST_WITH_ROCM,
47+
NAVI32_ARCH,
4648
)
4749
from torch.testing._internal.inductor_utils import GPU_TYPE
4850
from torch.testing._internal.logging_utils import LoggingTestCase, make_logging_test
@@ -922,6 +924,8 @@ def forward(self, q, k, v):
922924
)
923925
self.check_model(Model(), example_inputs)
924926

927+
# Eager mode produces incorrect tensor values for navi32 during this test
928+
@skipIfRocmArch(NAVI32_ARCH)
925929
@unittest.skipIf(IS_FBCODE, "Not yet runnable in fbcode")
926930
@unittest.skipIf(not SM80OrLater, "bfloat16 only supported in sm80+")
927931
def test_sdpa_2(self):

torch/testing/_internal/common_utils.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,6 +1361,16 @@ def printErrors(self) -> None:
13611361
IS_ARM64 = platform.machine() in ('arm64', 'aarch64')
13621362
IS_S390X = platform.machine() == "s390x"
13631363

1364+
NAVI32_ARCH = "gfx1101"
1365+
1366+
def is_navi_arch():
1367+
if torch.cuda.is_available():
1368+
prop = torch.cuda.get_device_properties(0)
1369+
gfx_arch = prop.gcnArchName.split(":")[0]
1370+
if gfx_arch in ["gfx1100", "gfx1101", "gfx1102"]:
1371+
return True
1372+
return False
1373+
13641374
def is_avx512_vnni_supported():
13651375
if sys.platform != 'linux':
13661376
return False

0 commit comments

Comments
 (0)