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
78 lines
2.1 KiB
Python
78 lines
2.1 KiB
Python
# Copyright (c) Advanced Micro Devices, Inc.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
"""
|
|
Tests for the hipfile example (hipFILE API tracing).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
import pytest
|
|
from pathlib import Path
|
|
from conftest import RocprofsysTest
|
|
|
|
pytestmark = [
|
|
pytest.mark.gpu,
|
|
pytest.mark.hipfile,
|
|
pytest.mark.rocm,
|
|
# hipFILE callback tracing domain requires rocprofiler-sdk >= 1.3.5
|
|
pytest.mark.rocprofiler_sdk_min_version("1.3.5"),
|
|
]
|
|
|
|
|
|
# =============================================================================
|
|
# hipFILE fixtures
|
|
# =============================================================================
|
|
|
|
|
|
@pytest.fixture
|
|
def hipfile_env() -> dict[str, str]:
|
|
"""Environment variables for hipFILE trace tests."""
|
|
return {
|
|
"ROCPROFSYS_ROCM_DOMAINS": "hip_runtime_api,kernel_dispatch,memory_copy,hipfile_api",
|
|
"ROCPROFSYS_SAMPLING_CPUS": "none",
|
|
}
|
|
|
|
|
|
@pytest.fixture
|
|
def hipfile_rules(validation_rules_dir) -> list[Path]:
|
|
"""Get validation rules for hipFILE trace tests."""
|
|
rules_dir = validation_rules_dir / "hipfile"
|
|
return [
|
|
rules_dir / "validation-rules.json",
|
|
rules_dir / "sdk-metrics-rules.json",
|
|
]
|
|
|
|
|
|
# =============================================================================
|
|
# hipFILE tests
|
|
# =============================================================================
|
|
|
|
|
|
@pytest.mark.timeout(120)
|
|
@pytest.mark.parametrize(
|
|
"mode",
|
|
[
|
|
pytest.param("sampling", marks=pytest.mark.rocpd("hipfile_env")),
|
|
"sys_run",
|
|
],
|
|
)
|
|
@pytest.mark.class_name("hipfile")
|
|
class TestHipFile(RocprofsysTest):
|
|
def test(self, mode, hipfile_env, hipfile_rules):
|
|
result = self.run_test(
|
|
mode,
|
|
"hipfile-trace",
|
|
env=hipfile_env,
|
|
)
|
|
self.assert_regex(result)
|
|
|
|
if mode == "sampling":
|
|
self.assert_perfetto(
|
|
result,
|
|
categories=["rocm_hipfile_api"],
|
|
labels=["hipFileGetVersion"],
|
|
counts=[1],
|
|
depths=[1],
|
|
)
|
|
self.assert_rocpd(result, rules_files=hipfile_rules)
|