CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
72 lines
2.1 KiB
Python
72 lines
2.1 KiB
Python
# Copyright (c) Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""
|
|
Unified-memory report tests using the unified-memory example.
|
|
|
|
Validates the user-facing unified-memory text and JSON outputs generated from
|
|
KFD page fault and page migration events.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import pytest
|
|
from conftest import RocprofsysTest
|
|
|
|
pytestmark = [
|
|
pytest.mark.gpu,
|
|
pytest.mark.xnack,
|
|
pytest.mark.hip,
|
|
pytest.mark.unified_memory,
|
|
# rocprofiler-sdk < 1.2.2 can abort on undefined KFD node IDs; product disables KFD domains.
|
|
pytest.mark.rocprofiler_sdk_min_version("1.2.2"),
|
|
]
|
|
|
|
|
|
@pytest.fixture
|
|
def unified_memory_environment() -> dict[str, str]:
|
|
"""Environment variables for unified-memory report tests."""
|
|
return {
|
|
"ROCPROFSYS_TRACE": "ON",
|
|
"ROCPROFSYS_PROFILE": "ON",
|
|
"ROCPROFSYS_TIME_OUTPUT": "OFF",
|
|
"ROCPROFSYS_COUT_OUTPUT": "ON",
|
|
"ROCPROFSYS_ROCM_DOMAINS": "hip_runtime_api,kernel_dispatch,kfd_events",
|
|
"ROCPROFSYS_USE_UNIFIED_MEMORY_PROFILING": "ON",
|
|
"ROCPROFSYS_USE_AMD_SMI": "OFF",
|
|
"HSA_XNACK": "1",
|
|
}
|
|
|
|
|
|
@pytest.mark.class_name("unified-memory")
|
|
class TestUnifiedMemory(RocprofsysTest):
|
|
"""Validate unified-memory reports generated from the HIP example."""
|
|
|
|
UM_DEFAULT_TEST_PASS_REGEX = ["9 tests completed"]
|
|
|
|
run_args = ["-s", "32", "-p", "256", "-i", "4"]
|
|
|
|
@pytest.mark.timeout(120)
|
|
@pytest.mark.parametrize("mode", ["sys_run"])
|
|
def test_output(self, mode, unified_memory_environment):
|
|
"""Run unified-memory and validate text/JSON report generation."""
|
|
result = self.run_test(
|
|
mode,
|
|
target="unified-memory",
|
|
env=unified_memory_environment,
|
|
run_args=self.run_args,
|
|
check_target_arch=True,
|
|
)
|
|
|
|
self.assert_regex(
|
|
result,
|
|
subtest_name="Unified-memory completion check",
|
|
pass_regex=self.UM_DEFAULT_TEST_PASS_REGEX,
|
|
)
|
|
|
|
self.assert_unified_memory_output(
|
|
result,
|
|
subtest_name="Unified-memory output validation",
|
|
pass_regex=["All validation checks passed"],
|
|
)
|