[Rocprofiler-systems] : Add XGMI and PCIe metrics to the profiling data (#1628)

* Add XGMI and PCIe metrics to the profiling data

Add support for AMD XGMI (GPU-to-GPU interconnect) and PCIe
metrics:
  * XGMI link width in bits
  * XGMI link speed in GT/s
  * Per-link read bandwidth (KB)
  * Per-link write bandwidth (KB)

- Add new categories for PCIe metrics:
  * PCIe link width
  * PCIe link speed in GT/s
  * Accumulated bandwidth (MB)
  * Instantaneous bandwidth (MB/s)

* Fix VCN/JPEG insert logic

* Modify the gpu_metrics struct to accomodate XCP structure

* Add ctest automation for gpu interconnect metrics

* Refactor to move gpu_metrics struct and serialization to another file

* Possible fix for timeout in CI

Fix redundant skip check in ctest
Add xgmi and pcie option in rocprof-sys-avail.

* Change2: Address review comments

Change ctest sampling to avoid timeout
Change variable name and code structuring

* Add option in ctest to run rocprof-sys-run without rewrite

Run transferbench with rocprof-sys-run without sampling

* Change3: Fix sample insert bug and address review comments

xgmi and pci support check
renaming variables
additional hip_api validation in rocpd

* Reduce the load from the trnasferBench sample

The CI builds were timing out when flushing a big temporary file to the
DB: (2720824.23 KB / 2720.82 MB / 2.72 GB)...
This commit is contained in:
Sajina PK
2025-11-14 19:42:33 -05:00
committed by GitHub
parent c9dd49c48a
commit 09b8342e22
22 changed files with 7133 additions and 288 deletions
@@ -530,6 +530,7 @@ function(ROCPROFILER_SYSTEMS_ADD_TEST)
REWRITE
REWRITE_RUN
BASELINE
SYS_RUN
)
foreach(_TYPE PASS FAIL SKIP)
list(APPEND _REGEX_OPTS "${_PREFIX}_${_TYPE}_REGEX")
@@ -548,8 +549,8 @@ function(ROCPROFILER_SYSTEMS_ADD_TEST)
cmake_parse_arguments(
TEST
"SKIP_BASELINE;SKIP_SAMPLING;SKIP_REWRITE;SKIP_RUNTIME"
"NAME;TARGET;MPI;GPU;NUM_PROCS;SAMPLING_TIMEOUT;REWRITE_TIMEOUT;RUNTIME_TIMEOUT;WILL_FAIL;DISABLED"
"SKIP_BASELINE;SKIP_SAMPLING;SKIP_REWRITE;SKIP_RUNTIME;SKIP_SYS_RUN"
"NAME;TARGET;MPI;GPU;NUM_PROCS;SAMPLING_TIMEOUT;REWRITE_TIMEOUT;RUNTIME_TIMEOUT;SYS_RUN_TIMEOUT;WILL_FAIL;DISABLED"
"${_KWARGS}"
${ARGN}
)
@@ -561,6 +562,7 @@ function(ROCPROFILER_SYSTEMS_ADD_TEST)
REWRITE
REWRITE_RUN
BASELINE
SYS_RUN
)
if("${${_PREFIX}_FAIL_REGEX}" STREQUAL "")
set(${_PREFIX}_FAIL_REGEX "(${ROCPROFSYS_ABORT_FAIL_REGEX})")
@@ -601,6 +603,10 @@ function(ROCPROFILER_SYSTEMS_ADD_TEST)
set(TEST_SAMPLING_TIMEOUT 120)
endif()
if(NOT TEST_SYS_RUN_TIMEOUT)
set(TEST_SYS_RUN_TIMEOUT 300)
endif()
if(NOT TEST_DISABLED)
set(TEST_DISABLED OFF)
endif()
@@ -711,6 +717,16 @@ function(ROCPROFILER_SYSTEMS_ADD_TEST)
)
endif()
if(NOT TEST_SKIP_SYS_RUN)
add_test(
NAME ${TEST_NAME}-sys-run
COMMAND
${COMMAND_PREFIX} $<TARGET_FILE:rocprofiler-systems-run> --
$<TARGET_FILE:${TEST_TARGET}> ${TEST_RUN_ARGS}
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
endif()
if(TEST ${TEST_NAME}-binary-rewrite-run)
set_tests_properties(
${TEST_NAME}-binary-rewrite-run
@@ -725,10 +741,17 @@ function(ROCPROFILER_SYSTEMS_ADD_TEST)
binary-rewrite
binary-rewrite-run
runtime-instrument
sys-run
)
string(REGEX REPLACE "-run(-|/)" "\\1" _prefix "${TEST_NAME}-${_TEST}/")
string(
REGEX REPLACE
"rewrite-run(-|/)"
"rewrite\\1"
_prefix
"${TEST_NAME}-${_TEST}/"
)
set(_labels "${_TEST}")
string(REPLACE "-run" "" _labels "${_TEST}")
string(REPLACE "rewrite-run" "rewrite" _labels "${_TEST}")
if(TEST_TARGET)
list(APPEND _labels "${TEST_TARGET}")
endif()
@@ -748,10 +771,12 @@ function(ROCPROFILER_SYSTEMS_ADD_TEST)
set(_timeout ${TEST_SAMPLING_TIMEOUT})
elseif("${_TEST}" MATCHES "runtime-instrument")
set(_timeout ${TEST_RUNTIME_TIMEOUT})
elseif("${_TEST}" MATCHES "sys-run")
set(_timeout ${TEST_SYS_RUN_TIMEOUT})
endif()
set(_props)
if("${_TEST}" MATCHES "run|sampling|baseline")
if("${_TEST}" MATCHES "sys-run|sampling|baseline")
set(_props ${TEST_PROPERTIES})
if(NOT "RUN_SERIAL" IN_LIST _props)
list(APPEND _props RUN_SERIAL ON)
@@ -768,11 +793,17 @@ function(ROCPROFILER_SYSTEMS_ADD_TEST)
set(_REGEX_VAR BASELINE)
elseif("${_TEST}" MATCHES "sampling")
set(_REGEX_VAR SAMPLING)
elseif("${_TEST}" MATCHES "sys-run")
set(_REGEX_VAR SYS_RUN)
else()
set(_REGEX_VAR)
endif()
if("${_TEST}" MATCHES "binary-rewrite-run|runtime-instrument|sampling")
if(
"${_TEST}"
MATCHES
"binary-rewrite-run|runtime-instrument|sampling|sys-run"
)
rocprofiler_systems_patch_sanitizer_environment(_environ)
endif()