diff --git a/projects/rocprofiler-systems/tests/pytest/rocprofsys/gpu.py b/projects/rocprofiler-systems/tests/pytest/rocprofsys/gpu.py index c2d27db9cd18..b1899fe8a253 100644 --- a/projects/rocprofiler-systems/tests/pytest/rocprofsys/gpu.py +++ b/projects/rocprofiler-systems/tests/pytest/rocprofsys/gpu.py @@ -14,6 +14,12 @@ GFX_XXXX_PATTERN = re.compile(r"(gfx[0-9a-fA-F]+)") +# Architectures where GPU perf counter (device counting service) validation is +# unreliable and dependent tests should be skipped. +UNSUPPORTED_PERF_COUNTER_GFX = frozenset( + {"gfx1101", "gfx1102", "gfx1150", "gfx1151", "gfx1152", "gfx1153"} +) + @dataclass class GPUInfo: @@ -87,6 +93,16 @@ def expected_counter_files(self) -> list[str]: """ return [f"rocprof-device-[0-9]-{name}*.txt" for name in self.counter_names] + @property + def unsupported_perf_counter_archs(self) -> set[str]: + """Detected architectures where GPU perf counter validation is unreliable. + + Returns the intersection of the detected architectures with + ``UNSUPPORTED_PERF_COUNTER_GFX``. + https://github.com/ROCm/rocm-systems/blob/develop/projects/rocprofiler-sdk/tests/rocprofv3/counter-collection/input1/validate.py#L83C4-L83C82 + """ + return set(UNSUPPORTED_PERF_COUNTER_GFX.intersection(self.architectures)) + def get_rocminfo(rocm_path: Optional[Path] = None) -> Optional[Path]: """Get the path to the rocminfo executable. diff --git a/projects/rocprofiler-systems/tests/pytest/test_pytest_impl.py b/projects/rocprofiler-systems/tests/pytest/test_pytest_impl.py index c6804917339e..e1d6701f41c5 100644 --- a/projects/rocprofiler-systems/tests/pytest/test_pytest_impl.py +++ b/projects/rocprofiler-systems/tests/pytest/test_pytest_impl.py @@ -135,6 +135,26 @@ def test_non_mi300_non_gfx1250_keep_single_counter(self): assert gpu_info.rocm_events_for_test == "SQ_WAVES" assert gpu_info.counter_names == ["SQ_WAVES"] + def test_unsupported_perf_counter_archs_flags_matches(self): + gpu_info = GPUInfo( + available=True, + architectures=["gfx1102", "gfx942"], + device_count=2, + categories={"radeon", "instinct"}, + ) + + assert gpu_info.unsupported_perf_counter_archs == {"gfx1102"} + + def test_unsupported_perf_counter_archs_empty_when_supported(self): + gpu_info = GPUInfo( + available=True, + architectures=["gfx942"], + device_count=1, + categories={"instinct"}, + ) + + assert gpu_info.unsupported_perf_counter_archs == set() + @pytest.mark.class_name("test-result") class TestTestResult(RocprofsysTest): diff --git a/projects/rocprofiler-systems/tests/pytest/test_transpose.py b/projects/rocprofiler-systems/tests/pytest/test_transpose.py index 3ba4bb804690..83e71b7d1767 100644 --- a/projects/rocprofiler-systems/tests/pytest/test_transpose.py +++ b/projects/rocprofiler-systems/tests/pytest/test_transpose.py @@ -355,8 +355,12 @@ def test( gpu_info, validation_rules_dir, ): - if "gfx1151" in gpu_info.architectures: - pytest.skip("transpose GPU perf counter test skipped on gfx1151") + unsupported = gpu_info.unsupported_perf_counter_archs + if unsupported: + pytest.skip( + "transpose GPU perf counter test skipped on " + f"{', '.join(sorted(unsupported))}" + ) result = self.run_test( "sampling",