Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions projects/rocprofiler-systems/tests/pytest/rocprofsys/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Comment thread
sputhala-amd marked this conversation as resolved.
Resolved
"""
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.
Expand Down
20 changes: 20 additions & 0 deletions projects/rocprofiler-systems/tests/pytest/test_pytest_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
8 changes: 6 additions & 2 deletions projects/rocprofiler-systems/tests/pytest/test_transpose.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading