Files
openvino/samples/cpp/benchmark_app/main.cpp

1309 lines
62 KiB
C++
Raw Normal View History

// Copyright (C) 2018-2023 Intel Corporation
2018-11-23 16:19:43 +03:00
// SPDX-License-Identifier: Apache-2.0
//
#include <algorithm>
#include <chrono>
#include <map>
#include <memory>
#include <string>
#include <utility>
#include <vector>
// clang-format off
#include "openvino/openvino.hpp"
#include "openvino/pass/serialize.hpp"
#ifndef IN_OV_COMPONENT
# define IN_OV_COMPONENT
# define WAS_OV_LIBRARY_DEFINED
#endif
#include "gna/gna_config.hpp"
#include "gpu/gpu_config.hpp"
#ifdef WAS_OV_LIBRARY_DEFINED
# undef IN_OV_COMPONENT
# undef WAS_OV_LIBRARY_DEFINED
#endif
#include "samples/args_helper.hpp"
#include "samples/common.hpp"
#include "samples/slog.hpp"
2018-11-23 16:19:43 +03:00
2019-04-12 18:25:53 +03:00
#include "benchmark_app.hpp"
#include "infer_request_wrap.hpp"
#include "inputs_filling.hpp"
#include "remote_tensors_filling.hpp"
2019-04-12 18:25:53 +03:00
#include "statistics_report.hpp"
2019-08-09 19:02:42 +03:00
#include "utils.hpp"
// clang-format on
2018-11-23 16:19:43 +03:00
namespace {
bool parse_and_check_command_line(int argc, char* argv[]) {
// ---------------------------Parsing and validating input
// arguments--------------------------------------
2019-04-12 18:25:53 +03:00
slog::info << "Parsing input parameters" << slog::endl;
gflags::ParseCommandLineNonHelpFlags(&argc, &argv, true);
2019-08-09 19:02:42 +03:00
if (FLAGS_help || FLAGS_h) {
show_usage();
2019-08-09 19:02:42 +03:00
showAvailableDevices();
2019-04-12 18:25:53 +03:00
return false;
}
2018-11-23 16:19:43 +03:00
2019-04-12 18:25:53 +03:00
if (FLAGS_m.empty()) {
show_usage();
2019-08-09 19:02:42 +03:00
throw std::logic_error("Model is required but not set. Please set -m option.");
2019-04-12 18:25:53 +03:00
}
2018-11-23 16:19:43 +03:00
if (FLAGS_latency_percentile > 100 || FLAGS_latency_percentile < 1) {
show_usage();
throw std::logic_error("The percentile value is incorrect. The applicable values range is [1, 100].");
}
2019-04-12 18:25:53 +03:00
if (FLAGS_api != "async" && FLAGS_api != "sync") {
2019-08-09 19:02:42 +03:00
throw std::logic_error("Incorrect API. Please set -api option to `sync` or `async` value.");
2019-04-12 18:25:53 +03:00
}
if (!FLAGS_hint.empty() && FLAGS_hint != "throughput" && FLAGS_hint != "tput" && FLAGS_hint != "latency" &&
FLAGS_hint != "cumulative_throughput" && FLAGS_hint != "ctput" && FLAGS_hint != "none") {
OV Performance Hints (CPU and GPU logic for selecting the actual configs), while AUTO/MULTI are passing them thru) (#6993) * rebasing the perf-modes-2021.3 to the 2021.4 Caveats: the (explicit) setting #streams is not disabled (as it was before for experiments with DLBenchmark), and the logic slighlty differ (streamsSet) (cherry picked from commit 1ae1edc0ed70fdea40f528fdaf8d00a9904d2a5c) * overriding streams (to force the TPUT mode to the DLBenchnark) (cherry picked from commit 7f506cda31abf35ac293d0dce32f602a0188c619) * disabling reducing #streams to fully mimic baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments) (cherry picked from commit 85073dd1dd2c7d43a89c37c8f646313f6ddfc650) * clang/identation (cherry picked from commit 050a4155a923cee294c8689d685b39247b7a172a) * splitting the Transformation to general and CPU specific. Now hopefully,this fully mimics the baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments), as the streams reduce num (as well as early exit on GRU/LSTM/TensorIterator) is deisabled (cherry picked from commit e98b2c1a67f2542a686543594b75b575ef515196) * disabling GRU/LSTM/TI + reducing of streams + 5D considered compute-limited only for int8 (cherry picked from commit 32b8d80dee18685ebf3d069bb4cd2172af7363b7) * refactored to avoid compute_limited_ratio, reverted the reducing #streams, removed LSTM from limitations (cherry picked from commit f2b972171b29cf599aae2407ceec2e6adb67e4e9) * isa-based threshold logic (cherry picked from commit b218457e1a93fcb3374eb9da948fdad2175ec33a) * mode->hint (cherry picked from commit ec20aa8ecaf3222f2a6fdfe9153cf6c9dfdd6a54) * optional PERFORMANCE_HINT_NUM_REQUESTS (cherry picked from commit 5a3883e3f36e7928c6391094ae10711c8e4c3b5c) * moving the perfHints to the common OV config class + initial tests (CPU only, as the actual AUTO/MULTI should be accommodated on the master) (cherry picked from commit (then fixed)45bafe7d527f466507dea0693aeed51be4ebf776) * AUTO support for PerfHints * MULTI support for PerfHints * Enabling Perf hints for the GPU plugin * brushing settings output a bit * disabling "throughput" perf hint being default (until OV 2.0) * uncommenting the logic which was disabled to force the DLBenchmark to use the throughput mode by default * removing dead and experimental code, and debug printfs * clang/code-style * code-review remarks * Moved the output of the actual params that the hint produced to the right place * aligning MULTI's GetConfig beh to HETERO's as captured in the preso (CVS-59960) ratified with the ArchForum * clang * benchmark_app brushing * Update inference-engine/samples/benchmark_app/README.md * propagating the perf hints thru one more scenario in the merged AUTO-MULTI * fixed mispint * Python benchmark_app update for perf hints * addresssing reviewers comments on the python benchmark_app * simplifying/brushing logic a bit * refactor the heuristic to the separate file (to be shared with iGPU soon) * refactor conversion of modes to the specific GPU config per feedback from Vladimir
2021-09-13 15:40:36 +03:00
throw std::logic_error("Incorrect performance hint. Please set -hint option to"
"`throughput`(tput), `latency', 'cumulative_throughput'(ctput) value or 'none'.");
OV Performance Hints (CPU and GPU logic for selecting the actual configs), while AUTO/MULTI are passing them thru) (#6993) * rebasing the perf-modes-2021.3 to the 2021.4 Caveats: the (explicit) setting #streams is not disabled (as it was before for experiments with DLBenchmark), and the logic slighlty differ (streamsSet) (cherry picked from commit 1ae1edc0ed70fdea40f528fdaf8d00a9904d2a5c) * overriding streams (to force the TPUT mode to the DLBenchnark) (cherry picked from commit 7f506cda31abf35ac293d0dce32f602a0188c619) * disabling reducing #streams to fully mimic baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments) (cherry picked from commit 85073dd1dd2c7d43a89c37c8f646313f6ddfc650) * clang/identation (cherry picked from commit 050a4155a923cee294c8689d685b39247b7a172a) * splitting the Transformation to general and CPU specific. Now hopefully,this fully mimics the baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments), as the streams reduce num (as well as early exit on GRU/LSTM/TensorIterator) is deisabled (cherry picked from commit e98b2c1a67f2542a686543594b75b575ef515196) * disabling GRU/LSTM/TI + reducing of streams + 5D considered compute-limited only for int8 (cherry picked from commit 32b8d80dee18685ebf3d069bb4cd2172af7363b7) * refactored to avoid compute_limited_ratio, reverted the reducing #streams, removed LSTM from limitations (cherry picked from commit f2b972171b29cf599aae2407ceec2e6adb67e4e9) * isa-based threshold logic (cherry picked from commit b218457e1a93fcb3374eb9da948fdad2175ec33a) * mode->hint (cherry picked from commit ec20aa8ecaf3222f2a6fdfe9153cf6c9dfdd6a54) * optional PERFORMANCE_HINT_NUM_REQUESTS (cherry picked from commit 5a3883e3f36e7928c6391094ae10711c8e4c3b5c) * moving the perfHints to the common OV config class + initial tests (CPU only, as the actual AUTO/MULTI should be accommodated on the master) (cherry picked from commit (then fixed)45bafe7d527f466507dea0693aeed51be4ebf776) * AUTO support for PerfHints * MULTI support for PerfHints * Enabling Perf hints for the GPU plugin * brushing settings output a bit * disabling "throughput" perf hint being default (until OV 2.0) * uncommenting the logic which was disabled to force the DLBenchmark to use the throughput mode by default * removing dead and experimental code, and debug printfs * clang/code-style * code-review remarks * Moved the output of the actual params that the hint produced to the right place * aligning MULTI's GetConfig beh to HETERO's as captured in the preso (CVS-59960) ratified with the ArchForum * clang * benchmark_app brushing * Update inference-engine/samples/benchmark_app/README.md * propagating the perf hints thru one more scenario in the merged AUTO-MULTI * fixed mispint * Python benchmark_app update for perf hints * addresssing reviewers comments on the python benchmark_app * simplifying/brushing logic a bit * refactor the heuristic to the separate file (to be shared with iGPU soon) * refactor conversion of modes to the specific GPU config per feedback from Vladimir
2021-09-13 15:40:36 +03:00
}
if (FLAGS_hint != "none" && (FLAGS_nstreams != "" || FLAGS_nthreads != 0 || FLAGS_pin != "")) {
throw std::logic_error("-nstreams, -nthreads and -pin options are fine tune options. To use them you "
"should explicitely set -hint option to none. This is not OpenVINO limitation "
"(those options can be used in OpenVINO together), but a benchmark_app UI rule.");
}
if (!FLAGS_report_type.empty() && FLAGS_report_type != noCntReport && FLAGS_report_type != averageCntReport &&
FLAGS_report_type != detailedCntReport && FLAGS_report_type != sortDetailedCntReport) {
std::string err = "only " + std::string(noCntReport) + "/" + std::string(averageCntReport) + "/" +
std::string(detailedCntReport) + "/" + std::string(sortDetailedCntReport) +
" report types are supported (invalid -report_type option value)";
2019-04-12 18:25:53 +03:00
throw std::logic_error(err);
}
2019-10-04 19:26:43 +03:00
if ((FLAGS_report_type == averageCntReport) && ((FLAGS_d.find("MULTI") != std::string::npos))) {
throw std::logic_error("only " + std::string(detailedCntReport) + " report type is supported for MULTI device");
}
if (!FLAGS_pcsort.empty() && FLAGS_pcsort != "sort" && FLAGS_pcsort != "no_sort" && FLAGS_pcsort != "simple_sort") {
std::string pcsort_err = std::string("Incorrect performance count sort . Please set -pcsort option to ") +
std::string("'sort', 'no_sort', 'simple_sort'.");
throw std::logic_error(pcsort_err);
}
bool isNetworkCompiled = fileExt(FLAGS_m) == "blob";
bool isPrecisionSet = !(FLAGS_ip.empty() && FLAGS_op.empty() && FLAGS_iop.empty());
if (isNetworkCompiled && isPrecisionSet) {
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
std::string err = std::string("Cannot set precision for a compiled model. ") +
std::string("Please re-compile your model with required precision.");
throw std::logic_error(err);
}
2019-04-12 18:25:53 +03:00
return true;
}
2018-11-23 16:19:43 +03:00
void next_step(const std::string additional_info = "") {
2019-08-09 19:02:42 +03:00
static size_t step_id = 0;
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
static const std::map<size_t, std::string> step_names = {{1, "Parsing and validating input arguments"},
{2, "Loading OpenVINO Runtime"},
{3, "Setting device configuration"},
{4, "Reading model files"},
{5, "Resizing model to match image sizes and given batch"},
{6, "Configuring input of the model"},
{7, "Loading the model to the device"},
{8, "Querying optimal runtime parameters"},
{9, "Creating infer requests and preparing input tensors"},
{10, "Measuring performance"},
{11, "Dumping statistics report"}};
2019-08-09 19:02:42 +03:00
step_id++;
OPENVINO_ASSERT(step_names.count(step_id) != 0,
"Step ID ",
step_id,
" is out of total steps number ",
step_names.size());
2019-08-09 19:02:42 +03:00
std::cout << "[Step " << step_id << "/" << step_names.size() << "] " << step_names.at(step_id)
<< (additional_info.empty() ? "" : " (" + additional_info + ")") << std::endl;
}
ov::hint::PerformanceMode get_performance_hint(const std::string& device, const ov::Core& core) {
OPENVINO_SUPPRESS_DEPRECATED_START
ov::hint::PerformanceMode ov_perf_hint = ov::hint::PerformanceMode::UNDEFINED;
OPENVINO_SUPPRESS_DEPRECATED_END
auto supported_properties = core.get_property(device, ov::supported_properties);
if (std::find(supported_properties.begin(), supported_properties.end(), ov::hint::performance_mode) !=
supported_properties.end()) {
if (FLAGS_hint != "") {
if (FLAGS_hint == "throughput" || FLAGS_hint == "tput") {
ov_perf_hint = ov::hint::PerformanceMode::THROUGHPUT;
} else if (FLAGS_hint == "latency") {
ov_perf_hint = ov::hint::PerformanceMode::LATENCY;
} else if (FLAGS_hint == "cumulative_throughput" || FLAGS_hint == "ctput") {
ov_perf_hint = ov::hint::PerformanceMode::CUMULATIVE_THROUGHPUT;
} else if (FLAGS_hint == "none") {
OPENVINO_SUPPRESS_DEPRECATED_START
ov_perf_hint = ov::hint::PerformanceMode::UNDEFINED;
OPENVINO_SUPPRESS_DEPRECATED_END
} else {
throw std::logic_error(
"Incorrect performance hint. Please set -hint option to"
"`throughput`(tput), `latency', 'cumulative_throughput'(ctput) value or 'none'.");
}
} else {
ov_perf_hint =
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
FLAGS_api == "async" ? ov::hint::PerformanceMode::THROUGHPUT : ov::hint::PerformanceMode::LATENCY;
slog::warn << "Performance hint was not explicitly specified in command line. "
"Device("
<< device << ") performance hint will be set to " << ov_perf_hint << "." << slog::endl;
}
} else {
if (FLAGS_hint != "") {
slog::warn << "Device(" << device << ") does not support performance hint property(-hint)." << slog::endl;
}
}
return ov_perf_hint;
}
[AUTO] Update property setting rules (#13848) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2022-11-17 16:38:47 +08:00
void setDeviceProperty(ov::Core& core,
std::string& device,
ov::AnyMap& device_config,
const std::pair<std::string, ov::Any>& property,
const std::pair<std::string, ov::Any>& config = {}) {
auto supported_properties = core.get_property(device, ov::supported_properties);
auto supported = [&](const std::string& key) {
return std::find(std::begin(supported_properties), std::end(supported_properties), key) !=
std::end(supported_properties);
};
// check if the HW device supported this property
std::pair<std::string, ov::Any> device_property;
if (!config.first.empty() && supported(config.first)) {
device_property = config;
} else if (supported(property.first))
device_property = property;
if (device_property.first.empty())
return;
[AUTO] Enable Benchmark APP to parse the ov::device::properties through dump_config()/load_config() (#14057) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. * 1. Fix the issue that the dumped configuration file retrieves empty config list when using OpenCV to dump configuration. 2. Enable load_config() to load secondary property. 3. ov:device:properties from command line will replace the ov::device::properties loaded from configuration file. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update the performance statistics showing format. * Update format. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update README to add some simple configuration files loaded into benchmark app. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. Enable dump/load function for AUTO to support hw device property setting thorugh configuration JSON. 2. Update README.md to example a simple JSON file containing the hw device properties setting for AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. * Update. * Update. * Drop the changes within dump/load of OpenCV config parsing. * Update. * Correct property name. Update ov::num_stream to ov::inference_precision. Signed-off-by: Wang, Yang <yang4.wang@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2022-11-28 21:09:51 +08:00
update_device_properties_setting(device, device_config, device_property);
[AUTO] Update property setting rules (#13848) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2022-11-17 16:38:47 +08:00
}
void warn_if_no_batch(const benchmark_app::InputsInfo& first_inputs) {
if (!std::any_of(first_inputs.begin(),
first_inputs.end(),
[](const std::pair<const std::string, benchmark_app::InputInfo>& info) {
return ov::layout::has_batch(info.second.layout);
})) {
slog::warn
<< "No batch dimension was found, asssuming batch to be 1. Beware: this might affect FPS calculation."
<< slog::endl;
}
}
void fuse_mean_scale(ov::preprocess::PrePostProcessor& preproc, const benchmark_app::InputsInfo& app_inputs_info) {
// TODO: remove warning after 23.3 release
bool warned = false;
constexpr char warn_msg[] = "Mean/scale values are fused into the model. This slows down performance compared to "
"--imean and --iscale which existed before";
for (const std::pair<std::string, benchmark_app::InputInfo> input_info : app_inputs_info) {
if (!input_info.second.mean.empty()) {
if (!warned) {
slog::warn << warn_msg << slog::endl;
warned = true;
}
preproc.input(input_info.first)
.preprocess()
.convert_element_type(ov::element::f32)
.mean(input_info.second.mean);
}
if (!input_info.second.scale.empty()) {
if (!warned) {
slog::warn << warn_msg << slog::endl;
warned = true;
}
preproc.input(input_info.first)
.preprocess()
.convert_element_type(ov::element::f32)
.scale(input_info.second.scale);
}
}
}
} // namespace
2019-04-12 18:25:53 +03:00
/**
* @brief The entry point of the benchmark application
*/
int main(int argc, char* argv[]) {
2019-10-04 19:26:43 +03:00
std::shared_ptr<StatisticsReport> statistics;
2019-04-12 18:25:53 +03:00
try {
ov::CompiledModel compiledModel;
2020-02-11 22:48:49 +03:00
// ----------------- 1. Parsing and validating input arguments
// -------------------------------------------------
2019-08-09 19:02:42 +03:00
next_step();
2019-04-12 18:25:53 +03:00
if (!parse_and_check_command_line(argc, argv)) {
2019-04-12 18:25:53 +03:00
return 0;
2018-11-23 16:19:43 +03:00
}
2020-02-11 22:48:49 +03:00
bool isNetworkCompiled = fileExt(FLAGS_m) == "blob";
if (isNetworkCompiled) {
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Model is compiled" << slog::endl;
2020-02-11 22:48:49 +03:00
}
std::vector<gflags::CommandLineFlagInfo> flags;
StatisticsReport::Parameters command_line_arguments;
gflags::GetAllFlags(&flags);
for (auto& flag : flags) {
if (!flag.is_default) {
command_line_arguments.emplace_back(flag.name, flag.name, flag.current_value);
2019-10-04 19:26:43 +03:00
}
}
if (!FLAGS_report_type.empty()) {
statistics = FLAGS_json_stats ? std::make_shared<StatisticsReportJSON>(
StatisticsReport::Config{FLAGS_report_type, FLAGS_report_folder})
: std::make_shared<StatisticsReport>(
StatisticsReport::Config{FLAGS_report_type, FLAGS_report_folder});
statistics->add_parameters(StatisticsReport::Category::COMMAND_LINE_PARAMETERS, command_line_arguments);
2019-10-04 19:26:43 +03:00
}
auto isFlagSetInCommandLine = [&command_line_arguments](const std::string& name) {
return (std::find_if(command_line_arguments.begin(),
command_line_arguments.end(),
[name](const StatisticsVariant& p) {
return p.json_name == name;
}) != command_line_arguments.end());
};
std::string device_name = FLAGS_d;
// Parse devices
auto devices = parse_devices(device_name);
2019-10-04 19:26:43 +03:00
// Parse nstreams per device
std::map<std::string, std::string> device_nstreams = parse_value_per_device(devices, FLAGS_nstreams);
std::map<std::string, std::string> device_infer_precision =
parse_value_per_device(devices, FLAGS_infer_precision);
// Load device config file if specified
std::map<std::string, ov::AnyMap> config;
if (!FLAGS_load_config.empty()) {
load_config(FLAGS_load_config, config);
}
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
/** This vector stores paths to the processed images with input names**/
auto inputFiles = parse_input_arguments(gflags::GetArgvs());
2018-11-23 16:19:43 +03:00
DOCS: ported changes from 2022.1 release branch (#11206) * Extensibility guide with FE extensions and remove OV_FRAMEWORK_MAP from docs * Rework of Extensibility Intro, adopted examples to missing OPENVINO_FRAMEWORK_MAP * Removed OPENVINO_FRAMEWORK_MAP reference * Frontend extension detailed documentation * Fixed distributed snippets * Fixed snippet inclusion in FE extension document and chapter headers * Fixed wrong name in a snippet reference * Fixed test for template extension due to changed number of loaded extensions * Update docs/Extensibility_UG/frontend_extensions.md Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com> * Minor fixes in extension snippets * Small grammar fix Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com> Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com> * DOCS: transition banner (#10973) * transition banner * minor fix * update transition banner * updates * update custom.js * updates * updates * Documentation fixes (#11044) * Benchmark app usage * Fixed link to the devices * More fixes * Update docs/OV_Runtime_UG/multi_device.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Removed several hardcoded links Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Updated documentation for compile_tool (#11049) * Added deployment guide (#11060) * Added deployment guide * Added local distribution * Updates * Fixed more indentations * Removed obsolete code snippets (#11061) * Removed obsolete code snippets * NCC style * Fixed NCC for BA * Add a troubleshooting issue for PRC installation (#11074) * updates * adding gna to linux * add missing reference * update * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * update * minor updates * add gna item to yum and apt * add gna to get started page * update reference formatting * merge commit * add a troubleshooting issue * update * update * fix CVS-71846 Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * DOCS: fixed hardcoded links (#11100) * Fixes * Use links * applying reviewers comments to the Opt Guide (#11093) * applying reviewrs comments * fixed refs, more structuring (bold, bullets, etc) * refactoring tput/latency sections * next iteration (mostly latency), also brushed the auto-batching and other sections * updates sync/async images * common opts brushed * WIP tput redesigned * minor brushing of common and auto-batching * Tput fully refactored * fixed doc name in the link * moved int8 perf counters to the right section * fixed links * fixed broken quotes * fixed more links * add ref to the internals to the TOC * Added a note on the batch size Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com> * [80085] New images for docs (#11114) * change doc structure * fix manager tools * fix manager tools 3 step * fix manager tools 3 step * new img * new img for OV Runtime * fix steps * steps * fix intendents * change list * fix space * fix space * code snippets fix * change display * Benchmarks 2022 1 (#11130) * Minor fixes * Updates for 2022.1 * Edits according to the review * Edits according to review comments * Edits according to review comments * Edits according to review comments * Fixed table * Edits according to review comments * Removed config for Intel® Core™ i7-11850HE * Removed forward-tacotron-duration-prediction-241 graph * Added resnet-18-pytorch * Add info about Docker images in Deployment guide (#11136) * Renamed user guides (#11137) * fix screenshot (#11140) * More conservative recommendations on dynamic shapes usage in docs (#11161) * More conservative recommendations about using dynamic shapes * Duplicated statement from C++ part to Python part of reshape doc (no semantical changes) * Update ShapeInference.md (#11168) * Benchmarks 2022 1 updates (#11180) * Updated graphs * Quick fix for TODO in Dynamic Shapes article * Anchor link fixes * Fixed DM config (#11199) * DOCS: doxy sphinxtabs (#11027) * initial implementation of doxy sphinxtabs * fixes * fixes * fixes * fixes * fixes * WA for ignored visibility attribute * Fixes Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com> Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com> Co-authored-by: Nikolay Tyukaev <nikolay.tyukaev@intel.com> Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> Co-authored-by: Yuan Xu <yuan1.xu@intel.com> Co-authored-by: Maxim Shevtsov <maxim.y.shevtsov@intel.com> Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com> Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> Co-authored-by: Ilya Naumov <ilya.naumov@intel.com> Co-authored-by: Evgenya Stepyreva <evgenya.stepyreva@intel.com>
2022-03-24 22:27:29 +03:00
// ----------------- 2. Loading the OpenVINO Runtime
// -----------------------------------------------------------
2019-08-09 19:02:42 +03:00
next_step();
2018-11-23 16:19:43 +03:00
ov::Core core;
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (!FLAGS_extensions.empty()) {
// Extensions are loaded as a shared library
core.add_extension(FLAGS_extensions);
slog::info << "Extensions are loaded: " << FLAGS_extensions << slog::endl;
}
OPENVINO_SUPPRESS_DEPRECATED_START
// Load clDNN Extensions
if ((FLAGS_d.find("GPU") != std::string::npos) && !FLAGS_c.empty()) {
// Override config if command line parameter is specified
if (!config.count("GPU"))
config["GPU"] = {};
config["GPU"][CONFIG_KEY(CONFIG_FILE)] = FLAGS_c;
}
if (config.count("GPU") && config.at("GPU").count(CONFIG_KEY(CONFIG_FILE))) {
auto ext = config.at("GPU").at(CONFIG_KEY(CONFIG_FILE)).as<std::string>();
core.set_property("GPU", {{CONFIG_KEY(CONFIG_FILE), ext}});
slog::info << "GPU extensions are loaded: " << ext << slog::endl;
2018-11-23 16:19:43 +03:00
}
OPENVINO_SUPPRESS_DEPRECATED_END
2018-11-23 16:19:43 +03:00
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "OpenVINO:" << slog::endl;
slog::info << ov::get_openvino_version() << slog::endl;
slog::info << "Device info:" << slog::endl;
slog::info << core.get_versions(device_name) << slog::endl;
2018-11-23 16:19:43 +03:00
// ----------------- 3. Setting device configuration
// -----------------------------------------------------------
2019-08-09 19:02:42 +03:00
next_step();
auto getDeviceTypeFromName = [](std::string device) -> std::string {
return device.substr(0, device.find_first_of(".("));
};
// Set default values from dumped config
std::set<std::string> default_devices;
for (auto& device : devices) {
auto default_config = config.find(getDeviceTypeFromName(device));
if (default_config != config.end()) {
if (!config.count(device)) {
config[device] = default_config->second;
default_devices.emplace(default_config->first);
}
}
}
for (auto& device : default_devices) {
config.erase(device);
}
bool perf_counts = false;
// check if using the virtual device
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
auto is_virtual = is_virtual_device_found(devices);
auto hardware_devices = devices;
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
// Remove the hardware devices if AUTO/MULTI/HETERO appears in the devices list.
if (is_virtual) {
devices.clear();
[AUTO] Update property setting rules (#13848) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2022-11-17 16:38:47 +08:00
// Parse out the currect virtual device as the target device.
std::string virtual_device = split(device_name, ':').at(0);
auto iter_virtual = std::find(hardware_devices.begin(), hardware_devices.end(), virtual_device);
hardware_devices.erase(iter_virtual);
devices.push_back(virtual_device);
parse_value_for_virtual_device(virtual_device, device_nstreams);
parse_value_for_virtual_device(virtual_device, device_infer_precision);
}
[AUTO] Update property setting rules (#13848) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2022-11-17 16:38:47 +08:00
// Update config per device according to command line parameters
for (auto& device : devices) {
auto& device_config = config[device];
auto ov_perf_hint = get_performance_hint(device, core);
OPENVINO_SUPPRESS_DEPRECATED_START
if (isFlagSetInCommandLine("hint")) {
if (ov_perf_hint != ov::hint::PerformanceMode::UNDEFINED) {
// apply command line hint setting and override if hint exists
device_config[ov::hint::performance_mode.name()] = ov_perf_hint;
} else {
device_config.erase(ov::hint::performance_mode.name());
}
} else if (ov_perf_hint != ov::hint::PerformanceMode::UNDEFINED) {
// keep hint setting in the config if no hint setting from command line
device_config.emplace(ov::hint::performance_mode(ov_perf_hint));
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
}
OPENVINO_SUPPRESS_DEPRECATED_END
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
if (FLAGS_nireq != 0)
device_config[ov::hint::num_requests.name()] = unsigned(FLAGS_nireq);
OV Performance Hints (CPU and GPU logic for selecting the actual configs), while AUTO/MULTI are passing them thru) (#6993) * rebasing the perf-modes-2021.3 to the 2021.4 Caveats: the (explicit) setting #streams is not disabled (as it was before for experiments with DLBenchmark), and the logic slighlty differ (streamsSet) (cherry picked from commit 1ae1edc0ed70fdea40f528fdaf8d00a9904d2a5c) * overriding streams (to force the TPUT mode to the DLBenchnark) (cherry picked from commit 7f506cda31abf35ac293d0dce32f602a0188c619) * disabling reducing #streams to fully mimic baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments) (cherry picked from commit 85073dd1dd2c7d43a89c37c8f646313f6ddfc650) * clang/identation (cherry picked from commit 050a4155a923cee294c8689d685b39247b7a172a) * splitting the Transformation to general and CPU specific. Now hopefully,this fully mimics the baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments), as the streams reduce num (as well as early exit on GRU/LSTM/TensorIterator) is deisabled (cherry picked from commit e98b2c1a67f2542a686543594b75b575ef515196) * disabling GRU/LSTM/TI + reducing of streams + 5D considered compute-limited only for int8 (cherry picked from commit 32b8d80dee18685ebf3d069bb4cd2172af7363b7) * refactored to avoid compute_limited_ratio, reverted the reducing #streams, removed LSTM from limitations (cherry picked from commit f2b972171b29cf599aae2407ceec2e6adb67e4e9) * isa-based threshold logic (cherry picked from commit b218457e1a93fcb3374eb9da948fdad2175ec33a) * mode->hint (cherry picked from commit ec20aa8ecaf3222f2a6fdfe9153cf6c9dfdd6a54) * optional PERFORMANCE_HINT_NUM_REQUESTS (cherry picked from commit 5a3883e3f36e7928c6391094ae10711c8e4c3b5c) * moving the perfHints to the common OV config class + initial tests (CPU only, as the actual AUTO/MULTI should be accommodated on the master) (cherry picked from commit (then fixed)45bafe7d527f466507dea0693aeed51be4ebf776) * AUTO support for PerfHints * MULTI support for PerfHints * Enabling Perf hints for the GPU plugin * brushing settings output a bit * disabling "throughput" perf hint being default (until OV 2.0) * uncommenting the logic which was disabled to force the DLBenchmark to use the throughput mode by default * removing dead and experimental code, and debug printfs * clang/code-style * code-review remarks * Moved the output of the actual params that the hint produced to the right place * aligning MULTI's GetConfig beh to HETERO's as captured in the preso (CVS-59960) ratified with the ArchForum * clang * benchmark_app brushing * Update inference-engine/samples/benchmark_app/README.md * propagating the perf hints thru one more scenario in the merged AUTO-MULTI * fixed mispint * Python benchmark_app update for perf hints * addresssing reviewers comments on the python benchmark_app * simplifying/brushing logic a bit * refactor the heuristic to the separate file (to be shared with iGPU soon) * refactor conversion of modes to the specific GPU config per feedback from Vladimir
2021-09-13 15:40:36 +03:00
// Set performance counter
if (isFlagSetInCommandLine("pc")) {
// set to user defined value
device_config[ov::enable_profiling.name()] = FLAGS_pc;
} else if (device_config.count(ov::enable_profiling.name()) &&
(device_config.at(ov::enable_profiling.name()).as<bool>())) {
slog::warn << "Performance counters for " << device
<< " device is turned on. To print results use -pc option." << slog::endl;
} else if (FLAGS_report_type == detailedCntReport || FLAGS_report_type == averageCntReport ||
FLAGS_report_type == sortDetailedCntReport) {
slog::warn << "Turn on performance counters for " << device << " device since report type is "
<< FLAGS_report_type << "." << slog::endl;
device_config[ov::enable_profiling.name()] = true;
} else if (!FLAGS_exec_graph_path.empty()) {
slog::warn << "Turn on performance counters for " << device << " device due to execution graph dumping."
<< slog::endl;
device_config[ov::enable_profiling.name()] = true;
} else if (!FLAGS_pcsort.empty()) {
slog::warn << "Turn on sorted performance counters for " << device << " device since pcsort value is "
<< FLAGS_pcsort << "." << slog::endl;
device_config[ov::enable_profiling.name()] = true;
} else {
// set to default value
device_config[ov::enable_profiling.name()] = FLAGS_pc;
2020-04-13 21:17:23 +03:00
}
perf_counts = (device_config.at(ov::enable_profiling.name()).as<bool>()) ? true : perf_counts;
auto supported_properties = core.get_property(device, ov::supported_properties);
auto supported = [&](const std::string& key) {
return std::find(std::begin(supported_properties), std::end(supported_properties), key) !=
std::end(supported_properties);
};
OPENVINO_SUPPRESS_DEPRECATED_START
OV Performance Hints (CPU and GPU logic for selecting the actual configs), while AUTO/MULTI are passing them thru) (#6993) * rebasing the perf-modes-2021.3 to the 2021.4 Caveats: the (explicit) setting #streams is not disabled (as it was before for experiments with DLBenchmark), and the logic slighlty differ (streamsSet) (cherry picked from commit 1ae1edc0ed70fdea40f528fdaf8d00a9904d2a5c) * overriding streams (to force the TPUT mode to the DLBenchnark) (cherry picked from commit 7f506cda31abf35ac293d0dce32f602a0188c619) * disabling reducing #streams to fully mimic baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments) (cherry picked from commit 85073dd1dd2c7d43a89c37c8f646313f6ddfc650) * clang/identation (cherry picked from commit 050a4155a923cee294c8689d685b39247b7a172a) * splitting the Transformation to general and CPU specific. Now hopefully,this fully mimics the baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments), as the streams reduce num (as well as early exit on GRU/LSTM/TensorIterator) is deisabled (cherry picked from commit e98b2c1a67f2542a686543594b75b575ef515196) * disabling GRU/LSTM/TI + reducing of streams + 5D considered compute-limited only for int8 (cherry picked from commit 32b8d80dee18685ebf3d069bb4cd2172af7363b7) * refactored to avoid compute_limited_ratio, reverted the reducing #streams, removed LSTM from limitations (cherry picked from commit f2b972171b29cf599aae2407ceec2e6adb67e4e9) * isa-based threshold logic (cherry picked from commit b218457e1a93fcb3374eb9da948fdad2175ec33a) * mode->hint (cherry picked from commit ec20aa8ecaf3222f2a6fdfe9153cf6c9dfdd6a54) * optional PERFORMANCE_HINT_NUM_REQUESTS (cherry picked from commit 5a3883e3f36e7928c6391094ae10711c8e4c3b5c) * moving the perfHints to the common OV config class + initial tests (CPU only, as the actual AUTO/MULTI should be accommodated on the master) (cherry picked from commit (then fixed)45bafe7d527f466507dea0693aeed51be4ebf776) * AUTO support for PerfHints * MULTI support for PerfHints * Enabling Perf hints for the GPU plugin * brushing settings output a bit * disabling "throughput" perf hint being default (until OV 2.0) * uncommenting the logic which was disabled to force the DLBenchmark to use the throughput mode by default * removing dead and experimental code, and debug printfs * clang/code-style * code-review remarks * Moved the output of the actual params that the hint produced to the right place * aligning MULTI's GetConfig beh to HETERO's as captured in the preso (CVS-59960) ratified with the ArchForum * clang * benchmark_app brushing * Update inference-engine/samples/benchmark_app/README.md * propagating the perf hints thru one more scenario in the merged AUTO-MULTI * fixed mispint * Python benchmark_app update for perf hints * addresssing reviewers comments on the python benchmark_app * simplifying/brushing logic a bit * refactor the heuristic to the separate file (to be shared with iGPU soon) * refactor conversion of modes to the specific GPU config per feedback from Vladimir
2021-09-13 15:40:36 +03:00
// the rest are individual per-device settings (overriding the values set with perf modes)
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
auto set_throughput_streams = [&]() {
std::string key = getDeviceTypeFromName(device) + "_THROUGHPUT_STREAMS";
auto it_device_nstreams = device_nstreams.find(device);
if (it_device_nstreams != device_nstreams.end()) {
// set to user defined value
if (supported(key)) {
device_config[key] = it_device_nstreams->second;
} else if (supported(ov::num_streams.name())) {
// Use API 2.0 key for streams
key = ov::num_streams.name();
device_config[key] = it_device_nstreams->second;
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
} else if (is_virtual_device(device)) {
key = ov::num_streams.name();
update_device_config_for_virtual_device(it_device_nstreams->second,
device_config,
ov::num_streams);
} else {
throw std::logic_error("Device " + device + " doesn't support config key '" + key + "' " +
"and '" + ov::num_streams.name() + "'!" +
"Please specify -nstreams for correct devices in format "
"<dev1>:<nstreams1>,<dev2>:<nstreams2>" +
" or via configuration file.");
}
} else if (ov_perf_hint == ov::hint::PerformanceMode::UNDEFINED && !device_config.count(key) &&
(FLAGS_api == "async")) {
slog::warn << "-nstreams default value is determined automatically for " << device
<< " device. "
"Although the automatic selection usually provides a "
"reasonable performance, "
"but it still may be non-optimal for some cases, for more "
"information look at README."
<< slog::endl;
if (supported(key)) {
device_config[key] = std::string(getDeviceTypeFromName(device) + "_THROUGHPUT_AUTO");
} else if (supported(ov::num_streams.name())) {
// Use API 2.0 key for streams
key = ov::num_streams.name();
device_config[key] = ov::streams::AUTO;
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
} else if (is_virtual_device(device)) {
// Set nstreams to default value auto if no nstreams specified from cmd line.
for (auto& hwdevice : hardware_devices) {
std::string key = std::string(getDeviceTypeFromName(hwdevice) + "_THROUGHPUT_STREAMS");
auto value = std::string(getDeviceTypeFromName(hwdevice) + "_THROUGHPUT_AUTO");
setDeviceProperty(core,
hwdevice,
device_config,
ov::num_streams(ov::streams::AUTO),
std::make_pair(key, value));
}
}
}
auto it_streams = device_config.find(ov::num_streams.name());
if (it_streams != device_config.end())
device_nstreams[device] = it_streams->second.as<std::string>();
};
OPENVINO_SUPPRESS_DEPRECATED_END
2020-04-13 21:17:23 +03:00
auto set_infer_precision = [&] {
auto it_device_infer_precision = device_infer_precision.find(device);
if (it_device_infer_precision != device_infer_precision.end()) {
// set to user defined value
if (supported(ov::hint::inference_precision.name())) {
device_config.emplace(ov::hint::inference_precision(it_device_infer_precision->second));
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
} else if (is_virtual_device(device)) {
update_device_config_for_virtual_device(it_device_infer_precision->second,
device_config,
ov::hint::inference_precision);
[AUTO] Update property setting rules (#13848) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2022-11-17 16:38:47 +08:00
} else {
throw std::logic_error("Device " + device + " doesn't support config key '" +
ov::hint::inference_precision.name() + "'! " +
"Please specify -infer_precision for correct devices in format "
"<dev1>:<infer_precision1>,<dev2>:<infer_precision2>" +
" or via configuration file.");
}
}
};
auto fix_pin_option = [](const std::string& str) -> std::string {
if (str == "NO")
return "NONE";
else if (str == "YES")
return "CORE";
else
return str;
};
auto set_nthreads_pin = [&](const std::string& str) {
auto property_name = str == "nthreads" ? ov::inference_num_threads.name() : ov::affinity.name();
auto property = str == "nthreads" ? ov::inference_num_threads(int(FLAGS_nthreads))
: ov::affinity(fix_pin_option(FLAGS_pin));
[AUTO] Update property setting rules (#13848) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2022-11-17 16:38:47 +08:00
if (supported(property_name) || device_name == "AUTO") {
// create nthreads/pin primary property for HW device or AUTO if -d is AUTO directly.
device_config[property.first] = property.second;
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
} else if (is_virtual) {
[AUTO] Update property setting rules (#13848) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2022-11-17 16:38:47 +08:00
// Create secondary property of -nthreads/-pin only for CPU if CPU device appears in the devices
// list specified by -d.
for (auto& device : hardware_devices) {
[AUTO] Update property setting rules (#13848) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com>
2022-11-17 16:38:47 +08:00
if (device == "CPU")
setDeviceProperty(core, device, device_config, property);
}
}
};
if (isFlagSetInCommandLine("nthreads"))
set_nthreads_pin("nthreads");
if (isFlagSetInCommandLine("pin"))
set_nthreads_pin("pin");
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
set_throughput_streams();
set_infer_precision();
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
if (is_virtual_device(device)) {
device_nstreams.erase(device);
2019-08-09 19:02:42 +03:00
}
2018-11-23 16:19:43 +03:00
}
auto result = std::find_if(config.begin(), config.end(), [&](const std::pair<std::string, ov::AnyMap>& item) {
if (device_name.find(item.first) == 0)
return true;
return false;
});
ov::AnyMap device_config = {};
if (result != config.end())
device_config = result->second;
2020-02-11 22:48:49 +03:00
size_t batchSize = FLAGS_b;
ov::element::Type type = ov::element::undefined;
2020-02-11 22:48:49 +03:00
std::string topology_name = "";
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
std::vector<benchmark_app::InputsInfo> app_inputs_info;
std::string output_name;
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
// Takes priority over config from file
if (!FLAGS_cache_dir.empty()) {
core.set_property(ov::cache_dir(FLAGS_cache_dir));
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
}
// If set batch size, disable the auto batching
if (FLAGS_b > 0) {
slog::warn << "Batch size is set. Auto batching will be disabled" << slog::endl;
device_config.insert(ov::hint::allow_auto_batching(false));
}
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
bool isDynamicNetwork = false;
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
if (FLAGS_load_from_file && !isNetworkCompiled) {
if (!FLAGS_mean_values.empty() || !FLAGS_scale_values.empty()) {
throw std::runtime_error("--mean_values and --scale_values aren't supported with --load_from_file. "
"The values can be set via model_optimizer while generating xml");
}
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
next_step();
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Skipping the step for loading model from file" << slog::endl;
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
next_step();
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Skipping the step for loading model from file" << slog::endl;
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
next_step();
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Skipping the step for loading model from file" << slog::endl;
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
auto startTime = Time::now();
compiledModel = core.compile_model(FLAGS_m, device_name, device_config);
auto duration_ms = get_duration_ms_till_now(startTime);
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Compile model took " << double_to_string(duration_ms) << " ms" << slog::endl;
slog::info << "Original model I/O parameters:" << slog::endl;
printInputAndOutputsInfoShort(compiledModel);
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
if (statistics)
statistics->add_parameters(
StatisticsReport::Category::EXECUTION_RESULTS,
{StatisticsVariant("compile model time (ms)", "load_model_time", duration_ms)});
convert_io_names_in_map(inputFiles, compiledModel.inputs());
app_inputs_info = get_inputs_info(FLAGS_shape,
FLAGS_layout,
batchSize,
FLAGS_data_shape,
inputFiles,
FLAGS_scale_values,
FLAGS_mean_values,
compiledModel.inputs());
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
if (batchSize == 0) {
batchSize = 1;
}
[Caching] Add caching options to benchmark app (#4909) * Python API for LoadNetwork by model file name * BenchmarkApp: Add caching and LoadNetworkFromFile support 2 new options are introduced - cache_dir <dir> - enables models caching - load_from_file - use new perform "LoadNetwork" by model file name Using both parameters will achieve maximum performance of read/load network on startup Tests: 1) Run "benchmark_app -h". Help will display 2 new options. After available devices there will be list of devices with cache support 2) ./benchmark_app -d CPU -i <model.xml> -load_from_file Verify that some test steps are skipped (related to ReadNetwork, re-shaping etc) 3) Pre-requisite: support of caching shall be enabled for Template plugin ./benchmark_app -d TEMPLATE -i <model.onnx> -load_from_file -cache_dir someDir Verify that "someDir" is created and generated blob is available Run again, verify that loading works as well (should be faster as it will not load onnx model) 4) Run same test as (3), but without -load_from_file option. Verify that cache is properly created For some devices loadNetwork time shall be improved when cache is available * Removed additional timing prints * Correction from old code * Revert "Removed additional timing prints" Additional change - when .blob is chosen instead of .xml, it takes priority over caching flags * Removed new time printings As discussed, these time measurements like 'total first inference time' will be available in 'timeTests' scripts * Fix clang-format issues
2021-05-17 13:41:15 +03:00
} else if (!isNetworkCompiled) {
// ----------------- 4. Reading the Intermediate Representation network
// ----------------------------------------
2020-02-11 22:48:49 +03:00
next_step();
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Loading model files" << slog::endl;
2020-02-11 22:48:49 +03:00
auto startTime = Time::now();
auto model = core.read_model(FLAGS_m);
auto duration_ms = get_duration_ms_till_now(startTime);
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Read model took " << double_to_string(duration_ms) << " ms" << slog::endl;
slog::info << "Original model I/O parameters:" << slog::endl;
printInputAndOutputsInfoShort(*model);
2020-02-11 22:48:49 +03:00
if (statistics)
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
statistics->add_parameters(StatisticsReport::Category::EXECUTION_RESULTS,
{StatisticsVariant("read model time (ms)", "read_model_time", duration_ms)});
2020-02-11 22:48:49 +03:00
const auto& inputInfo = std::const_pointer_cast<const ov::Model>(model)->inputs();
2020-02-11 22:48:49 +03:00
if (inputInfo.empty()) {
[BENCHMARK_APP] Introduce Numpy array loading for C++ benchmark app/Fix a bug that would cause Python Numpy array loading to fail (#14021) * [C++/BENCHMARK_APP] Introduce Numpy array loading for C++ benchmark app * [DOCS/BENCHMARK_APP] Update docs to reflect changes, update list of available extensions from OpenCV, align help messages * Update inputs_filling.cpp * Update tools/benchmark_tool/openvino/tools/benchmark/utils/inputs_filling.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update samples/cpp/benchmark_app/inputs_filling.cpp Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [C++/Python] Implement quality-of-life improvements from PR comments * [C++] Fix compilation errors, fix linter output * [C++/PYTHON] Apply requested changes * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update samples/cpp/benchmark_app/utils.cpp Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON] Separate loading of numpy arrays similar to images * [PYTHON] Remove unnecessary 'Prepare xxx file' print * Update README again because IF OPENCV.. dissapeared for some reason * Update second README with missing IF OPENCV.. * [C++] Remove unnecessary vector print function * [C++ Add Numpy processing function - TODO link it to the tensor filling * Reverse OneDnn plugin modification * [C++] Numpy array loading for C++ * [C++] Add (almost) all missing types of data * Reverse submodule modifications * [C++/PYTHON] Fix compilation errors, clean code * [C++] Modify supported extensions, add numpy checking to utils, add numpy to get_image_info method * Update samples/cpp/benchmark_app/inputs_filling.cpp Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [C++] Fix utils header file to reflect unordered set change * [PYTHON/C++] Fix compilation errors in C++ code, fix Python dynamic shapes numpy loading * [C++] Fix explicit instantiation of NumpyArray reader * [C++] Clang format, minor syntax fixes * [PYTHON/C++] Remove unnecessary data types, introduce a new approach to cast data of different types from format_rt_reader, remove uppercase types from Python precision parameters * [PYTHON] Update README to reflect new precision settings * [PYTHON] Fix README, fix clang format * [C++] Clean headers * [C++] Fix uninitialized variable error * [C++/PYTHON] Fixed choices in Python benchmark, fixed types in C++ benchmark * [C++] Fixed ov::float16conversion, fixed Python types map - removed redundancies * [C++] Add back boolean support * [C++] Fix compilation errors --------- Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2023-02-13 09:04:23 +01:00
throw std::logic_error("No inputs info is provided");
2020-02-11 22:48:49 +03:00
}
// ----------------- 5. Resizing network to match image sizes and given
// batch ----------------------------------
[CPU] OneDNN 2.6 migration (#11627) * Migrate on OneDNN 2.7 * [CPU] Enabled brconv implementation * Post ops optimizations * [CPU] Enabled I8 precision on activations for Convolution node * [CPU][WA] Disabled Deconvolution + post ops fusing optimization * Fixed FQ post op optimization * [CPU] Optimize post ops processing * [WA] Add node name if tensor names are empty * [WA] remove layout compatibility chheck that leads to the fase-positive exceptions * [CPU] Optimize processing for FQ + Sum + FQ post ops pattern * [CPU][WA] Enabled ReduceSum -> AvgPool transformation due to perf issues * fix compiler error * rebase onednn master * cherry pick from 2.7 to 2.6 * [WA] make cpu case to run completed * fix xmm zero check * reopen 'FuseDeconvolutionAndSimpleOperation' Transform to fix CPU 'ConvolutionBackpropDataLayerTest' fail issue * [WR] Removed failed the ReduceMean tests caused by 21f3555. * group deconv may crash on memory out of bound * [WA] Remove the moc fail case by #af4731a1 * testcase conv maxpool will check brgconv instead of jit * test subgraph added nhwc format check * fix gemm bf16 win crash * fix avx2 groupconv accuracy problem * [WA] remove invalid FQ tests * WR to disable the LPT multiplyToGroupConv test because the transformation was disabled in d5e16f * add gemm int8 binary postops to fix GroupConvolutionQDqTransformation fail * add gemm int8 binary postops to fix GroupConvolutionQDqTransformation fail * fix gemm bf16 fail * Fix ConcatConvSumInPlaceTest * Add cpuDebugFuncTests target * [WA] bf16 crash due to MemoryInput/Output * OVClassBasicTest case typo * testcase subgraph sets default ENFORCE_BF16 to NO * fix clang check * Fix primType check issue * Fix cpplint error * MemoryInput/Output support bf16; Enforce bf16 'NO' should enable snipptes * disable BF16 fusing fakequant testcase * testcase init support amx check * testcase for conv brgconv avx512/amx * testcase for conv brgconv avx512/amx * WR enforce reorder bug and add NSPC into deconv supported list. * Compiling issue fix. * [WA] skip fakequantize fusing in bf16 * mix legacy/new binary postops * make nightly case run. tested on amx/avx512/avx2. * [CPU] Add BF16 AMX test for Matmul * Add CPU dump check tool * Add verbose log * Generate exec graph in cpu dump check tool * fix binary prelu post Ops * fix cpplint * Update ONEDNN version to fix AVX2 bug. * cpu dump check supports compare dump files * Add a new CPU_DEBUG_CAPS: OV_CPU_SUMMARY_PERF * change VERBOSE_LOG to DEBUG_LOG * fix oneDNN register_jit_code log * fix cpplint * Add OV_CPU_DEBUG_LOG controls debug logs to show * Revert reorder WR. * Enhanced CPU debug logs and breakpoint support * Enhanced cpu_dump_check with --ports * Fix DEBUG_LOG compile issue * GroupDeconvolutionLayerCPUTest extend to add amx test cases * Add Node into DBUEG_LOG * cpu_dump_check: Dump results even no port is specified * FIx MergeTransposeAndReorder for blocked input * Fix cpu_dump_check result names * Enhance DEBUG_LOG on edges * Cpu dump check support shape mismatch * Fix bi-directionl inplace * Cpu dump check support inference_precion_hing f32. * fix windows dump fail. * fix depthwise nwc conv * add rtol arg * win debugbreak * fix pooling accuracy * GroupDeconvolutionLayerCPUTest remove invalid test param for nspc * recover ov onednn fork * revert af4731a1f1e085f959d2612b656b50f75c0fbc98 '[WA] remove layout compatibility chheck' * [WA] disable avx2 conv3d fusing case * [WA] disable avx2 conv3d fusing case * [WA] Disabled weights md transpose in FC to prevent perf degradations Co-authored-by: dmitrygo <dmitry.gorokhov@intel.com> Co-authored-by: Vladislav Golubev <vladislav.golubev@intel.com> Co-authored-by: Zhang Yi3 <yi3.zhang@intel.com> Co-authored-by: liubo-intel <bo4.liu@intel.com> Co-authored-by: Luwei Zhou <luwei.zhou@intel.com> Co-authored-by: Li, Tingqian <tingqian.li@intel.com> Co-authored-by: xuchen-intel <chen.xu@intel.com> Co-authored-by: ceciliapeng2011 <cecilia.peng@intel.com>
2022-06-06 18:30:32 +08:00
for (auto& item : model->inputs()) {
if (item.get_tensor().get_names().empty()) {
item.get_tensor_ptr()->set_names(
std::unordered_set<std::string>{item.get_node_shared_ptr()->get_name()});
}
}
2020-02-11 22:48:49 +03:00
next_step();
convert_io_names_in_map(inputFiles, std::const_pointer_cast<const ov::Model>(model)->inputs());
// Parse input shapes if specified
bool reshape = false;
app_inputs_info = get_inputs_info(FLAGS_shape,
FLAGS_layout,
FLAGS_b,
FLAGS_data_shape,
inputFiles,
FLAGS_scale_values,
FLAGS_mean_values,
inputInfo,
reshape);
if (reshape) {
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
benchmark_app::PartialShapes shapes = {};
for (auto& item : app_inputs_info[0])
shapes[item.first] = item.second.partialShape;
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Reshaping model: " << get_shapes_string(shapes) << slog::endl;
startTime = Time::now();
model->reshape(shapes);
duration_ms = get_duration_ms_till_now(startTime);
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Reshape model took " << double_to_string(duration_ms) << " ms" << slog::endl;
if (statistics)
statistics->add_parameters(
StatisticsReport::Category::EXECUTION_RESULTS,
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
{StatisticsVariant("reshape model time (ms)", "reshape_model_time", duration_ms)});
2020-02-11 22:48:49 +03:00
}
// ----------------- 6. Configuring inputs and outputs
// ----------------------------------------------------------------------
next_step();
auto preproc = ov::preprocess::PrePostProcessor(model);
std::map<std::string, std::string> user_precisions_map;
if (!FLAGS_iop.empty()) {
user_precisions_map = parseArgMap(FLAGS_iop);
convert_io_names_in_map(user_precisions_map,
std::const_pointer_cast<const ov::Model>(model)->inputs(),
std::const_pointer_cast<const ov::Model>(model)->outputs());
}
const auto input_precision = FLAGS_ip.empty() ? ov::element::undefined : getPrecision2(FLAGS_ip);
const auto output_precision = FLAGS_op.empty() ? ov::element::undefined : getPrecision2(FLAGS_op);
const auto& inputs = model->inputs();
for (size_t i = 0; i < inputs.size(); i++) {
const auto& item = inputs[i];
auto iop_precision = ov::element::undefined;
auto type_to_set = ov::element::undefined;
std::string name;
try {
// Some tensors might have no names, get_any_name will throw exception in that case.
// -iop option will not work for those tensors.
name = item.get_any_name();
iop_precision = getPrecision2(user_precisions_map.at(item.get_any_name()));
} catch (...) {
}
if (iop_precision != ov::element::undefined) {
type_to_set = iop_precision;
} else if (input_precision != ov::element::undefined) {
type_to_set = input_precision;
} else if (!name.empty() && app_inputs_info[0].at(name).is_image()) {
// image input, set U8
type_to_set = ov::element::u8;
}
auto& in = preproc.input(item.get_any_name());
if (type_to_set != ov::element::undefined) {
in.tensor().set_element_type(type_to_set);
if (!name.empty()) {
for (auto& info : app_inputs_info) {
info.at(name).type = type_to_set;
}
}
}
// Explicitly set inputs layout.
if (!name.empty() && !app_inputs_info[0].at(name).layout.empty()) {
in.model().set_layout(app_inputs_info[0].at(name).layout);
}
}
fuse_mean_scale(preproc, app_inputs_info.at(0));
const auto& outs = model->outputs();
for (size_t i = 0; i < outs.size(); i++) {
const auto& item = outs[i];
auto iop_precision = ov::element::undefined;
try {
// Some tensors might have no names, get_any_name will throw exception in that case.
// -iop option will not work for those tensors.
iop_precision = getPrecision2(user_precisions_map.at(item.get_any_name()));
} catch (...) {
}
if (iop_precision != ov::element::undefined) {
preproc.output(i).tensor().set_element_type(iop_precision);
} else if (output_precision != ov::element::undefined) {
preproc.output(i).tensor().set_element_type(output_precision);
}
}
model = preproc.build();
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
// Check if network has dynamic shapes
auto input_info = app_inputs_info[0];
isDynamicNetwork = std::any_of(input_info.begin(),
input_info.end(),
[](const std::pair<std::string, benchmark_app::InputInfo>& i) {
return i.second.partialShape.is_dynamic();
});
topology_name = model->get_friendly_name();
batchSize = get_batch_size(app_inputs_info.at(0));
warn_if_no_batch(app_inputs_info.at(0));
slog::info << "Model batch size: " << batchSize << slog::endl;
printInputAndOutputsInfoShort(*model);
// ----------------- 7. Loading the model to the device
// --------------------------------------------------------
2020-02-11 22:48:49 +03:00
next_step();
startTime = Time::now();
compiledModel = core.compile_model(model, device_name, device_config);
duration_ms = get_duration_ms_till_now(startTime);
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Compile model took " << double_to_string(duration_ms) << " ms" << slog::endl;
2020-02-11 22:48:49 +03:00
if (statistics)
statistics->add_parameters(
StatisticsReport::Category::EXECUTION_RESULTS,
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
{StatisticsVariant("compile model time (ms)", "load_model_time", duration_ms)});
2020-02-11 22:48:49 +03:00
} else {
if (!FLAGS_mean_values.empty() || !FLAGS_scale_values.empty()) {
throw std::runtime_error("--mean_values and --scale_values aren't supported for compiled model. "
"The values can be set via model_optimizer while generating xml");
}
2020-02-11 22:48:49 +03:00
next_step();
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Skipping the step for compiled model" << slog::endl;
2020-02-11 22:48:49 +03:00
next_step();
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Skipping the step for compiled model" << slog::endl;
2020-02-11 22:48:49 +03:00
next_step();
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Skipping the step for compiled model" << slog::endl;
// ----------------- 7. Loading the model to the device
// --------------------------------------------------------
2020-02-11 22:48:49 +03:00
next_step();
auto startTime = Time::now();
std::ifstream modelStream(FLAGS_m, std::ios_base::binary | std::ios_base::in);
if (!modelStream.is_open()) {
throw std::runtime_error("Cannot open model file " + FLAGS_m);
}
compiledModel = core.import_model(modelStream, device_name, device_config);
modelStream.close();
auto duration_ms = get_duration_ms_till_now(startTime);
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Import model took " << double_to_string(duration_ms) << " ms" << slog::endl;
slog::info << "Original model I/O paramteters:" << slog::endl;
printInputAndOutputsInfoShort(compiledModel);
2020-02-11 22:48:49 +03:00
if (statistics)
statistics->add_parameters(
StatisticsReport::Category::EXECUTION_RESULTS,
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
{StatisticsVariant("import model time (ms)", "import_model_time", duration_ms)});
convert_io_names_in_map(inputFiles, compiledModel.inputs());
app_inputs_info = get_inputs_info(FLAGS_shape,
FLAGS_layout,
FLAGS_b,
FLAGS_data_shape,
inputFiles,
FLAGS_scale_values,
FLAGS_mean_values,
compiledModel.inputs());
2020-02-11 22:48:49 +03:00
if (batchSize == 0) {
batchSize = 1;
}
}
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
bool allow_inference_only_or_sync = can_measure_as_static(app_inputs_info);
if (!allow_inference_only_or_sync && FLAGS_api == "sync") {
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
throw std::logic_error("Benchmarking of the model with dynamic shapes is available for async API only. "
"Please use -api async -hint latency -nireq 1 to emulate sync behavior");
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
// Defining of benchmark mode
// for static models inference only mode is used as default one
bool inferenceOnly = FLAGS_inference_only;
if (isDynamicNetwork) {
if (isFlagSetInCommandLine("inference_only") && inferenceOnly && !allow_inference_only_or_sync) {
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
throw std::logic_error(
"Dynamic models with different input data shapes must be benchmarked only in full mode.");
}
inferenceOnly = isFlagSetInCommandLine("inference_only") && inferenceOnly && app_inputs_info.size() == 1;
}
OV Performance Hints (CPU and GPU logic for selecting the actual configs), while AUTO/MULTI are passing them thru) (#6993) * rebasing the perf-modes-2021.3 to the 2021.4 Caveats: the (explicit) setting #streams is not disabled (as it was before for experiments with DLBenchmark), and the logic slighlty differ (streamsSet) (cherry picked from commit 1ae1edc0ed70fdea40f528fdaf8d00a9904d2a5c) * overriding streams (to force the TPUT mode to the DLBenchnark) (cherry picked from commit 7f506cda31abf35ac293d0dce32f602a0188c619) * disabling reducing #streams to fully mimic baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments) (cherry picked from commit 85073dd1dd2c7d43a89c37c8f646313f6ddfc650) * clang/identation (cherry picked from commit 050a4155a923cee294c8689d685b39247b7a172a) * splitting the Transformation to general and CPU specific. Now hopefully,this fully mimics the baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments), as the streams reduce num (as well as early exit on GRU/LSTM/TensorIterator) is deisabled (cherry picked from commit e98b2c1a67f2542a686543594b75b575ef515196) * disabling GRU/LSTM/TI + reducing of streams + 5D considered compute-limited only for int8 (cherry picked from commit 32b8d80dee18685ebf3d069bb4cd2172af7363b7) * refactored to avoid compute_limited_ratio, reverted the reducing #streams, removed LSTM from limitations (cherry picked from commit f2b972171b29cf599aae2407ceec2e6adb67e4e9) * isa-based threshold logic (cherry picked from commit b218457e1a93fcb3374eb9da948fdad2175ec33a) * mode->hint (cherry picked from commit ec20aa8ecaf3222f2a6fdfe9153cf6c9dfdd6a54) * optional PERFORMANCE_HINT_NUM_REQUESTS (cherry picked from commit 5a3883e3f36e7928c6391094ae10711c8e4c3b5c) * moving the perfHints to the common OV config class + initial tests (CPU only, as the actual AUTO/MULTI should be accommodated on the master) (cherry picked from commit (then fixed)45bafe7d527f466507dea0693aeed51be4ebf776) * AUTO support for PerfHints * MULTI support for PerfHints * Enabling Perf hints for the GPU plugin * brushing settings output a bit * disabling "throughput" perf hint being default (until OV 2.0) * uncommenting the logic which was disabled to force the DLBenchmark to use the throughput mode by default * removing dead and experimental code, and debug printfs * clang/code-style * code-review remarks * Moved the output of the actual params that the hint produced to the right place * aligning MULTI's GetConfig beh to HETERO's as captured in the preso (CVS-59960) ratified with the ArchForum * clang * benchmark_app brushing * Update inference-engine/samples/benchmark_app/README.md * propagating the perf hints thru one more scenario in the merged AUTO-MULTI * fixed mispint * Python benchmark_app update for perf hints * addresssing reviewers comments on the python benchmark_app * simplifying/brushing logic a bit * refactor the heuristic to the separate file (to be shared with iGPU soon) * refactor conversion of modes to the specific GPU config per feedback from Vladimir
2021-09-13 15:40:36 +03:00
// ----------------- 8. Querying optimal runtime parameters
// -----------------------------------------------------
2019-08-09 19:02:42 +03:00
next_step();
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
// output of the actual settings that the device selected
auto supported_properties = compiledModel.get_property(ov::supported_properties);
slog::info << "Model:" << slog::endl;
for (const auto& cfg : supported_properties) {
if (cfg == ov::supported_properties)
continue;
auto prop = compiledModel.get_property(cfg);
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
if (cfg == ov::device::properties) {
auto devices_properties = prop.as<ov::AnyMap>();
for (auto& item : devices_properties) {
slog::info << " " << item.first << ": " << slog::endl;
for (auto& item2 : item.second.as<ov::AnyMap>()) {
OPENVINO_SUPPRESS_DEPRECATED_START
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
if (item2.first == ov::supported_properties ||
item2.first == METRIC_KEY(SUPPORTED_CONFIG_KEYS) ||
item2.first == METRIC_KEY(SUPPORTED_METRICS))
continue;
OPENVINO_SUPPRESS_DEPRECATED_END
Improved properties handling between Core and plugins (#16296) * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Multiple improvements * [HETERO]: adopt setting device properties in benchmark_app/speech_sample for HETERO Fix IEClassHeteroExecutableNetworkGetMetricTest_SUPPORTED_METRICS test Fix NumStreamsAndDefaultPerfHintToHWTest/PerHintAndDefaultPerfHintToHWTest tests [HETERO][MULTI][AUTO] Make ov::device::properties regular property [PYTHON] Update python BA with device properties Update after rebase Update src/plugins/auto/auto_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Update src/plugins/auto/multi_executable_network.cpp Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com> Fix merge conflicts, apply some review comments * Code style, bugfix after merging improvement * More improvements * Even more improvements * Commit changes in core_impl.cpp * Added parsing of any maps * Fixed code-style * Fixed AB mock tests build * Fixed comparison * Added new AB config key * Improvements and fixes (#147) * Fix BA, fix GetSupportedConfig call for virtual plugins (#148) * Fix GPU tests (#149) * Fix BA, fix GetSupportedConfig call for virtual plugins * Fix GPU tests * Code style * Improvements 10 * Fixed incorrect tests * Revert removal cache_dir * Revert removal cache_dir * Fixed clean * Supported device ID in CPU * More fixed tests * clang-format * Fix legacy GPU tests (#150) * Removed clone_map * clang-format * Added clone_map back --------- Co-authored-by: Nadezhda Ageeva <nadezhda.ageeva@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2023-03-20 16:42:40 +04:00
slog::info << " " << item2.first << ": " << item2.second.as<std::string>() << slog::endl;
}
}
} else {
slog::info << " " << cfg << ": " << prop.as<std::string>() << slog::endl;
}
OV Performance Hints (CPU and GPU logic for selecting the actual configs), while AUTO/MULTI are passing them thru) (#6993) * rebasing the perf-modes-2021.3 to the 2021.4 Caveats: the (explicit) setting #streams is not disabled (as it was before for experiments with DLBenchmark), and the logic slighlty differ (streamsSet) (cherry picked from commit 1ae1edc0ed70fdea40f528fdaf8d00a9904d2a5c) * overriding streams (to force the TPUT mode to the DLBenchnark) (cherry picked from commit 7f506cda31abf35ac293d0dce32f602a0188c619) * disabling reducing #streams to fully mimic baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments) (cherry picked from commit 85073dd1dd2c7d43a89c37c8f646313f6ddfc650) * clang/identation (cherry picked from commit 050a4155a923cee294c8689d685b39247b7a172a) * splitting the Transformation to general and CPU specific. Now hopefully,this fully mimics the baseline c4df94d42d90a2bc3cd91d3d6844ba42f29bca7f of the 2021.3 (before experiments), as the streams reduce num (as well as early exit on GRU/LSTM/TensorIterator) is deisabled (cherry picked from commit e98b2c1a67f2542a686543594b75b575ef515196) * disabling GRU/LSTM/TI + reducing of streams + 5D considered compute-limited only for int8 (cherry picked from commit 32b8d80dee18685ebf3d069bb4cd2172af7363b7) * refactored to avoid compute_limited_ratio, reverted the reducing #streams, removed LSTM from limitations (cherry picked from commit f2b972171b29cf599aae2407ceec2e6adb67e4e9) * isa-based threshold logic (cherry picked from commit b218457e1a93fcb3374eb9da948fdad2175ec33a) * mode->hint (cherry picked from commit ec20aa8ecaf3222f2a6fdfe9153cf6c9dfdd6a54) * optional PERFORMANCE_HINT_NUM_REQUESTS (cherry picked from commit 5a3883e3f36e7928c6391094ae10711c8e4c3b5c) * moving the perfHints to the common OV config class + initial tests (CPU only, as the actual AUTO/MULTI should be accommodated on the master) (cherry picked from commit (then fixed)45bafe7d527f466507dea0693aeed51be4ebf776) * AUTO support for PerfHints * MULTI support for PerfHints * Enabling Perf hints for the GPU plugin * brushing settings output a bit * disabling "throughput" perf hint being default (until OV 2.0) * uncommenting the logic which was disabled to force the DLBenchmark to use the throughput mode by default * removing dead and experimental code, and debug printfs * clang/code-style * code-review remarks * Moved the output of the actual params that the hint produced to the right place * aligning MULTI's GetConfig beh to HETERO's as captured in the preso (CVS-59960) ratified with the ArchForum * clang * benchmark_app brushing * Update inference-engine/samples/benchmark_app/README.md * propagating the perf hints thru one more scenario in the merged AUTO-MULTI * fixed mispint * Python benchmark_app update for perf hints * addresssing reviewers comments on the python benchmark_app * simplifying/brushing logic a bit * refactor the heuristic to the separate file (to be shared with iGPU soon) * refactor conversion of modes to the specific GPU config per feedback from Vladimir
2021-09-13 15:40:36 +03:00
}
2019-08-09 19:02:42 +03:00
// Update number of streams
for (auto&& ds : device_nstreams) {
try {
const std::string key = getDeviceTypeFromName(ds.first) + "_THROUGHPUT_STREAMS";
device_nstreams[ds.first] = compiledModel.get_property(key).as<std::string>();
} catch (const ov::Exception&) {
device_nstreams[ds.first] = compiledModel.get_property(ov::num_streams.name()).as<std::string>();
}
}
2019-08-09 19:02:42 +03:00
// Number of requests
uint64_t nireq = FLAGS_nireq;
2019-08-09 19:02:42 +03:00
if (nireq == 0) {
2020-04-13 21:17:23 +03:00
if (FLAGS_api == "sync") {
nireq = 1;
} else {
try {
nireq = compiledModel.get_property(ov::optimal_number_of_infer_requests);
} catch (const std::exception& ex) {
OPENVINO_THROW("Every device used with the benchmark_app should support " +
std::string(ov::optimal_number_of_infer_requests.name()) +
" Failed to query the metric for the " + device_name + " with error: " + ex.what());
2020-04-13 21:17:23 +03:00
}
2018-11-23 16:19:43 +03:00
}
}
2019-08-09 19:02:42 +03:00
// Iteration limit
uint64_t niter = FLAGS_niter;
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
size_t shape_groups_num = app_inputs_info.size();
2019-08-09 19:02:42 +03:00
if ((niter > 0) && (FLAGS_api == "async")) {
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (shape_groups_num > nireq) {
niter = ((niter + shape_groups_num - 1) / shape_groups_num) * shape_groups_num;
if (FLAGS_niter != niter) {
slog::warn << "Number of iterations was aligned by data shape groups number from " << FLAGS_niter
<< " to " << niter << " using number of possible input shapes " << shape_groups_num
<< slog::endl;
}
} else {
niter = ((niter + nireq - 1) / nireq) * nireq;
if (FLAGS_niter != niter) {
slog::warn << "Number of iterations was aligned by request number from " << FLAGS_niter << " to "
<< niter << " using number of requests " << nireq << slog::endl;
}
2019-08-09 19:02:42 +03:00
}
}
2019-04-12 18:25:53 +03:00
2019-08-09 19:02:42 +03:00
// Time limit
uint64_t duration_seconds = 0;
2019-08-09 19:02:42 +03:00
if (FLAGS_t != 0) {
// time limit
duration_seconds = FLAGS_t;
} else if (FLAGS_niter == 0) {
// default time limit
duration_seconds = device_default_device_duration_in_seconds(device_name);
2019-04-12 18:25:53 +03:00
}
uint64_t duration_nanoseconds = get_duration_in_nanoseconds(duration_seconds);
2019-04-12 18:25:53 +03:00
2019-10-04 19:26:43 +03:00
if (statistics) {
statistics->add_parameters(
StatisticsReport::Category::RUNTIME_CONFIG,
StatisticsReport::Parameters(
{StatisticsVariant("benchmark mode", "benchmark_mode", inferenceOnly ? "inference only" : "full"),
StatisticsVariant("topology", "topology", topology_name),
StatisticsVariant("target device", "target_device", device_name),
StatisticsVariant("API", "api", FLAGS_api),
StatisticsVariant("precision", "precision", type.get_type_name()),
StatisticsVariant("batch size", "batch_size", batchSize),
StatisticsVariant("number of iterations", "iterations_num", niter),
StatisticsVariant("number of parallel infer requests", "nireq", nireq),
StatisticsVariant("duration (ms)", "duration", get_duration_in_milliseconds(duration_seconds))}));
2019-10-04 19:26:43 +03:00
for (auto& nstreams : device_nstreams) {
std::stringstream ss;
ss << "number of " << nstreams.first << " streams";
std::string dev_name = nstreams.first;
std::transform(dev_name.begin(), dev_name.end(), dev_name.begin(), [](unsigned char c) {
return c == ' ' ? '_' : std::tolower(c);
});
statistics->add_parameters(StatisticsReport::Category::RUNTIME_CONFIG,
{StatisticsVariant(ss.str(), dev_name + "_streams_num", nstreams.second)});
2019-10-04 19:26:43 +03:00
}
}
// ----------------- 9. Creating infer requests and filling input blobs
// ----------------------------------------
2019-08-09 19:02:42 +03:00
next_step();
2018-11-23 16:19:43 +03:00
InferRequestsQueue inferRequestsQueue(compiledModel, nireq, app_inputs_info.size(), FLAGS_pcseq);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
bool inputHasName = false;
if (inputFiles.size() > 0) {
inputHasName = inputFiles.begin()->first != "";
}
bool newInputType = isDynamicNetwork || inputHasName;
// create vector to store remote input blobs buffer
std::vector<::gpu::BufferType> clInputsBuffer;
bool useGpuMem = false;
std::map<std::string, ov::TensorVector> inputsData;
if (isFlagSetInCommandLine("use_device_mem")) {
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (device_name.find("GPU") == 0) {
inputsData = ::gpu::get_remote_input_tensors(inputFiles,
app_inputs_info,
compiledModel,
clInputsBuffer,
inferRequestsQueue.requests.size());
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
useGpuMem = true;
} else if (device_name.find("CPU") == 0) {
if (newInputType) {
inputsData = get_tensors(inputFiles, app_inputs_info);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
} else {
inputsData = get_tensors_static_case(
inputFiles.empty() ? std::vector<std::string>{} : inputFiles.begin()->second,
batchSize,
app_inputs_info[0],
nireq);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
} else {
OPENVINO_THROW("Requested device doesn't support `use_device_mem` option.");
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
} else {
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (newInputType) {
inputsData = get_tensors(inputFiles, app_inputs_info);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
} else {
inputsData = get_tensors_static_case(
inputFiles.empty() ? std::vector<std::string>{} : inputFiles.begin()->second,
batchSize,
app_inputs_info[0],
nireq);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
}
// ----------------- 10. Measuring performance
// ------------------------------------------------------------------
2019-08-09 19:02:42 +03:00
size_t iteration = 0;
2019-04-12 18:25:53 +03:00
2019-08-09 19:02:42 +03:00
std::stringstream ss;
ss << "Start inference " << FLAGS_api << "hronously";
2019-08-09 19:02:42 +03:00
if (FLAGS_api == "async") {
if (!ss.str().empty()) {
ss << ", ";
}
ss << nireq << " inference requests";
std::stringstream device_ss;
for (auto& nstreams : device_nstreams) {
if (!device_ss.str().empty()) {
device_ss << ", ";
}
device_ss << nstreams.second << " streams for " << nstreams.first;
}
if (!device_ss.str().empty()) {
ss << " using " << device_ss.str();
2019-04-12 18:25:53 +03:00
}
}
2019-08-09 19:02:42 +03:00
ss << ", limits: ";
if (duration_seconds > 0) {
ss << get_duration_in_milliseconds(duration_seconds) << " ms duration";
2018-11-23 16:19:43 +03:00
}
2019-08-09 19:02:42 +03:00
if (niter != 0) {
if (duration_seconds > 0) {
ss << ", ";
}
ss << niter << " iterations";
}
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
2019-08-09 19:02:42 +03:00
next_step(ss.str());
2018-11-23 16:19:43 +03:00
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (inferenceOnly) {
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Benchmarking in inference only mode (inputs filling are not included in measurement loop)."
<< slog::endl;
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
} else {
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
slog::info << "Benchmarking in full mode (inputs filling are included in measurement loop)." << slog::endl;
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
// copy prepared data straight into inferRequest->getTensor()
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
// for inference only mode
if (inferenceOnly) {
if (nireq < inputsData.begin()->second.size())
slog::warn << "Only " << nireq << " test configs will be used." << slog::endl;
size_t i = 0;
for (auto& inferRequest : inferRequestsQueue.requests) {
auto inputs = app_inputs_info[i % app_inputs_info.size()];
for (auto& item : inputs) {
auto inputName = item.first;
const auto& inputTensor = inputsData.at(inputName)[i % inputsData.at(inputName).size()];
// for remote blobs setTensor is used, they are already allocated on the device
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (useGpuMem) {
inferRequest->set_tensor(inputName, inputTensor);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
} else {
auto requestTensor = inferRequest->get_tensor(inputName);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (isDynamicNetwork) {
requestTensor.set_shape(inputTensor.get_shape());
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
copy_tensor_data(requestTensor, inputTensor);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
}
if (useGpuMem) {
auto outputTensors =
::gpu::get_remote_output_tensors(compiledModel, inferRequest->get_output_cl_buffer());
for (auto& output : compiledModel.outputs()) {
inferRequest->set_tensor(output.get_any_name(), outputTensors[output.get_any_name()]);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
}
++i;
}
}
2019-08-09 19:02:42 +03:00
// warming up - out of scope
auto inferRequest = inferRequestsQueue.get_idle_request();
2019-08-09 19:02:42 +03:00
if (!inferRequest) {
OPENVINO_THROW("No idle Infer Requests!");
2019-08-09 19:02:42 +03:00
}
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (!inferenceOnly) {
auto inputs = app_inputs_info[0];
for (auto& item : inputs) {
auto inputName = item.first;
const auto& data = inputsData.at(inputName)[0];
inferRequest->set_tensor(inputName, data);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
if (useGpuMem) {
auto outputTensors =
::gpu::get_remote_output_tensors(compiledModel, inferRequest->get_output_cl_buffer());
for (auto& output : compiledModel.outputs()) {
inferRequest->set_tensor(output.get_any_name(), outputTensors[output.get_any_name()]);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
}
}
2019-04-12 18:25:53 +03:00
if (FLAGS_api == "sync") {
inferRequest->infer();
2019-08-09 19:02:42 +03:00
} else {
inferRequest->start_async();
2019-08-09 19:02:42 +03:00
}
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
inferRequestsQueue.wait_all();
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
auto duration_ms = inferRequestsQueue.get_latencies()[0];
slog::info << "First inference took " << double_to_string(duration_ms) << " ms" << slog::endl;
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (statistics) {
statistics->add_parameters(
StatisticsReport::Category::EXECUTION_RESULTS,
{StatisticsVariant("first inference time (ms)", "first_inference_time", duration_ms)});
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
inferRequestsQueue.reset_times();
2019-08-09 19:02:42 +03:00
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
size_t processedFramesN = 0;
2020-02-11 22:48:49 +03:00
auto startTime = Time::now();
2019-08-09 19:02:42 +03:00
auto execTime = std::chrono::duration_cast<ns>(Time::now() - startTime).count();
/** Start inference & calculate performance **/
/** to align number if iterations to guarantee that last infer requests are
* executed in the same conditions **/
while ((niter != 0LL && iteration < niter) ||
(duration_nanoseconds != 0LL && (uint64_t)execTime < duration_nanoseconds) ||
2019-08-09 19:02:42 +03:00
(FLAGS_api == "async" && iteration % nireq != 0)) {
inferRequest = inferRequestsQueue.get_idle_request();
2019-08-09 19:02:42 +03:00
if (!inferRequest) {
OPENVINO_THROW("No idle Infer Requests!");
2019-08-09 19:02:42 +03:00
}
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (!inferenceOnly) {
auto inputs = app_inputs_info[iteration % app_inputs_info.size()];
if (FLAGS_pcseq) {
inferRequest->set_latency_group_id(iteration % app_inputs_info.size());
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
if (isDynamicNetwork) {
batchSize = get_batch_size(inputs);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
for (auto& item : inputs) {
auto inputName = item.first;
const auto& data = inputsData.at(inputName)[iteration % inputsData.at(inputName).size()];
inferRequest->set_tensor(inputName, data);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
if (useGpuMem) {
auto outputTensors =
::gpu::get_remote_output_tensors(compiledModel, inferRequest->get_output_cl_buffer());
for (auto& output : compiledModel.outputs()) {
inferRequest->set_tensor(output.get_any_name(), outputTensors[output.get_any_name()]);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
}
}
2019-08-09 19:02:42 +03:00
if (FLAGS_api == "sync") {
2019-04-12 18:25:53 +03:00
inferRequest->infer();
2018-11-23 16:19:43 +03:00
} else {
inferRequest->start_async();
2018-11-23 16:19:43 +03:00
}
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
++iteration;
2018-11-23 16:19:43 +03:00
2019-08-09 19:02:42 +03:00
execTime = std::chrono::duration_cast<ns>(Time::now() - startTime).count();
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
processedFramesN += batchSize;
2019-08-09 19:02:42 +03:00
}
2018-11-23 16:19:43 +03:00
2019-08-09 19:02:42 +03:00
// wait the latest inference executions
inferRequestsQueue.wait_all();
2019-08-09 19:02:42 +03:00
LatencyMetrics generalLatency(inferRequestsQueue.get_latencies(), "", FLAGS_latency_percentile);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
std::vector<LatencyMetrics> groupLatencies = {};
if (FLAGS_pcseq && app_inputs_info.size() > 1) {
const auto& lat_groups = inferRequestsQueue.get_latency_groups();
for (size_t i = 0; i < lat_groups.size(); i++) {
const auto& lats = lat_groups[i];
std::string data_shapes_string = "";
for (auto& item : app_inputs_info[i]) {
data_shapes_string += item.first + item.second.dataShape.to_string() + ",";
}
data_shapes_string =
data_shapes_string == "" ? "" : data_shapes_string.substr(0, data_shapes_string.size() - 1);
groupLatencies.emplace_back(lats, data_shapes_string, FLAGS_latency_percentile);
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
}
double totalDuration = inferRequestsQueue.get_duration_in_milliseconds();
double fps = 1000.0 * processedFramesN / totalDuration;
2019-10-04 19:26:43 +03:00
if (statistics) {
statistics->add_parameters(StatisticsReport::Category::EXECUTION_RESULTS,
{StatisticsVariant("total execution time (ms)", "execution_time", totalDuration),
StatisticsVariant("total number of iterations", "iterations_num", iteration)});
2019-10-04 19:26:43 +03:00
if (device_name.find("MULTI") == std::string::npos) {
std::string latency_label;
if (FLAGS_latency_percentile == 50) {
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
latency_label = "Median latency (ms)";
} else {
latency_label = "latency (" + std::to_string(FLAGS_latency_percentile) + " percentile) (ms)";
}
statistics->add_parameters(
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
StatisticsReport::Category::EXECUTION_RESULTS,
{StatisticsVariant(latency_label, "latency_median", generalLatency.median_or_percentile),
StatisticsVariant("Percentile boundary", "percentile_boundary", FLAGS_latency_percentile),
StatisticsVariant("Average latency (ms)", "latency_avg", generalLatency.avg),
StatisticsVariant("Min latency (ms)", "latency_min", generalLatency.min),
StatisticsVariant("Max latency (ms)", "latency_max", generalLatency.max)});
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (FLAGS_pcseq && app_inputs_info.size() > 1) {
for (size_t i = 0; i < groupLatencies.size(); ++i) {
statistics->add_parameters(
StatisticsReport::Category::EXECUTION_RESULTS_GROUPPED,
{StatisticsVariant("Group Latencies", "group_latencies", groupLatencies[i])});
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
}
2018-11-23 16:19:43 +03:00
}
statistics->add_parameters(StatisticsReport::Category::EXECUTION_RESULTS,
{StatisticsVariant("throughput", "throughput", fps)});
2019-04-12 18:25:53 +03:00
}
// ----------------- 11. Dumping statistics report
// -------------------------------------------------------------
2019-08-09 19:02:42 +03:00
next_step();
2018-11-23 16:19:43 +03:00
if (!FLAGS_dump_config.empty()) {
dump_config(FLAGS_dump_config, config);
DOCS: ported changes from 2022.1 release branch (#11206) * Extensibility guide with FE extensions and remove OV_FRAMEWORK_MAP from docs * Rework of Extensibility Intro, adopted examples to missing OPENVINO_FRAMEWORK_MAP * Removed OPENVINO_FRAMEWORK_MAP reference * Frontend extension detailed documentation * Fixed distributed snippets * Fixed snippet inclusion in FE extension document and chapter headers * Fixed wrong name in a snippet reference * Fixed test for template extension due to changed number of loaded extensions * Update docs/Extensibility_UG/frontend_extensions.md Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com> * Minor fixes in extension snippets * Small grammar fix Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com> Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com> * DOCS: transition banner (#10973) * transition banner * minor fix * update transition banner * updates * update custom.js * updates * updates * Documentation fixes (#11044) * Benchmark app usage * Fixed link to the devices * More fixes * Update docs/OV_Runtime_UG/multi_device.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Removed several hardcoded links Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Updated documentation for compile_tool (#11049) * Added deployment guide (#11060) * Added deployment guide * Added local distribution * Updates * Fixed more indentations * Removed obsolete code snippets (#11061) * Removed obsolete code snippets * NCC style * Fixed NCC for BA * Add a troubleshooting issue for PRC installation (#11074) * updates * adding gna to linux * add missing reference * update * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * Update docs/install_guides/installing-model-dev-tools.md Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * update * minor updates * add gna item to yum and apt * add gna to get started page * update reference formatting * merge commit * add a troubleshooting issue * update * update * fix CVS-71846 Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> * DOCS: fixed hardcoded links (#11100) * Fixes * Use links * applying reviewers comments to the Opt Guide (#11093) * applying reviewrs comments * fixed refs, more structuring (bold, bullets, etc) * refactoring tput/latency sections * next iteration (mostly latency), also brushed the auto-batching and other sections * updates sync/async images * common opts brushed * WIP tput redesigned * minor brushing of common and auto-batching * Tput fully refactored * fixed doc name in the link * moved int8 perf counters to the right section * fixed links * fixed broken quotes * fixed more links * add ref to the internals to the TOC * Added a note on the batch size Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com> * [80085] New images for docs (#11114) * change doc structure * fix manager tools * fix manager tools 3 step * fix manager tools 3 step * new img * new img for OV Runtime * fix steps * steps * fix intendents * change list * fix space * fix space * code snippets fix * change display * Benchmarks 2022 1 (#11130) * Minor fixes * Updates for 2022.1 * Edits according to the review * Edits according to review comments * Edits according to review comments * Edits according to review comments * Fixed table * Edits according to review comments * Removed config for Intel® Core™ i7-11850HE * Removed forward-tacotron-duration-prediction-241 graph * Added resnet-18-pytorch * Add info about Docker images in Deployment guide (#11136) * Renamed user guides (#11137) * fix screenshot (#11140) * More conservative recommendations on dynamic shapes usage in docs (#11161) * More conservative recommendations about using dynamic shapes * Duplicated statement from C++ part to Python part of reshape doc (no semantical changes) * Update ShapeInference.md (#11168) * Benchmarks 2022 1 updates (#11180) * Updated graphs * Quick fix for TODO in Dynamic Shapes article * Anchor link fixes * Fixed DM config (#11199) * DOCS: doxy sphinxtabs (#11027) * initial implementation of doxy sphinxtabs * fixes * fixes * fixes * fixes * fixes * WA for ignored visibility attribute * Fixes Co-authored-by: Sergey Lyalin <sergey.lyalin@intel.com> Co-authored-by: Ivan Tikhonov <ivan.tikhonov@intel.com> Co-authored-by: Nikolay Tyukaev <nikolay.tyukaev@intel.com> Co-authored-by: Sergey Lyubimtsev <sergey.lyubimtsev@intel.com> Co-authored-by: Yuan Xu <yuan1.xu@intel.com> Co-authored-by: Maxim Shevtsov <maxim.y.shevtsov@intel.com> Co-authored-by: Andrey Zaytsev <andrey.zaytsev@intel.com> Co-authored-by: Tatiana Savina <tatiana.savina@intel.com> Co-authored-by: Ilya Naumov <ilya.naumov@intel.com> Co-authored-by: Evgenya Stepyreva <evgenya.stepyreva@intel.com>
2022-03-24 22:27:29 +03:00
slog::info << "OpenVINO Runtime configuration settings were dumped to " << FLAGS_dump_config << slog::endl;
}
2019-04-12 18:25:53 +03:00
if (!FLAGS_exec_graph_path.empty()) {
2019-08-09 19:02:42 +03:00
try {
ov::serialize(compiledModel.get_runtime_model(), FLAGS_exec_graph_path);
slog::info << "Executable graph is stored to " << FLAGS_exec_graph_path << slog::endl;
} catch (const std::exception& ex) {
2019-08-09 19:02:42 +03:00
slog::err << "Can't get executable graph: " << ex.what() << slog::endl;
}
}
2019-10-04 19:26:43 +03:00
if (perf_counts) {
std::vector<std::vector<ov::ProfilingInfo>> perfCounts;
2019-08-09 19:02:42 +03:00
for (size_t ireq = 0; ireq < nireq; ireq++) {
auto reqPerfCounts = inferRequestsQueue.requests[ireq]->get_performance_counts();
if (!FLAGS_pcsort.empty()) {
slog::info << "Sort performance counts for " << ireq << "-th infer request:" << slog::endl;
printPerformanceCountsSort(reqPerfCounts,
std::cout,
getFullDeviceName(core, FLAGS_d),
FLAGS_pcsort,
false);
} else if (FLAGS_pc) {
2021-02-16 13:08:54 +09:00
slog::info << "Performance counts for " << ireq << "-th infer request:" << slog::endl;
printPerformanceCounts(reqPerfCounts, std::cout, getFullDeviceName(core, FLAGS_d), false);
2019-10-04 19:26:43 +03:00
}
perfCounts.push_back(reqPerfCounts);
}
if (statistics) {
statistics->dump_performance_counters(perfCounts);
2019-08-09 19:02:42 +03:00
}
2018-11-23 16:19:43 +03:00
}
2019-04-12 18:25:53 +03:00
2019-10-04 19:26:43 +03:00
if (statistics)
statistics->dump();
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
// Performance metrics report
try {
auto exeDevice = compiledModel.get_property(ov::execution_devices);
slog::info << "Execution Devices: " << exeDevice << slog::endl;
} catch (const ov::Exception&) {
}
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
[AUTO] Enable Benchmark APP to parse the ov::device::properties through dump_config()/load_config() (#14057) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. * 1. Fix the issue that the dumped configuration file retrieves empty config list when using OpenCV to dump configuration. 2. Enable load_config() to load secondary property. 3. ov:device:properties from command line will replace the ov::device::properties loaded from configuration file. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update the performance statistics showing format. * Update format. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update README to add some simple configuration files loaded into benchmark app. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. Enable dump/load function for AUTO to support hw device property setting thorugh configuration JSON. 2. Update README.md to example a simple JSON file containing the hw device properties setting for AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. * Update. * Update. * Drop the changes within dump/load of OpenCV config parsing. * Update. * Correct property name. Update ov::num_stream to ov::inference_precision. Signed-off-by: Wang, Yang <yang4.wang@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2022-11-28 21:09:51 +08:00
slog::info << "Count: " << iteration << " iterations" << slog::endl;
slog::info << "Duration: " << double_to_string(totalDuration) << " ms" << slog::endl;
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
if (device_name.find("MULTI") == std::string::npos) {
slog::info << "Latency:" << slog::endl;
generalLatency.write_to_slog();
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
if (FLAGS_pcseq && app_inputs_info.size() > 1) {
slog::info << "Latency for each data shape group:" << slog::endl;
for (size_t i = 0; i < app_inputs_info.size(); ++i) {
slog::info << (i + 1) << ".";
for (auto& item : app_inputs_info[i]) {
std::stringstream input_shape;
auto shape = item.second.dataShape;
std::copy(shape.begin(), shape.end() - 1, std::ostream_iterator<size_t>(input_shape, ","));
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
input_shape << shape.back();
slog::info << " " << item.first << " : " << item.second.dataShape;
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
slog::info << slog::endl;
groupLatencies[i].write_to_slog();
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
}
}
}
[BENCHMARK_APP/PYTHON/CPP] Align benchmark_app output across languages (#12814) * [PYTHON] Pipeline transfer * [PYTHON] Align python benchmark * [PYTHON] Align last step * [PYTHON] Fix innacuracies of the last step - median * [PYTHON/CPP] Add Core::get_version method to python API, refactor Ben benchmark to print version with this func * [PYTHON] Remove get_version_string from API * [PYTHON/CPP] Align output for model input/output info * [PYTHON/CPP] Step 4,6 alignment of outputs, step 8 dumps all info stored in config parameters * [CPP] Fix a bug causing nstreams parameter to never be set to AUTO in CPP benchmark_app * [CPP] Fix clang format errors * [CPP] Modify print order and data output for 8th step * [PYTHON] Add verification checks from C++, modify set_thoughtput_streams to match documentation * [CPP] Revert changes to C++ benchmark_app * [CPP] Remove additional spacebar * Update submodules versions on remote * Update module from master branch * Redownload submodules from master and override changes from commit * [PYTHON] Remove unneccesary parse_status from validation function * [PYTHON] Check for HINT in map, fix circular import * [PYTHON] Remove artifacts from commit, fix args.perf_hint set to '' instead to 'none' * [PYTHON] Reverse changes to perf hint, add key in map check, fix validation function throwing error on set hint * [PYTHON] Fix linter * [PYTHON] Remove linter spacebar * [CPP] Fix wait_all exception throw * [CPP/PYTHON] Clean artifacts and unwanted changes from work process * [PYTHON] Fix artifacts from merge, clean submodule update * [C++ CPU] Fix device name string by removing padding NULL characters from the back * [CPP] Fix ba infer_request_wrap in other throw-catch clauses * [PYTHON/CPP] Fix missing latencies in final step for shape group, fix minor misaligned messages, add missing report parameter create infer requests time * [CPP] Clang fix formatting * [CPP] Reverse clang fix format on plugin.cpp * [PYTHON/CPP] Fix C++ progressbar printing endl when disabled, fix rounding in python creating infer request message * [CPP] Fix foramtiing error * [PYTHON/C++] Refactor network to model based on naming conventions, provide fresh README output example * [PYTHON/C++] Add example output to C++ README, remove unnecessary device loop * [BENCHMARK_APP/C++] Fix artifact from refactoring, remove try-catch clause * Update samples/cpp/benchmark_app/benchmark_app.hpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * [CPP] Fix clang errors * [CPP/PLUGIN Reverse modification to extract to separate task * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update tools/benchmark_tool/openvino/tools/benchmark/parameters.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/utils/utils.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * Update tools/benchmark_tool/openvino/tools/benchmark/main.py Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com> * [PYTHON/C++/BENCHMARK_APP] Fix language inconsistencies, remove unnecessary checks * Update pyopenvino.cpp * [CPP/BENCHMARK_APP] Remove unnecessary try-catch, fix linter errors * [PYTHON/CPP/BENCHMARK_APP] Revert changes to Core, align version prints usin only provided methods * [DOCS/BENCHMARK_APP] Update README with proper model examples * Update README.md Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> Co-authored-by: Michal Lukaszewski <michal.lukaszewski@intel.com> Co-authored-by: Zlobin Vladimir <vladimir.zlobin@intel.com>
2022-11-14 14:10:36 +01:00
[AUTO] Enable Benchmark APP to parse the ov::device::properties through dump_config()/load_config() (#14057) * [AUTO] update property setting logic. * Update core::set_property() logic to only support primary property for AUTO and MULTI. * Separate AUTO and MULTI supported properties. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test case. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. revert the changes for ie core. 2. Enable AUTO/MULTI only accepting its own properties. 3. Enable AUTO/MULTI accepting device properties passed from loadnetwork(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "[AUTO]Update the incorrect config test for Myriad (#13271)" This reverts commit 0552d9880270ea95bb1b457de8daeed12bbaffab. * MULTI only accepts its own properties that is same as AUTO currently. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Add test cases for AUTO/MULTI property test. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update to enable MULTI supporting hw primary property setting throw the compile_model(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Remove the added test case for setting secondary property through set_property(). Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. For AUTO/MULTI, property setting will be passed via core::compile_model() instead of core::set_property(). 2. update the logic to infer precision setting that will transform into secondary property setting to each hw device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * set default value for nstreams when -d AUTO/MULTI and no nstreams setting from command line. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update code format. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Enable BA to support if -d AUTO:MULTI,xxx/MULTI:AUTO,xxx. while AUTO Plugin need to update the logic of generating supported config list to virtual device. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * move device configuration handling outside form function main. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Revert "move device configuration handling outside form function main." This reverts commit ef77bfc60235be9f7478d5ecf6cd06820f9c6f2b. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Setting property performance hint to 'THROUGHPUT' and passing to executable network if no setting for of AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. * 1. Fix the issue that the dumped configuration file retrieves empty config list when using OpenCV to dump configuration. 2. Enable load_config() to load secondary property. 3. ov:device:properties from command line will replace the ov::device::properties loaded from configuration file. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update the performance statistics showing format. * Update format. * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update samples/cpp/benchmark_app/main.cpp Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update README to add some simple configuration files loaded into benchmark app. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * 1. Enable dump/load function for AUTO to support hw device property setting thorugh configuration JSON. 2. Update README.md to example a simple JSON file containing the hw device properties setting for AUTO/MULTI. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. Signed-off-by: Wang, Yang <yang4.wang@intel.com> * Update. * Update. * Update. * Drop the changes within dump/load of OpenCV config parsing. * Update. * Correct property name. Update ov::num_stream to ov::inference_precision. Signed-off-by: Wang, Yang <yang4.wang@intel.com> Co-authored-by: Nadezhda Ageeva <nkogteva@gmail.com>
2022-11-28 21:09:51 +08:00
slog::info << "Throughput: " << double_to_string(fps) << " FPS" << slog::endl;
Dynamic reshapes (#7788) * Merged and compiling * Fix for dynamic shape type * review fixes * renamed blob shape to tensor shape, small improvements * fix code style * added parsing of multiple shapes * store latency per group, add isIdleRequestAvailable() to Infer Queue * added cached random inputs * redesign pipeline, added new metrics(avg, max, min), added metrics per groups * fixed code style * small improvements * modified tensor parameters parsing * modified -i parameter parsing: added possibility to specify input names * implemented image cashing * added cashed blobs creating * added -pcseq flag, modified batch filling, changes fps formula * improvements * code formatting * code formatting2 * apply suggestions from review * replaced Buffer class with InferenceEngine Blobs * use batch size in blobs filling * added shared blob allocator to handle blob's data * fixed warnings & code style * allocate blobs * fix for networks with image info input * added comments & fixed codestyle * clear data in free() in SharedBlobAllocator * remove unnecessary check * Delimeter is changed to :: * stylefix * added layout from string function, small improvements * modified parsing to enable : in input parameters * small fixes * small fixes * added missed blob allocation, fixes * [TEST]added support for remote blobs * fix remote blobs * new inputs/files output format * removed vectors resize which caused bugs * made cl::Buffer type under ifdef, fix inputs filling * changed batch() function to not throwing exceptions * removed unused var * fix code style * replace empty name in input files with name from net input * restored old behaviour for static models * fix code style * fix warning - made const iterator * fix warning - remove reference in loop variable * added random and image_info input types to -i, fix problem with layout * replaced batch() with getBatchSize() in main * fix layout, shape, tensor shape parameters parsing * upd help messages for input, tensor shape and pcseq command * added buffer for cl output blobs, small fixes Signed-off-by: ivikhrev <ivan.vikhrev@intel.com> * added legacy mode * restore setBlob * code style formatting * move collecting latency for groups under flag * removed not applicable layouts * added hint to error message when wrong input name in -tensor_shape was specified * added new metrics to statistics report * Apply suggestions from code review * fix binary blobs filling when layout is CN * apply suggestions * moved file in the right place after rebase * improved -pcseq output * updated args and readme * removed TEMPLATE plugin registration * fix -shape arg decsription * enable providing several -i args as input * renamed legacy_mode to inference_only and made it default for static models, renamed tensor_shape to data_shape * upd readme * use getBlob() in inference only mode * fix old input type for static case * fix typo * upd readme * move log about benchmark mode to the measuring perfomance step * added class for latency metrics * upd readme, fix typos, renamed funcs * fix warning and upd parsing to avoid error with : in file paths * fix error on centos : error: use of deleted function ‘std::basic_stringstream<char>::basic_stringstream(const std::basic_stringstream<char>&) * added check for key in inputs * renamed input to inputs * adjust batch size for binary blobs * replaced warning with exception in bench mode defining * align measurement cycle with master Co-authored-by: ivikhrev <ivan.vikhrev@intel.com>
2021-12-17 12:20:43 +03:00
2018-11-23 16:19:43 +03:00
} catch (const std::exception& ex) {
slog::err << ex.what() << slog::endl;
2019-10-04 19:26:43 +03:00
if (statistics) {
statistics->add_parameters(StatisticsReport::Category::EXECUTION_RESULTS,
{StatisticsVariant("error", "error", ex.what())});
2019-10-04 19:26:43 +03:00
statistics->dump();
}
2018-11-23 16:19:43 +03:00
return 3;
}
return 0;
}