Files
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

91 lines
2.9 KiB
Python

# Copyright (c) Advanced Micro Devices, Inc.
# SPDX-License-Identifier: MIT
"""
NIC tests.
"""
from __future__ import annotations
import pytest
import shutil
from conftest import RocprofsysTest
pytestmark = [pytest.mark.nic, pytest.mark.network]
# =============================================================================
# NIC fixtures
# =============================================================================
@pytest.fixture
def nic_perf_env(rocprof_config) -> dict[str, str]:
"""Environment variables for NIC performance tests."""
return {
"ROCPROFSYS_USE_PID": "OFF",
"ROCPROFSYS_LOG_LEVEL": "trace",
"ROCPROFSYS_USE_PROCESS_SAMPLING": "OFF",
"ROCPROFSYS_SAMPLING_FREQ": "50",
"ROCPROFSYS_SAMPLING_CPUS": "none",
"ROCPROFSYS_TIMEMORY_COMPONENTS": "wall_clock,papi_array,network_stats",
"ROCPROFSYS_NETWORK_INTERFACE": f"{rocprof_config.capabilities.default_nic}",
"ROCPROFSYS_PAPI_EVENTS": f"{rocprof_config.capabilities.papi_nic_events}",
"ROCPROFSYS_SAMPLING_DELAY": "0.05",
"PAPI_NET_REFRESH_LATENCY": "100000",
}
@pytest.fixture
def nic_perf_download_url_1() -> str:
"""Download URL for the first file to download."""
return "https://github.com/ROCm/rocprofiler-systems/releases/download/rocm-6.4.1/rocprofiler-systems-1.0.1-ubuntu-22.04-ROCm-60400-PAPI-OMPT-Python3.sh"
@pytest.fixture
def nic_perf_download_url_2() -> str:
"""Download URL for the second file to download."""
return "https://github.com/ROCm/rocprofiler-systems/releases/download/rocm-6.4.3/rocprofiler-systems-1.0.2-rhel-9.4-PAPI-OMPT-Python3.sh"
# =============================================================================
# NIC tests
# =============================================================================
class TestNIC(RocprofsysTest):
"""Tests for NIC performance."""
PERFETTO_PASS_REGEX = [r"perfetto-trace\.proto validated"]
PERFETTO_FAIL_REGEX = [r"Failure validating.*perfetto-trace\.proto"]
def test_performance(
self,
nic_perf_env,
nic_perf_download_url_1,
nic_perf_download_url_2,
test_output_dir,
):
target = shutil.which("wget")
if not target:
pytest.skip("wget not found")
download_cmd = [
"--no-check-certificate",
nic_perf_download_url_1,
nic_perf_download_url_2,
"-O",
str(test_output_dir / "rocprofiler-systems.test.bin"),
]
result = self.run_test(
"sampling",
target,
run_args=download_cmd,
env=nic_perf_env,
)
self.assert_regex(result)
self.assert_perfetto(
result,
counter_names=["rx:byte", "rx:packet", "tx:byte", "tx:packet"],
pass_regex=self.PERFETTO_PASS_REGEX,
fail_regex=self.PERFETTO_FAIL_REGEX,
)