summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArne Juul <arnej@verizonmedia.com>2020-10-25 21:24:21 +0000
committerArne Juul <arnej@verizonmedia.com>2020-10-25 21:29:45 +0000
commit43385cecdebe5cd9160f9e9b150f76ef8643bb14 (patch)
tree81be47ebab860fdadb11232764720434850e6c6c
parent899f7210569b4f43c1531a4f4c12507b41a7f4f7 (diff)
partial duplicate of micro-bemchmark
* use conditional compilation to let the installed vespa-tensor-instructions-benchmark run its measurements only for the two most important implementations (old prod and new prod).
-rw-r--r--eval/src/tests/tensor/instruction_benchmark/.gitignore1
-rw-r--r--eval/src/tests/tensor/instruction_benchmark/CMakeLists.txt12
-rw-r--r--eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp16
-rw-r--r--eval/src/tests/tensor/instruction_benchmark/prod_benchmark.cpp5
4 files changed, 27 insertions, 7 deletions
diff --git a/eval/src/tests/tensor/instruction_benchmark/.gitignore b/eval/src/tests/tensor/instruction_benchmark/.gitignore
index dc5c408cf29..4159041c1fd 100644
--- a/eval/src/tests/tensor/instruction_benchmark/.gitignore
+++ b/eval/src/tests/tensor/instruction_benchmark/.gitignore
@@ -1 +1,2 @@
+/eval_instruction_benchmark_app
vespa-tensor-instructions-benchmark
diff --git a/eval/src/tests/tensor/instruction_benchmark/CMakeLists.txt b/eval/src/tests/tensor/instruction_benchmark/CMakeLists.txt
index b5949398f50..4342a965060 100644
--- a/eval/src/tests/tensor/instruction_benchmark/CMakeLists.txt
+++ b/eval/src/tests/tensor/instruction_benchmark/CMakeLists.txt
@@ -1,9 +1,17 @@
# Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
vespa_add_executable(vespa-tensor-instructions-benchmark
+ SOURCES
+ prod_benchmark.cpp
+ OUTPUT_NAME vespa-tensor-instructions-benchmark
+ INSTALL bin
+ DEPENDS
+ vespaeval
+ GTest::GTest
+)
+
+vespa_add_executable(eval_instruction_benchmark_app TEST
SOURCES
instruction_benchmark.cpp
- OUTPUT_NAME vespa-tensor-instructions-benchmark
- INSTALL bin
DEPENDS
vespaeval
GTest::GTest
diff --git a/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp b/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp
index 0299dc3ebba..98e8909949c 100644
--- a/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp
+++ b/eval/src/tests/tensor/instruction_benchmark/instruction_benchmark.cpp
@@ -227,11 +227,13 @@ struct Impl {
//-----------------------------------------------------------------------------
Impl default_tensor_engine_impl(1, "DefaultTensorEngine", "OLD PROD", DefaultTensorEngine::ref(), false);
-Impl simple_value_impl(3, " SimpleValue", " SimpleV", SimpleValueBuilderFactory::get(), false);
Impl fast_value_impl(0, " FastValue", "NEW PROD", FastValueBuilderFactory::get(), false);
+#ifndef BM_ONLY_PROD
Impl optimized_fast_value_impl(2, "Optimized FastValue", "Optimize", FastValueBuilderFactory::get(), true);
+Impl default_tensor_value_impl(3, " DefaultValue", "DefaultV", DefaultValueBuilderFactory::get(), false);
+Impl simple_value_impl(4, " SimpleValue", " SimpleV", SimpleValueBuilderFactory::get(), false);
Impl packed_mixed_tensor_impl(5, " PackedMixedTensor", " Packed", PackedMixedTensorBuilderFactory::get(), false);
-Impl default_tensor_value_impl(4, " DefaultValue", "DefaultV", DefaultValueBuilderFactory::get(), false);
+#endif
vespalib::string short_header("--------");
constexpr double budget = 5.0;
@@ -239,12 +241,16 @@ constexpr double best_limit = 0.95; // everything within 95% of best performance
constexpr double bad_limit = 0.90; // BAD: new prod has performance lower than 90% of old prod
constexpr double good_limit = 1.10; // GOOD: new prod has performance higher than 110% of old prod
-std::vector<CREF<Impl>> impl_list = {default_tensor_engine_impl,
- simple_value_impl,
+std::vector<CREF<Impl>> impl_list = {
fast_value_impl,
+#ifndef BM_ONLY_PROD
optimized_fast_value_impl,
+ simple_value_impl,
+ default_tensor_value_impl,
packed_mixed_tensor_impl,
- default_tensor_value_impl};
+#endif
+ default_tensor_engine_impl
+};
//-----------------------------------------------------------------------------
diff --git a/eval/src/tests/tensor/instruction_benchmark/prod_benchmark.cpp b/eval/src/tests/tensor/instruction_benchmark/prod_benchmark.cpp
new file mode 100644
index 00000000000..5c18bb6ccae
--- /dev/null
+++ b/eval/src/tests/tensor/instruction_benchmark/prod_benchmark.cpp
@@ -0,0 +1,5 @@
+// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+
+#define BM_ONLY_PROD
+
+#include "instruction_benchmark.cpp"