Unverified Commit 3d72c078 authored by Yuting Jiang's avatar Yuting Jiang Committed by GitHub
Browse files

Bug bash - Rename bin name and metric name of cublas and cudnn microbenchmark (#99)

rename bin name and result metric of cublas and cudnn microbenchmark
parent 25ec3a7c
...@@ -181,7 +181,7 @@ def __init__(self, name, parameters=''): ...@@ -181,7 +181,7 @@ def __init__(self, name, parameters=''):
} }
] ]
self._bin_name = 'CublasBenchmark' self._bin_name = 'cublas_benchmark'
def add_parser_arguments(self): def add_parser_arguments(self):
"""Add the specified arguments.""" """Add the specified arguments."""
...@@ -276,7 +276,15 @@ def _process_raw_result(self, cmd_idx, raw_output): ...@@ -276,7 +276,15 @@ def _process_raw_result(self, cmd_idx, raw_output):
raw_data = [] raw_data = []
for line in lines: for line in lines:
if '[function config]' in line: if '[function config]' in line:
metric = line[line.index('[function config]: ') + len('[function config]: '):] metric = ''
metric_json_str = line[line.index('[function config]: ') +
len('[function config]: '):].replace(' ', '').replace(':', '_')[1:-1]
metric_list = metric_json_str.split(',')
for key in metric_list:
if 'name' in key:
metric = key + metric
else:
metric = metric + '_' + key
if '[raw_data]' in line: if '[raw_data]' in line:
raw_data = line[line.index('[raw_data]: ') + len('[raw_data]: '):] raw_data = line[line.index('[raw_data]: ') + len('[raw_data]: '):]
raw_data = raw_data.split(',') raw_data = raw_data.split(',')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Licensed under the MIT License. # Licensed under the MIT License.
cmake_minimum_required(VERSION 3.18) cmake_minimum_required(VERSION 3.18)
project(CublasBenchmark LANGUAGES CUDA CXX) project(cublas_benchmark LANGUAGES CUDA CXX)
include(../cuda_common.cmake) include(../cuda_common.cmake)
...@@ -25,7 +25,7 @@ if(NOT json_POPULATED) ...@@ -25,7 +25,7 @@ if(NOT json_POPULATED)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL) add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif() endif()
add_executable(CublasBenchmark cublas_test.cpp) add_executable(cublas_benchmark cublas_test.cpp)
target_link_libraries(CublasBenchmark ${TARGET_NAME} nlohmann_json::nlohmann_json CUDA::cudart CUDA::cublas) target_link_libraries(cublas_benchmark ${TARGET_NAME} nlohmann_json::nlohmann_json CUDA::cudart CUDA::cublas)
install(TARGETS CublasBenchmark ${TARGET_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib) install(TARGETS cublas_benchmark ${TARGET_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
...@@ -315,7 +315,7 @@ def __init__(self, name, parameters=''): ...@@ -315,7 +315,7 @@ def __init__(self, name, parameters=''):
} }
] ]
self._bin_name = 'CudnnBenchmark' self._bin_name = 'cudnn_benchmark'
def add_parser_arguments(self): def add_parser_arguments(self):
"""Add the specified arguments.""" """Add the specified arguments."""
...@@ -410,7 +410,15 @@ def _process_raw_result(self, cmd_idx, raw_output): ...@@ -410,7 +410,15 @@ def _process_raw_result(self, cmd_idx, raw_output):
raw_data = [] raw_data = []
for line in lines: for line in lines:
if '[function config]' in line: if '[function config]' in line:
metric = line[line.index('[function config]: ') + len('[function config]: '):] metric = ''
metric_json_str = line[line.index('[function config]: ') +
len('[function config]: '):].replace(' ', '').replace(':', '_')[1:-1]
metric_list = metric_json_str.split(',')
for key in metric_list:
if 'name' in key:
metric = key + metric
else:
metric = metric + '_' + key
if '[raw_data]' in line: if '[raw_data]' in line:
raw_data = line[line.index('[raw_data]: ') + len('[raw_data]: '):] raw_data = line[line.index('[raw_data]: ') + len('[raw_data]: '):]
raw_data = raw_data.split(',') raw_data = raw_data.split(',')
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Licensed under the MIT License. # Licensed under the MIT License.
cmake_minimum_required(VERSION 3.18) cmake_minimum_required(VERSION 3.18)
project(CudnnBenchmark LANGUAGES CUDA CXX) project(cudnn_benchmark LANGUAGES CUDA CXX)
include(../cuda_common.cmake) include(../cuda_common.cmake)
...@@ -28,6 +28,6 @@ if(NOT json_POPULATED) ...@@ -28,6 +28,6 @@ if(NOT json_POPULATED)
add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL) add_subdirectory(${json_SOURCE_DIR} ${json_BINARY_DIR} EXCLUDE_FROM_ALL)
endif() endif()
add_executable(CudnnBenchmark cudnn_test.cpp) add_executable(cudnn_benchmark cudnn_test.cpp)
target_link_libraries(CudnnBenchmark ${TARGET_NAME} nlohmann_json::nlohmann_json CUDA::cudart ${CUDNN_LIBRARY}) target_link_libraries(cudnn_benchmark ${TARGET_NAME} nlohmann_json::nlohmann_json CUDA::cudart ${CUDNN_LIBRARY})
install(TARGETS CudnnBenchmark ${TARGET_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib) install(TARGETS cudnn_benchmark ${TARGET_NAME} RUNTIME DESTINATION bin LIBRARY DESTINATION lib)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment