From b2a439a8c328c6c2b8573befba761c29e306c6a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9C=A4=EC=A7=80=EC=98=81/On-Device=20Lab=28SR=29/Staff?= =?utf8?q?=20Engineer/=EC=82=BC=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Tue, 2 Jul 2019 19:03:37 +0900 Subject: [PATCH] [kbenchmark] Update summary view of html file (#5519) * [kbenchmark] Update summary view of html file This patch generates a summary view of html file. This will help you to see at a glance which graph shows which kernel performs well in the current layer. Signed-off-by: Jiyoung Yun * Change the location of the html_report_template.g.h++ that needs copy to cmake/packages/Nonius directory --- cmake/packages/Nonius/html_report_template.g.h++ | 433 +++++++++++++++++++++++ cmake/packages/NoniusConfig.cmake | 8 + tools/kbenchmark/Driver.cc | 2 +- tools/kbenchmark/Operation.h | 2 +- tools/kbenchmark/operations/Convolution.h | 4 +- 5 files changed, 446 insertions(+), 3 deletions(-) create mode 100644 cmake/packages/Nonius/html_report_template.g.h++ diff --git a/cmake/packages/Nonius/html_report_template.g.h++ b/cmake/packages/Nonius/html_report_template.g.h++ new file mode 100644 index 0000000..fa159c6 --- /dev/null +++ b/cmake/packages/Nonius/html_report_template.g.h++ @@ -0,0 +1,433 @@ +"\n" +"\n" +" \n" +" \n" +" {$title} - nonius report\n" +" \n" +" \n" +" \n" +" \n" +"
\n" +" \n" +"
\n" +" \n" +, +" \n" +"
\n" +"
\n" +"
\n" +"
Generated with nonius
\n" +" \n" +" \n" +"\n" diff --git a/cmake/packages/NoniusConfig.cmake b/cmake/packages/NoniusConfig.cmake index 35f373a..2b5778e 100644 --- a/cmake/packages/NoniusConfig.cmake +++ b/cmake/packages/NoniusConfig.cmake @@ -12,6 +12,14 @@ function(_Nonius_import) target_include_directories(nonius INTERFACE "${NoniusSource_DIR}/include") endif(NOT TARGET nonius) + if(BUILD_KBENCHMARK) + # Copy html_report_template.g.h++ file to externals/nonius. + # This header file is modified to show the html summary view according to the layer in kbenchmark. + execute_process(COMMAND ${CMAKE_COMMAND} -E copy + "${CMAKE_CURRENT_LIST_DIR}/Nonius/html_report_template.g.h++" + "${NoniusSource_DIR}/include/nonius/detail") + endif(BUILD_KBENCHMARK) + set(Nonius_FOUND TRUE PARENT_SCOPE) endfunction(_Nonius_import) diff --git a/tools/kbenchmark/Driver.cc b/tools/kbenchmark/Driver.cc index 376a851..f2874d5 100644 --- a/tools/kbenchmark/Driver.cc +++ b/tools/kbenchmark/Driver.cc @@ -129,7 +129,7 @@ int main(int argc, char *argv[]) cfg.output_file = temp_name + ext; } - nonius::parameters op_params = opl[cf.name()]->params(c.second); + nonius::parameters op_params = opl[cf.name()]->params(c.first, c.second); cfg.params.map = cfg.params.map.merged(op_params); nonius::go(cfg, benchmarks); diff --git a/tools/kbenchmark/Operation.h b/tools/kbenchmark/Operation.h index 386f08a..4bf1e8c 100644 --- a/tools/kbenchmark/Operation.h +++ b/tools/kbenchmark/Operation.h @@ -29,7 +29,7 @@ class Operation public: Operation() = default; - virtual nonius::parameters params(OperationInfo &info) = 0; + virtual nonius::parameters params(int layer_num, OperationInfo &info) = 0; }; } // namespace kbenchmark diff --git a/tools/kbenchmark/operations/Convolution.h b/tools/kbenchmark/operations/Convolution.h index 2f3b60b..a3dc416 100644 --- a/tools/kbenchmark/operations/Convolution.h +++ b/tools/kbenchmark/operations/Convolution.h @@ -30,10 +30,12 @@ class Convolution final : public Operation public: Convolution() = default; - nonius::parameters params(OperationInfo &info) override + nonius::parameters params(int layer_num, OperationInfo &info) override { nonius::parameters params; + params.insert({"LAYER", nonius::param{layer_num}}); + params.insert({"BATCH", nonius::param{1}}); auto _input = get_key_dims({"input"}, info); -- 2.7.4