Fixing counter collection in tools and enabling tests (#436)

* Fixing coutner colleciton in tools and enabling tests

* fixing tests

* improving coverage on test

* Adding vector operations app

* Fixing tools bug for counter collection

* removing roctx linking
This commit is contained in:
Gopesh Bhardwaj
2024-02-06 23:25:07 +05:30
zatwierdzone przez GitHub
rodzic f6198f226a
commit 8a25b239bc
12 zmienionych plików z 358 dodań i 43 usunięć
@@ -1,5 +1,5 @@
#
#
# rocprofv3 tool test
#
cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR)
@@ -23,11 +23,19 @@ add_test(
${CMAKE_CURRENT_BINARY_DIR}/input.txt -d ${CMAKE_CURRENT_BINARY_DIR}/out_cc_1 -o
pmc1 $<TARGET_FILE:simple-transpose>)
string(REPLACE "LD_PRELOAD=" "ROCPROF_PRELOAD=" PRELOAD_ENV
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}")
if(ROCPROFILER_MEMCHECK STREQUAL "LeakSanitizer")
set(LOG_LEVEL "warning") # info produces memory leak
else()
set(LOG_LEVEL "info")
endif()
set(cc-env-pmc1
"${PRELOAD_ENV}"
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
"LD_LIBRARY_PATH=$<TARGET_FILE_DIR:rocprofiler::rocprofiler-shared-library>:$ENV{LD_LIBRARY_PATH}"
)
"${PRELOAD_ENV}" "ROCPROF_LOG_LEVEL=${LOG_LEVEL}"
"ROCPROFILER_LOG_LEVEL=${LOG_LEVEL}"
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>")
set_tests_properties(
rocprofv3-test-counter-collection-pmc1-execute
@@ -36,16 +44,10 @@ set_tests_properties(
add_test(NAME rocprofv3-test-counter-collection-pmc1-validate
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/validate.py --input
"${CMAKE_CURRENT_BINARY_DIR}/out_cc_1/pmc_1/pmc1_counter_collection.csv")
${CMAKE_CURRENT_BINARY_DIR}/out_cc_1/pmc_1/pmc1_counter_collection.csv)
set_tests_properties(
rocprofv3-test-counter-collection-pmc1-validate
PROPERTIES TIMEOUT 45 LABELS "integration-tests" DEPENDS
rocprofv3-test-counter-collection-pmc1-execute FAIL_REGULAR_EXPRESSION
"threw an exception")
# Needs to be enabled once counter colelction tool support is merged
set_tests_properties(rocprofv3-test-counter-collection-pmc1-execute PROPERTIES DISABLED
TRUE)
set_tests_properties(rocprofv3-test-counter-collection-pmc1-validate PROPERTIES DISABLED
TRUE)
@@ -7,8 +7,10 @@ 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 len(df["kernel-name"]) > 0
assert df["Agent_Id"].map(type).eq(int).all()
assert len(df["Kernel-Name"]) > 0
assert df["Kernel-Name"].str.contains("matrixTranspose").all()
assert df["Counter_Name"].str.contains("SQ_WAVES").all()
if __name__ == "__main__":
@@ -1,5 +1,5 @@
#
#
# rocprofv3 tool test
#
cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR)
@@ -22,11 +22,20 @@ add_test(
$<TARGET_FILE:rocprofiler-sdk::rocprofv3> -i
${CMAKE_CURRENT_BINARY_DIR}/input.txt -d ${CMAKE_CURRENT_BINARY_DIR}/out_cc_2 -o
pmc2 $<TARGET_FILE:simple-transpose>)
string(REPLACE "LD_PRELOAD=" "ROCPROF_PRELOAD=" PRELOAD_ENV
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}")
if(ROCPROFILER_MEMCHECK STREQUAL "LeakSanitizer")
set(LOG_LEVEL "warning") # info produces memory leak
else()
set(LOG_LEVEL "info")
endif()
set(cc-env-pmc2
"${PRELOAD_ENV}"
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
"LD_LIBRARY_PATH=$<TARGET_FILE_DIR:rocprofiler::rocprofiler-shared-library>:$ENV{LD_LIBRARY_PATH}"
)
"${PRELOAD_ENV}" "ROCPROF_LOG_LEVEL=${LOG_LEVEL}"
"ROCPROFILER_LOG_LEVEL=${LOG_LEVEL}"
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>")
set_tests_properties(
rocprofv3-test-counter-collection-pmc2-execute
@@ -42,9 +51,3 @@ set_tests_properties(
PROPERTIES TIMEOUT 45 LABELS "integration-tests" DEPENDS
rocprofv3-test-counter-collection-pmc2-execute FAIL_REGULAR_EXPRESSION
"threw an exception")
# Needs to be enabled once counter colelction tool support is merged
set_tests_properties(rocprofv3-test-counter-collection-pmc2-execute PROPERTIES DISABLED
TRUE)
set_tests_properties(rocprofv3-test-counter-collection-pmc2-validate PROPERTIES DISABLED
TRUE)
@@ -34,9 +34,9 @@ def test_validate_counter_collection_pmc2(input_dir: pd.DataFrame):
with open(file_path, "r") as file:
df = pd.read_csv(file)
# check if kernel-name is present
assert len(df["kernel-name"]) > 0
assert len(df["Kernel-Name"]) > 0
# check if counter value is positive
assert len(df["counter_value"]) > 0
assert len(df["Counter_Value"]) > 0
if __name__ == "__main__":
@@ -1,5 +1,5 @@
#
#
# rocprofv3 tool
#
cmake_minimum_required(VERSION 3.21.0 FATAL_ERROR)
@@ -23,11 +23,19 @@ add_test(
${CMAKE_CURRENT_BINARY_DIR}/input.txt -d ${CMAKE_CURRENT_BINARY_DIR}/out_cc_trace
-o pmc3 $<TARGET_FILE:simple-transpose>)
string(REPLACE "LD_PRELOAD=" "ROCPROF_PRELOAD=" PRELOAD_ENV
"${ROCPROFILER_MEMCHECK_PRELOAD_ENV}")
if(ROCPROFILER_MEMCHECK STREQUAL "LeakSanitizer")
set(LOG_LEVEL "warning") # info produces memory leak
else()
set(LOG_LEVEL "info")
endif()
set(cc-tracing-env
"${PRELOAD_ENV}"
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>"
"LD_LIBRARY_PATH=$<TARGET_FILE_DIR:rocprofiler::rocprofiler-shared-library>:$ENV{LD_LIBRARY_PATH}"
)
"${PRELOAD_ENV}" "ROCPROF_LOG_LEVEL=${LOG_LEVEL}"
"ROCPROFILER_LOG_LEVEL=${LOG_LEVEL}"
"HSA_TOOLS_LIB=$<TARGET_FILE:rocprofiler::rocprofiler-shared-library>")
set_tests_properties(
rocprofv3-test-tracing-plus-cc-execute
@@ -43,7 +51,3 @@ set_tests_properties(
PROPERTIES TIMEOUT 45 LABELS "integration-tests" DEPENDS
rocprofv3-test-tracing-plus-cc-execute FAIL_REGULAR_EXPRESSION
"threw an exception")
# Needs to be enabled once counter colelction tool support is merged
set_tests_properties(rocprofv3-test-tracing-plus-cc-execute PROPERTIES DISABLED TRUE)
set_tests_properties(rocprofv3-test-tracing-plus-cc-validate PROPERTIES DISABLED TRUE)
@@ -34,7 +34,7 @@ def test_validate_counter_collection_plus_tracing(input_dir: pd.DataFrame):
with open(file_path, "r") as file:
df = pd.read_csv(file)
# check if either kernel-name/FUNCTION is present
assert "kernel-name" in df.columns or "FUNCTION" in df.columns
assert "Kernel-Name" in df.columns or "Function" in df.columns
if __name__ == "__main__":