counter collection multi-kernel test (#492)

* counter collection multi-kernel test

* Adding counter collection in rocprofv3 script
Этот коммит содержится в:
Gopesh Bhardwaj
2024-02-29 04:38:28 +05:30
коммит произвёл GitHub
родитель bd81e6a5f8
Коммит 31dcfabe23
3 изменённых файлов: 24 добавлений и 5 удалений
+6 -1
Просмотреть файл
@@ -19,7 +19,12 @@ usage() {
if [ -z "${EC}" ]; then EC=1; fi
echo -e "${RESET}ROCProfilerV3 Run Script Usage:"
echo -e "${GREEN}-h | --help ${RESET} For showing this message"
# echo -e "${GREEN}-i | --input ${RESET} For adding counters file path (every line in the text file represents a counter)"
echo -e "${GREEN}-i | --input ${RESET} For counter collection "
echo -e "\t#${GREY} Input file .txt format, automatically rerun application for every profiling features line"
echo -e "\t# Perf counters group 1"
echo -e "\tpmc : Wavefronts VALUInsts SALUInsts SFetchInsts FlatVMemInsts LDSInsts"
echo -e "\t# Perf counters group 2"
echo -e "\tpmc : WriteSize L2CacheHit ${RESET}"
echo -e "${GREEN}--hsa-trace ${RESET} For Collecting HSA API Traces"
echo -e "${GREEN}--kernel-trace ${RESET} For Collecting Kernel Dispatch Traces"
echo -e "${GREEN}--memory-copy-trace ${RESET} For Collecting Memory Copy Traces"
+2 -2
Просмотреть файл
@@ -20,8 +20,8 @@ add_test(
NAME rocprofv3-test-counter-collection-pmc1-execute
COMMAND
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> -i
${CMAKE_CURRENT_BINARY_DIR}/input.txt -d ${CMAKE_CURRENT_BINARY_DIR}/out_cc_1 -o
pmc1 $<TARGET_FILE:simple-transpose>)
${CMAKE_CURRENT_BINARY_DIR}/input.txt -T -d ${CMAKE_CURRENT_BINARY_DIR}/out_cc_1
-o pmc1 $<TARGET_FILE:vector-ops>)
string(REPLACE "LD_PRELOAD=" "ROCPROF_PRELOAD=" PRELOAD_ENV
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}")
+16 -2
Просмотреть файл
@@ -2,15 +2,29 @@ import pandas as pd
import sys
import pytest
kernel_list = ["addition_kernel", "subtract_kernel", "multiply_kernel", "divide_kernel"]
def test_validate_counter_collection_pmc1(input_data: pd.DataFrame):
df = input_data
assert df.empty == False
assert df["Agent_Id"].map(type).eq(int).all()
assert (df["Agent_Id"].astype(int).values > 0).all()
assert (df["Queue_Id"].astype(int).values > 0).all()
assert (df["Process_Id"].astype(int).values > 0).all()
assert len(df["Kernel-Name"]) > 0
assert df["Kernel-Name"].str.contains("matrixTranspose").any()
df_list = df["Kernel-Name"].values.flatten().tolist()
# Check if each string in kernel_list is present at least once
missing_kernels = []
for kernel in kernel_list:
if kernel not in df_list:
missing_kernels.append(kernel)
assert (
not missing_kernels
), f"The following kernel names are missing from the out file: {missing_kernels}"
assert df["Counter_Name"].str.contains("SQ_WAVES").all()
assert len(df["Counter_Value"]) > 0
if __name__ == "__main__":