2021-02-11 12:57:05 +03:00
|
|
|
|
// Copyright (C) 2018-2021 Intel Corporation
|
2018-11-23 16:19:43 +03:00
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#include <algorithm>
|
|
|
|
|
|
#include <chrono>
|
2021-04-22 14:02:54 +03:00
|
|
|
|
#include <map>
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
#include <utility>
|
|
|
|
|
|
#include <vector>
|
2021-12-13 11:30:58 +03:00
|
|
|
|
|
|
|
|
|
|
// clang-format off
|
2021-12-30 19:09:12 +03:00
|
|
|
|
#include "openvino/pass/serialize.hpp"
|
2021-12-13 11:30:58 +03:00
|
|
|
|
|
|
|
|
|
|
#include "gna/gna_config.hpp"
|
|
|
|
|
|
#include "gpu/gpu_config.hpp"
|
|
|
|
|
|
#include "vpu/vpu_plugin_config.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
#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"
|
2021-04-22 14:02:54 +03:00
|
|
|
|
#include "inputs_filling.hpp"
|
2019-04-12 18:25:53 +03:00
|
|
|
|
#include "progress_bar.hpp"
|
2021-12-30 19:09:12 +03:00
|
|
|
|
#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"
|
2021-12-13 11:30:58 +03:00
|
|
|
|
// clang-format on
|
2018-11-23 16:19:43 +03:00
|
|
|
|
|
2019-08-09 19:02:42 +03:00
|
|
|
|
static const size_t progressBarDefaultTotalCount = 1000;
|
2018-11-23 16:19:43 +03:00
|
|
|
|
|
2021-04-22 14:02:54 +03:00
|
|
|
|
bool ParseAndCheckCommandLine(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) {
|
2019-04-12 18:25:53 +03:00
|
|
|
|
showUsage();
|
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()) {
|
2020-11-17 10:50:23 +03:00
|
|
|
|
showUsage();
|
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
|
|
|
|
|
2021-07-23 10:29:55 +03:00
|
|
|
|
if (FLAGS_latency_percentile > 100 || FLAGS_latency_percentile < 1) {
|
|
|
|
|
|
showUsage();
|
|
|
|
|
|
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
|
|
|
|
}
|
2021-09-13 15:40:36 +03:00
|
|
|
|
if (!FLAGS_hint.empty() && FLAGS_hint != "throughput" && FLAGS_hint != "tput" && FLAGS_hint != "latency") {
|
|
|
|
|
|
throw std::logic_error("Incorrect performance hint. Please set -hint option to"
|
|
|
|
|
|
"either `throughput`(tput) or `latency' value.");
|
|
|
|
|
|
}
|
2021-08-11 14:47:29 +03:00
|
|
|
|
if (!FLAGS_report_type.empty() && FLAGS_report_type != noCntReport && FLAGS_report_type != averageCntReport &&
|
|
|
|
|
|
FLAGS_report_type != detailedCntReport) {
|
|
|
|
|
|
std::string err = "only " + std::string(noCntReport) + "/" + std::string(averageCntReport) + "/" +
|
|
|
|
|
|
std::string(detailedCntReport) +
|
2020-04-15 19:01:57 +03:00
|
|
|
|
" 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");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-03-26 15:07:59 +03:00
|
|
|
|
bool isNetworkCompiled = fileExt(FLAGS_m) == "blob";
|
|
|
|
|
|
bool isPrecisionSet = !(FLAGS_ip.empty() && FLAGS_op.empty() && FLAGS_iop.empty());
|
|
|
|
|
|
if (isNetworkCompiled && isPrecisionSet) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
std::string err = std::string("Cannot set precision for a compiled network. ") +
|
|
|
|
|
|
std::string("Please re-compile your network with required precision "
|
|
|
|
|
|
"using compile_tool");
|
2021-03-26 15:07:59 +03:00
|
|
|
|
|
|
|
|
|
|
throw std::logic_error(err);
|
|
|
|
|
|
}
|
2019-04-12 18:25:53 +03:00
|
|
|
|
return true;
|
|
|
|
|
|
}
|
2018-11-23 16:19:43 +03:00
|
|
|
|
|
2019-08-09 19:02:42 +03:00
|
|
|
|
static void next_step(const std::string additional_info = "") {
|
|
|
|
|
|
static size_t step_id = 0;
|
2021-08-11 14:47:29 +03:00
|
|
|
|
static const std::map<size_t, std::string> step_names = {
|
|
|
|
|
|
{1, "Parsing and validating input arguments"},
|
|
|
|
|
|
{2, "Loading Inference Engine"},
|
|
|
|
|
|
{3, "Setting device configuration"},
|
|
|
|
|
|
{4, "Reading network files"},
|
|
|
|
|
|
{5, "Resizing network to match image sizes and given batch"},
|
|
|
|
|
|
{6, "Configuring input of the model"},
|
|
|
|
|
|
{7, "Loading the model to the device"},
|
|
|
|
|
|
{8, "Setting optimal runtime 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
|
|
|
|
{9, "Creating infer requests and preparing input blobs with data"},
|
2021-08-11 14:47:29 +03:00
|
|
|
|
{10, "Measuring performance"},
|
|
|
|
|
|
{11, "Dumping statistics report"}};
|
2019-08-09 19:02:42 +03:00
|
|
|
|
|
|
|
|
|
|
step_id++;
|
|
|
|
|
|
if (step_names.count(step_id) == 0)
|
2021-03-23 18:57:12 +03:00
|
|
|
|
IE_THROW() << "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;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-04-12 18:25:53 +03:00
|
|
|
|
/**
|
2021-04-22 14:02:54 +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 {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
ov::runtime::CompiledModel compiledModel;
|
2020-02-11 22:48:49 +03:00
|
|
|
|
|
2021-04-22 14:02:54 +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 (!ParseAndCheckCommandLine(argc, argv)) {
|
|
|
|
|
|
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) {
|
|
|
|
|
|
slog::info << "Network is compiled" << slog::endl;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-15 19:01:57 +03:00
|
|
|
|
std::vector<gflags::CommandLineFlagInfo> flags;
|
|
|
|
|
|
StatisticsReport::Parameters command_line_arguments;
|
|
|
|
|
|
gflags::GetAllFlags(&flags);
|
2021-04-22 14:02:54 +03:00
|
|
|
|
for (auto& flag : flags) {
|
2020-04-15 19:01:57 +03:00
|
|
|
|
if (!flag.is_default) {
|
2021-04-22 14:02:54 +03:00
|
|
|
|
command_line_arguments.push_back({flag.name, flag.current_value});
|
2019-10-04 19:26:43 +03:00
|
|
|
|
}
|
2020-04-15 19:01:57 +03:00
|
|
|
|
}
|
|
|
|
|
|
if (!FLAGS_report_type.empty()) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics =
|
|
|
|
|
|
std::make_shared<StatisticsReport>(StatisticsReport::Config{FLAGS_report_type, FLAGS_report_folder});
|
2019-10-04 19:26:43 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::COMMAND_LINE_PARAMETERS, command_line_arguments);
|
|
|
|
|
|
}
|
2021-04-22 14:02:54 +03:00
|
|
|
|
auto isFlagSetInCommandLine = [&command_line_arguments](const std::string& name) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
return (std::find_if(command_line_arguments.begin(),
|
|
|
|
|
|
command_line_arguments.end(),
|
|
|
|
|
|
[name](const std::pair<std::string, std::string>& p) {
|
|
|
|
|
|
return p.first == name;
|
|
|
|
|
|
}) != command_line_arguments.end());
|
2020-04-15 19:01:57 +03:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
std::string device_name = FLAGS_d;
|
|
|
|
|
|
|
|
|
|
|
|
// Parse devices
|
|
|
|
|
|
auto devices = parseDevices(device_name);
|
2019-10-04 19:26:43 +03:00
|
|
|
|
|
2020-04-15 19:01:57 +03:00
|
|
|
|
// Parse nstreams per device
|
|
|
|
|
|
std::map<std::string, std::string> device_nstreams = parseNStreamsValuePerDevice(devices, FLAGS_nstreams);
|
|
|
|
|
|
|
|
|
|
|
|
// Load device config file if specified
|
|
|
|
|
|
std::map<std::string, std::map<std::string, std::string>> config;
|
|
|
|
|
|
#ifdef USE_OPENCV
|
|
|
|
|
|
if (!FLAGS_load_config.empty()) {
|
|
|
|
|
|
load_config(FLAGS_load_config, config);
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
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 = parseInputArguments(gflags::GetArgvs());
|
2018-11-23 16:19:43 +03:00
|
|
|
|
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// ----------------- 2. Loading the Inference Engine
|
|
|
|
|
|
// -----------------------------------------------------------
|
2019-08-09 19:02:42 +03:00
|
|
|
|
next_step();
|
2018-11-23 16:19:43 +03:00
|
|
|
|
|
2021-12-30 19:09:12 +03:00
|
|
|
|
ov::runtime::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
|
|
|
|
|
2020-02-11 22:48:49 +03:00
|
|
|
|
if (FLAGS_d.find("CPU") != std::string::npos && !FLAGS_l.empty()) {
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// CPU (MKLDNN) extensions is loaded as a shared library and passed as a
|
|
|
|
|
|
// pointer to base extension
|
2021-03-05 12:08:01 +03:00
|
|
|
|
const auto extension_ptr = std::make_shared<InferenceEngine::Extension>(FLAGS_l);
|
2021-12-30 19:09:12 +03:00
|
|
|
|
core.add_extension(extension_ptr);
|
2020-02-11 22:48:49 +03:00
|
|
|
|
slog::info << "CPU (MKLDNN) extensions is loaded " << FLAGS_l << slog::endl;
|
2019-05-27 21:18:32 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-15 19:01:57 +03:00
|
|
|
|
// Load clDNN Extensions
|
2019-05-27 21:18:32 +03:00
|
|
|
|
if ((FLAGS_d.find("GPU") != std::string::npos) && !FLAGS_c.empty()) {
|
2020-04-15 19:01:57 +03:00
|
|
|
|
// 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));
|
2021-12-30 19:09:12 +03:00
|
|
|
|
core.set_config({{CONFIG_KEY(CONFIG_FILE), ext}}, "GPU");
|
2020-04-15 19:01:57 +03:00
|
|
|
|
slog::info << "GPU extensions is loaded " << ext << slog::endl;
|
2018-11-23 16:19:43 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-01-12 16:09:54 +08:00
|
|
|
|
if (FLAGS_hint.empty()) {
|
|
|
|
|
|
for (auto& device : devices) {
|
|
|
|
|
|
std::vector<std::string> supported_config_keys =
|
|
|
|
|
|
core.get_metric(device, METRIC_KEY(SUPPORTED_CONFIG_KEYS));
|
|
|
|
|
|
if (std::find(supported_config_keys.begin(),
|
|
|
|
|
|
supported_config_keys.end(),
|
|
|
|
|
|
CONFIG_KEY(PERFORMANCE_HINT)) != supported_config_keys.end()) {
|
|
|
|
|
|
slog::warn << "-hint default value is determined as" << CONFIG_VALUE(THROUGHPUT)
|
|
|
|
|
|
<< " automatically for " << device
|
|
|
|
|
|
<< " device. For more detailed information look at README." << slog::endl;
|
|
|
|
|
|
FLAGS_hint = CONFIG_VALUE(THROUGHPUT);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-30 19:09:12 +03:00
|
|
|
|
slog::info << "OpenVINO: " << ov::get_openvino_version() << slog::endl;
|
2019-08-09 19:02:42 +03:00
|
|
|
|
slog::info << "Device info: " << slog::endl;
|
2021-12-30 19:09:12 +03:00
|
|
|
|
slog::info << core.get_versions(device_name) << slog::endl;
|
2018-11-23 16:19:43 +03:00
|
|
|
|
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// ----------------- 3. Setting device configuration
|
|
|
|
|
|
// -----------------------------------------------------------
|
2019-08-09 19:02:42 +03:00
|
|
|
|
next_step();
|
2021-09-13 15:40:36 +03:00
|
|
|
|
std::string ov_perf_hint;
|
|
|
|
|
|
if (FLAGS_hint == "throughput" || FLAGS_hint == "tput")
|
|
|
|
|
|
ov_perf_hint = CONFIG_VALUE(THROUGHPUT);
|
|
|
|
|
|
else if (FLAGS_hint == "latency")
|
|
|
|
|
|
ov_perf_hint = CONFIG_VALUE(LATENCY);
|
2019-08-09 19:02:42 +03:00
|
|
|
|
|
2021-10-19 16:51:38 +03:00
|
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-15 19:01:57 +03:00
|
|
|
|
bool perf_counts = false;
|
|
|
|
|
|
// Update config per device according to command line parameters
|
|
|
|
|
|
for (auto& device : devices) {
|
2021-04-22 14:02:54 +03:00
|
|
|
|
if (!config.count(device))
|
|
|
|
|
|
config[device] = {};
|
2020-04-15 19:01:57 +03:00
|
|
|
|
std::map<std::string, std::string>& device_config = config.at(device);
|
|
|
|
|
|
|
2021-09-13 15:40:36 +03:00
|
|
|
|
// high-level performance modes
|
|
|
|
|
|
if (!ov_perf_hint.empty()) {
|
|
|
|
|
|
device_config[CONFIG_KEY(PERFORMANCE_HINT)] = ov_perf_hint;
|
|
|
|
|
|
if (FLAGS_nireq != 0)
|
|
|
|
|
|
device_config[CONFIG_KEY(PERFORMANCE_HINT_NUM_REQUESTS)] = std::to_string(FLAGS_nireq);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-15 19:01:57 +03:00
|
|
|
|
// Set performance counter
|
|
|
|
|
|
if (isFlagSetInCommandLine("pc")) {
|
|
|
|
|
|
// set to user defined value
|
|
|
|
|
|
device_config[CONFIG_KEY(PERF_COUNT)] = FLAGS_pc ? CONFIG_VALUE(YES) : CONFIG_VALUE(NO);
|
2021-08-11 14:47:29 +03:00
|
|
|
|
} else if (device_config.count(CONFIG_KEY(PERF_COUNT)) &&
|
|
|
|
|
|
(device_config.at(CONFIG_KEY(PERF_COUNT)) == "YES")) {
|
|
|
|
|
|
slog::warn << "Performance counters for " << device
|
|
|
|
|
|
<< " device is turned on. To print results use -pc option." << slog::endl;
|
2020-04-15 19:01:57 +03:00
|
|
|
|
} else if (FLAGS_report_type == detailedCntReport || FLAGS_report_type == averageCntReport) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
slog::warn << "Turn on performance counters for " << device << " device since report type is "
|
|
|
|
|
|
<< FLAGS_report_type << "." << slog::endl;
|
2020-04-15 19:01:57 +03:00
|
|
|
|
device_config[CONFIG_KEY(PERF_COUNT)] = CONFIG_VALUE(YES);
|
|
|
|
|
|
} else if (!FLAGS_exec_graph_path.empty()) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
slog::warn << "Turn on performance counters for " << device << " device due to execution graph dumping."
|
|
|
|
|
|
<< slog::endl;
|
2020-04-15 19:01:57 +03:00
|
|
|
|
device_config[CONFIG_KEY(PERF_COUNT)] = CONFIG_VALUE(YES);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// set to default value
|
|
|
|
|
|
device_config[CONFIG_KEY(PERF_COUNT)] = FLAGS_pc ? CONFIG_VALUE(YES) : CONFIG_VALUE(NO);
|
2020-04-13 21:17:23 +03:00
|
|
|
|
}
|
2020-04-15 19:01:57 +03:00
|
|
|
|
perf_counts = (device_config.at(CONFIG_KEY(PERF_COUNT)) == CONFIG_VALUE(YES)) ? true : perf_counts;
|
|
|
|
|
|
|
2021-09-13 15:40:36 +03:00
|
|
|
|
// the rest are individual per-device settings (overriding the values set with perf modes)
|
2021-04-22 14:02:54 +03:00
|
|
|
|
auto setThroughputStreams = [&]() {
|
2021-10-19 16:51:38 +03:00
|
|
|
|
const std::string key = getDeviceTypeFromName(device) + "_THROUGHPUT_STREAMS";
|
2020-04-15 19:01:57 +03:00
|
|
|
|
if (device_nstreams.count(device)) {
|
|
|
|
|
|
// set to user defined value
|
2021-08-11 14:47:29 +03:00
|
|
|
|
std::vector<std::string> supported_config_keys =
|
2021-12-30 19:09:12 +03:00
|
|
|
|
core.get_metric(device, METRIC_KEY(SUPPORTED_CONFIG_KEYS));
|
2021-08-11 14:47:29 +03:00
|
|
|
|
if (std::find(supported_config_keys.begin(), supported_config_keys.end(), key) ==
|
|
|
|
|
|
supported_config_keys.end()) {
|
2020-04-15 19:01:57 +03:00
|
|
|
|
throw std::logic_error("Device " + device + " doesn't support config key '" + key + "'! " +
|
2021-04-22 14:02:54 +03:00
|
|
|
|
"Please specify -nstreams for correct devices in format "
|
|
|
|
|
|
"<dev1>:<nstreams1>,<dev2>:<nstreams2>" +
|
2020-04-15 19:01:57 +03:00
|
|
|
|
" or via configuration file.");
|
|
|
|
|
|
}
|
|
|
|
|
|
device_config[key] = device_nstreams.at(device);
|
2021-09-13 15:40:36 +03:00
|
|
|
|
} else if (ov_perf_hint.empty() && !device_config.count(key) && (FLAGS_api == "async")) {
|
2021-04-22 14:02:54 +03:00
|
|
|
|
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 (std::string::npos == device.find("MYRIAD")) // MYRIAD sets the default number of
|
|
|
|
|
|
// streams implicitly (without _AUTO)
|
2021-10-19 16:51:38 +03:00
|
|
|
|
device_config[key] = std::string(getDeviceTypeFromName(device) + "_THROUGHPUT_AUTO");
|
2020-04-15 19:01:57 +03:00
|
|
|
|
}
|
|
|
|
|
|
if (device_config.count(key))
|
|
|
|
|
|
device_nstreams[device] = device_config.at(key);
|
|
|
|
|
|
};
|
2020-04-13 21:17:23 +03:00
|
|
|
|
|
2021-10-19 16:51:38 +03:00
|
|
|
|
if (device.find("CPU") != std::string::npos) { // CPU supports few special performance-oriented keys
|
2019-08-09 19:02:42 +03:00
|
|
|
|
// limit threading for CPU portion of inference
|
2020-04-15 19:01:57 +03:00
|
|
|
|
if (isFlagSetInCommandLine("nthreads"))
|
|
|
|
|
|
device_config[CONFIG_KEY(CPU_THREADS_NUM)] = std::to_string(FLAGS_nthreads);
|
|
|
|
|
|
|
|
|
|
|
|
if (isFlagSetInCommandLine("enforcebf16"))
|
|
|
|
|
|
device_config[CONFIG_KEY(ENFORCE_BF16)] = FLAGS_enforcebf16 ? CONFIG_VALUE(YES) : CONFIG_VALUE(NO);
|
|
|
|
|
|
|
|
|
|
|
|
if (isFlagSetInCommandLine("pin")) {
|
|
|
|
|
|
// set to user defined value
|
|
|
|
|
|
device_config[CONFIG_KEY(CPU_BIND_THREAD)] = FLAGS_pin;
|
|
|
|
|
|
} else if (!device_config.count(CONFIG_KEY(CPU_BIND_THREAD))) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
if ((device_name.find("MULTI") != std::string::npos) &&
|
|
|
|
|
|
(device_name.find("GPU") != std::string::npos)) {
|
|
|
|
|
|
slog::warn << "Turn off threads pinning for " << device
|
|
|
|
|
|
<< " device since multi-scenario with GPU device is used." << slog::endl;
|
2020-04-15 19:01:57 +03:00
|
|
|
|
device_config[CONFIG_KEY(CPU_BIND_THREAD)] = CONFIG_VALUE(NO);
|
|
|
|
|
|
}
|
2019-10-04 19:26:43 +03:00
|
|
|
|
}
|
2019-08-09 19:02:42 +03:00
|
|
|
|
|
|
|
|
|
|
// for CPU execution, more throughput-oriented execution via streams
|
2020-04-15 19:01:57 +03:00
|
|
|
|
setThroughputStreams();
|
2021-10-19 16:51:38 +03:00
|
|
|
|
} else if (device.find("GPU") != std::string::npos) {
|
2020-04-15 19:01:57 +03:00
|
|
|
|
// for GPU execution, more throughput-oriented execution via streams
|
|
|
|
|
|
setThroughputStreams();
|
2019-10-04 19:26:43 +03:00
|
|
|
|
|
2021-08-11 14:47:29 +03:00
|
|
|
|
if ((device_name.find("MULTI") != std::string::npos) &&
|
|
|
|
|
|
(device_name.find("CPU") != std::string::npos)) {
|
2021-06-14 22:47:59 +09:00
|
|
|
|
slog::warn << "Turn on GPU throttling. Multi-device execution with "
|
|
|
|
|
|
"the CPU + GPU performs best with GPU throttling hint, "
|
2021-04-22 14:02:54 +03:00
|
|
|
|
<< "which releases another CPU thread (that is otherwise "
|
|
|
|
|
|
"used by the GPU driver for active polling)"
|
|
|
|
|
|
<< slog::endl;
|
2021-06-09 09:02:25 +03:00
|
|
|
|
device_config[GPU_CONFIG_KEY(PLUGIN_THROTTLE)] = "1";
|
2019-10-04 19:26:43 +03:00
|
|
|
|
}
|
2021-10-19 16:51:38 +03:00
|
|
|
|
} else if (device.find("MYRIAD") != std::string::npos) {
|
2020-04-15 19:01:57 +03:00
|
|
|
|
device_config[CONFIG_KEY(LOG_LEVEL)] = CONFIG_VALUE(LOG_WARNING);
|
2020-12-29 19:02:57 +03:00
|
|
|
|
setThroughputStreams();
|
2021-10-19 16:51:38 +03:00
|
|
|
|
} else if (device.find("GNA") != std::string::npos) {
|
2020-05-22 02:23:12 +03:00
|
|
|
|
if (FLAGS_qb == 8)
|
|
|
|
|
|
device_config[GNA_CONFIG_KEY(PRECISION)] = "I8";
|
|
|
|
|
|
else
|
|
|
|
|
|
device_config[GNA_CONFIG_KEY(PRECISION)] = "I16";
|
|
|
|
|
|
|
|
|
|
|
|
if (isFlagSetInCommandLine("nthreads"))
|
|
|
|
|
|
device_config[GNA_CONFIG_KEY(LIB_N_THREADS)] = std::to_string(FLAGS_nthreads);
|
2020-10-21 06:40:18 +03:00
|
|
|
|
} else {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
std::vector<std::string> supported_config_keys =
|
2021-12-30 19:09:12 +03:00
|
|
|
|
core.get_metric(device, METRIC_KEY(SUPPORTED_CONFIG_KEYS));
|
2021-04-22 14:02:54 +03:00
|
|
|
|
auto supported = [&](const std::string& key) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
return std::find(std::begin(supported_config_keys), std::end(supported_config_keys), key) !=
|
|
|
|
|
|
std::end(supported_config_keys);
|
2020-10-21 06:40:18 +03:00
|
|
|
|
};
|
|
|
|
|
|
if (supported(CONFIG_KEY(CPU_THREADS_NUM)) && isFlagSetInCommandLine("nthreads")) {
|
|
|
|
|
|
device_config[CONFIG_KEY(CPU_THREADS_NUM)] = std::to_string(FLAGS_nthreads);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (supported(CONFIG_KEY(CPU_THROUGHPUT_STREAMS)) && isFlagSetInCommandLine("nstreams")) {
|
|
|
|
|
|
device_config[CONFIG_KEY(CPU_THROUGHPUT_STREAMS)] = FLAGS_nstreams;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (supported(CONFIG_KEY(CPU_BIND_THREAD)) && isFlagSetInCommandLine("pin")) {
|
|
|
|
|
|
device_config[CONFIG_KEY(CPU_BIND_THREAD)] = FLAGS_pin;
|
|
|
|
|
|
}
|
2019-08-09 19:02:42 +03:00
|
|
|
|
}
|
2018-11-23 16:19:43 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-04-15 19:01:57 +03:00
|
|
|
|
for (auto&& item : config) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
core.set_config(item.second, item.first);
|
2020-04-15 19:01:57 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2020-02-11 22:48:49 +03:00
|
|
|
|
size_t batchSize = FLAGS_b;
|
2021-12-30 19:09:12 +03:00
|
|
|
|
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;
|
2021-02-11 12:57:05 +03:00
|
|
|
|
std::string output_name;
|
2021-05-17 13:41:15 +03:00
|
|
|
|
|
|
|
|
|
|
// Takes priority over config from file
|
|
|
|
|
|
if (!FLAGS_cache_dir.empty()) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
core.set_config({{CONFIG_KEY(CACHE_DIR), FLAGS_cache_dir}});
|
2021-05-17 13:41:15 +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
|
|
|
|
bool isDynamicNetwork = false;
|
2021-12-30 19:09:12 +03:00
|
|
|
|
|
2021-05-17 13:41:15 +03:00
|
|
|
|
if (FLAGS_load_from_file && !isNetworkCompiled) {
|
|
|
|
|
|
next_step();
|
|
|
|
|
|
slog::info << "Skipping the step for loading network from file" << slog::endl;
|
|
|
|
|
|
next_step();
|
|
|
|
|
|
slog::info << "Skipping the step for loading network from file" << slog::endl;
|
|
|
|
|
|
next_step();
|
|
|
|
|
|
slog::info << "Skipping the step for loading network from file" << slog::endl;
|
|
|
|
|
|
auto startTime = Time::now();
|
2021-12-30 19:09:12 +03:00
|
|
|
|
compiledModel = core.compile_model(FLAGS_m, device_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
|
|
|
|
auto duration_ms = double_to_string(get_duration_ms_till_now(startTime));
|
2021-05-17 13:41:15 +03:00
|
|
|
|
slog::info << "Load network took " << duration_ms << " ms" << slog::endl;
|
|
|
|
|
|
if (statistics)
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{{"load network time (ms)", duration_ms}});
|
2021-12-30 19:09:12 +03:00
|
|
|
|
app_inputs_info = getInputsInfo(FLAGS_shape,
|
|
|
|
|
|
FLAGS_layout,
|
|
|
|
|
|
batchSize,
|
|
|
|
|
|
FLAGS_data_shape,
|
|
|
|
|
|
inputFiles,
|
|
|
|
|
|
FLAGS_iscale,
|
|
|
|
|
|
FLAGS_imean,
|
|
|
|
|
|
compiledModel.inputs());
|
2021-05-17 13:41:15 +03:00
|
|
|
|
if (batchSize == 0) {
|
|
|
|
|
|
batchSize = 1;
|
|
|
|
|
|
}
|
2021-12-30 19:09:12 +03:00
|
|
|
|
|
2021-05-17 13:41:15 +03:00
|
|
|
|
} else if (!isNetworkCompiled) {
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// ----------------- 4. Reading the Intermediate Representation network
|
|
|
|
|
|
// ----------------------------------------
|
2020-02-11 22:48:49 +03:00
|
|
|
|
next_step();
|
|
|
|
|
|
|
|
|
|
|
|
slog::info << "Loading network files" << slog::endl;
|
|
|
|
|
|
|
|
|
|
|
|
auto startTime = Time::now();
|
2021-12-30 19:09:12 +03:00
|
|
|
|
auto model = core.read_model(FLAGS_m);
|
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 = double_to_string(get_duration_ms_till_now(startTime));
|
2020-02-11 22:48:49 +03:00
|
|
|
|
slog::info << "Read network took " << duration_ms << " ms" << slog::endl;
|
|
|
|
|
|
if (statistics)
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{{"read network time (ms)", duration_ms}});
|
2020-02-11 22:48:49 +03:00
|
|
|
|
|
2021-12-30 19:09:12 +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()) {
|
|
|
|
|
|
throw std::logic_error("no inputs info is provided");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// ----------------- 5. Resizing network to match image sizes and given
|
|
|
|
|
|
// batch ----------------------------------
|
2020-02-11 22:48:49 +03:00
|
|
|
|
next_step();
|
2020-05-13 21:12:22 +03:00
|
|
|
|
// Parse input shapes if specified
|
|
|
|
|
|
bool reshape = false;
|
2021-12-30 19:09:12 +03:00
|
|
|
|
app_inputs_info = getInputsInfo(FLAGS_shape,
|
|
|
|
|
|
FLAGS_layout,
|
|
|
|
|
|
FLAGS_b,
|
|
|
|
|
|
FLAGS_data_shape,
|
|
|
|
|
|
inputFiles,
|
|
|
|
|
|
FLAGS_iscale,
|
|
|
|
|
|
FLAGS_imean,
|
|
|
|
|
|
inputInfo,
|
|
|
|
|
|
reshape);
|
2020-05-13 21:12:22 +03:00
|
|
|
|
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;
|
2020-05-13 21:12:22 +03:00
|
|
|
|
slog::info << "Reshaping network: " << getShapesString(shapes) << slog::endl;
|
|
|
|
|
|
startTime = Time::now();
|
2021-12-30 19:09:12 +03:00
|
|
|
|
model->reshape(shapes);
|
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
|
|
|
|
duration_ms = double_to_string(get_duration_ms_till_now(startTime));
|
2020-05-13 21:12:22 +03:00
|
|
|
|
slog::info << "Reshape network took " << duration_ms << " ms" << slog::endl;
|
|
|
|
|
|
if (statistics)
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{{"reshape network time (ms)", duration_ms}});
|
2020-02-11 22:48:49 +03:00
|
|
|
|
}
|
2021-12-30 19:09:12 +03:00
|
|
|
|
|
|
|
|
|
|
// ----------------- 6. Configuring inputs and outputs
|
|
|
|
|
|
// ----------------------------------------------------------------------
|
|
|
|
|
|
next_step();
|
|
|
|
|
|
auto preproc = ov::preprocess::PrePostProcessor(model);
|
|
|
|
|
|
|
|
|
|
|
|
processPrecision(*model, FLAGS_ip, FLAGS_op, FLAGS_iop);
|
|
|
|
|
|
for (auto& item : model->inputs()) {
|
|
|
|
|
|
// if precision for input set by user, then set it to app_inputs
|
|
|
|
|
|
const auto& name = item.get_any_name();
|
|
|
|
|
|
if (!FLAGS_ip.empty() || FLAGS_iop.find(name) != std::string::npos) {
|
|
|
|
|
|
for (auto& info : app_inputs_info) {
|
|
|
|
|
|
info.at(name).type = item.get_element_type();
|
|
|
|
|
|
}
|
|
|
|
|
|
} else if (app_inputs_info[0].at(name).isImage()) {
|
|
|
|
|
|
// image input, set U8
|
|
|
|
|
|
for (auto& info : app_inputs_info) {
|
|
|
|
|
|
info.at(name).type = ov::element::u8;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
auto& in = preproc.input(name);
|
|
|
|
|
|
in.tensor().set_element_type(app_inputs_info[0].at(name).type);
|
|
|
|
|
|
|
|
|
|
|
|
// Explicitly set inputs layout.
|
|
|
|
|
|
in.model().set_layout(app_inputs_info[0].at(name).layout);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2021-12-30 19:09:12 +03:00
|
|
|
|
topology_name = model->get_friendly_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
|
|
|
|
// use batch size according to provided layout and shapes (static case)
|
2021-12-30 19:09:12 +03:00
|
|
|
|
if (!isDynamicNetwork) {
|
|
|
|
|
|
batchSize = getModelInputBatchSize(*model);
|
2020-02-11 22:48:49 +03:00
|
|
|
|
|
2021-12-30 19:09:12 +03:00
|
|
|
|
slog::info << "Network batch size: " << batchSize << slog::endl;
|
|
|
|
|
|
} else if (batchSize == 0) {
|
|
|
|
|
|
batchSize = 1;
|
2020-02-11 22:48:49 +03:00
|
|
|
|
}
|
2021-03-26 15:07:59 +03:00
|
|
|
|
|
2021-12-30 19:09:12 +03:00
|
|
|
|
printInputAndOutputsInfoShort(*model);
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// ----------------- 7. Loading the model to the device
|
|
|
|
|
|
// --------------------------------------------------------
|
2020-02-11 22:48:49 +03:00
|
|
|
|
next_step();
|
|
|
|
|
|
startTime = Time::now();
|
2021-12-30 19:09:12 +03:00
|
|
|
|
compiledModel = core.compile_model(model, device_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
|
|
|
|
duration_ms = double_to_string(get_duration_ms_till_now(startTime));
|
2020-02-11 22:48:49 +03:00
|
|
|
|
slog::info << "Load network took " << duration_ms << " ms" << slog::endl;
|
|
|
|
|
|
if (statistics)
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{{"load network time (ms)", duration_ms}});
|
2020-02-11 22:48:49 +03:00
|
|
|
|
} else {
|
|
|
|
|
|
next_step();
|
|
|
|
|
|
slog::info << "Skipping the step for compiled network" << slog::endl;
|
|
|
|
|
|
next_step();
|
|
|
|
|
|
slog::info << "Skipping the step for compiled network" << slog::endl;
|
|
|
|
|
|
next_step();
|
|
|
|
|
|
slog::info << "Skipping the step for compiled network" << slog::endl;
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// ----------------- 7. Loading the model to the device
|
|
|
|
|
|
// --------------------------------------------------------
|
2020-02-11 22:48:49 +03:00
|
|
|
|
next_step();
|
|
|
|
|
|
auto startTime = Time::now();
|
2022-01-10 23:37:46 +03:00
|
|
|
|
|
|
|
|
|
|
std::ifstream modelStream(FLAGS_m);
|
|
|
|
|
|
if (!modelStream.is_open()) {
|
|
|
|
|
|
throw std::runtime_error("Cannot open model file " + FLAGS_m);
|
|
|
|
|
|
}
|
|
|
|
|
|
compiledModel = core.import_model(modelStream, device_name, {});
|
|
|
|
|
|
modelStream.close();
|
|
|
|
|
|
|
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 = double_to_string(get_duration_ms_till_now(startTime));
|
2020-02-11 22:48:49 +03:00
|
|
|
|
slog::info << "Import network took " << duration_ms << " ms" << slog::endl;
|
|
|
|
|
|
if (statistics)
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{{"import network time (ms)", duration_ms}});
|
2021-12-30 19:09:12 +03:00
|
|
|
|
|
|
|
|
|
|
app_inputs_info = getInputsInfo(FLAGS_shape,
|
|
|
|
|
|
FLAGS_layout,
|
|
|
|
|
|
FLAGS_b,
|
|
|
|
|
|
FLAGS_data_shape,
|
|
|
|
|
|
inputFiles,
|
|
|
|
|
|
FLAGS_iscale,
|
|
|
|
|
|
FLAGS_imean,
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
if (isDynamicNetwork && FLAGS_api == "sync") {
|
|
|
|
|
|
throw std::logic_error("Benchmarking of the model with dynamic shapes is available for async API only."
|
|
|
|
|
|
"Please use -api async -nstreams 1 -nireq 1 to emulate sync behavior");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 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 && app_inputs_info.size() != 1) {
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-09-13 15:40:36 +03:00
|
|
|
|
// ----------------- 8. Querying optimal runtime parameters
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// -----------------------------------------------------
|
2019-08-09 19:02:42 +03:00
|
|
|
|
next_step();
|
2022-01-12 16:09:54 +08:00
|
|
|
|
// output of the actual settings that the device selected
|
|
|
|
|
|
for (const auto& device : devices) {
|
|
|
|
|
|
std::vector<std::string> supported_config_keys = core.get_metric(device, METRIC_KEY(SUPPORTED_CONFIG_KEYS));
|
|
|
|
|
|
slog::info << "Device: " << device << slog::endl;
|
|
|
|
|
|
for (const auto& cfg : supported_config_keys) {
|
|
|
|
|
|
try {
|
|
|
|
|
|
slog::info << " {" << cfg << " , " << compiledModel.get_config(cfg).as<std::string>();
|
2021-09-13 15:40:36 +03:00
|
|
|
|
slog::info << " }" << slog::endl;
|
2022-01-12 16:09:54 +08:00
|
|
|
|
} catch (...) {
|
|
|
|
|
|
};
|
2021-09-13 15:40:36 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2019-08-09 19:02:42 +03:00
|
|
|
|
|
2020-04-15 19:01:57 +03:00
|
|
|
|
// Update number of streams
|
|
|
|
|
|
for (auto&& ds : device_nstreams) {
|
2021-10-19 16:51:38 +03:00
|
|
|
|
const std::string key = getDeviceTypeFromName(ds.first) + "_THROUGHPUT_STREAMS";
|
2021-12-30 19:09:12 +03:00
|
|
|
|
device_nstreams[ds.first] = core.get_config(ds.first, key).as<std::string>();
|
2020-04-15 19:01:57 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
2019-08-09 19:02:42 +03:00
|
|
|
|
// Number of requests
|
|
|
|
|
|
uint32_t nireq = FLAGS_nireq;
|
|
|
|
|
|
if (nireq == 0) {
|
2020-04-13 21:17:23 +03:00
|
|
|
|
if (FLAGS_api == "sync") {
|
|
|
|
|
|
nireq = 1;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
std::string key = METRIC_KEY(OPTIMAL_NUMBER_OF_INFER_REQUESTS);
|
|
|
|
|
|
try {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
nireq = compiledModel.get_metric(key).as<unsigned int>();
|
2021-03-18 16:30:16 +03:00
|
|
|
|
} catch (const std::exception& ex) {
|
2021-04-22 14:02:54 +03:00
|
|
|
|
IE_THROW() << "Every device used with the benchmark_app should "
|
2021-12-30 19:09:12 +03:00
|
|
|
|
<< "support OPTIMAL_NUMBER_OF_INFER_REQUESTS metric. "
|
2021-04-22 14:02:54 +03:00
|
|
|
|
<< "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
|
|
|
|
|
|
uint32_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-01-21 21:31:31 +03:00
|
|
|
|
}
|
2019-04-12 18:25:53 +03:00
|
|
|
|
|
2019-08-09 19:02:42 +03:00
|
|
|
|
// Time limit
|
|
|
|
|
|
uint32_t duration_seconds = 0;
|
|
|
|
|
|
if (FLAGS_t != 0) {
|
|
|
|
|
|
// time limit
|
|
|
|
|
|
duration_seconds = FLAGS_t;
|
|
|
|
|
|
} else if (FLAGS_niter == 0) {
|
|
|
|
|
|
// default time limit
|
|
|
|
|
|
duration_seconds = deviceDefaultDeviceDurationInSeconds(device_name);
|
2019-04-12 18:25:53 +03:00
|
|
|
|
}
|
2019-08-09 19:02:42 +03:00
|
|
|
|
uint64_t duration_nanoseconds = getDurationInNanoseconds(duration_seconds);
|
2019-04-12 18:25:53 +03:00
|
|
|
|
|
2019-10-04 19:26:43 +03:00
|
|
|
|
if (statistics) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(
|
|
|
|
|
|
StatisticsReport::Category::RUNTIME_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
|
|
|
|
{"benchmark mode", inferenceOnly ? "inference only" : "full"},
|
2021-08-11 14:47:29 +03:00
|
|
|
|
{"topology", topology_name},
|
|
|
|
|
|
{"target device", device_name},
|
|
|
|
|
|
{"API", FLAGS_api},
|
2021-12-30 19:09:12 +03:00
|
|
|
|
{"precision", std::string(type.get_type_name())},
|
2021-08-11 14:47:29 +03:00
|
|
|
|
{"batch size", std::to_string(batchSize)},
|
|
|
|
|
|
{"number of iterations", std::to_string(niter)},
|
|
|
|
|
|
{"number of parallel infer requests", std::to_string(nireq)},
|
|
|
|
|
|
{"duration (ms)", std::to_string(getDurationInMilliseconds(duration_seconds))},
|
|
|
|
|
|
});
|
2019-10-04 19:26:43 +03:00
|
|
|
|
for (auto& nstreams : device_nstreams) {
|
|
|
|
|
|
std::stringstream ss;
|
|
|
|
|
|
ss << "number of " << nstreams.first << " streams";
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::RUNTIME_CONFIG,
|
|
|
|
|
|
{
|
|
|
|
|
|
{ss.str(), nstreams.second},
|
|
|
|
|
|
});
|
2019-10-04 19:26:43 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-04-22 14:02:54 +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
|
|
|
|
|
2021-12-30 19:09:12 +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;
|
|
|
|
|
|
|
2021-12-30 19:09:12 +03:00
|
|
|
|
std::map<std::string, ov::runtime::TensorVector> inputsData;
|
2021-09-17 11:04:50 +03:00
|
|
|
|
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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
inputsData = ::gpu::getRemoteInputTensors(inputFiles, app_inputs_info, compiledModel, clInputsBuffer);
|
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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
inputsData = getTensors(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 {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
inputsData = getTensorsStaticCase(
|
|
|
|
|
|
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 {
|
2021-09-17 11:04:50 +03:00
|
|
|
|
IE_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
|
|
|
|
}
|
2021-09-17 11:04:50 +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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
inputsData = getTensors(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 =
|
2021-12-30 19:09:12 +03:00
|
|
|
|
getTensorsStaticCase(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
|
|
|
|
}
|
2021-09-17 11:04:50 +03:00
|
|
|
|
}
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// ----------------- 10. Measuring performance
|
|
|
|
|
|
// ------------------------------------------------------------------
|
2019-08-09 19:02:42 +03:00
|
|
|
|
size_t progressCnt = 0;
|
|
|
|
|
|
size_t progressBarTotalCount = progressBarDefaultTotalCount;
|
|
|
|
|
|
size_t iteration = 0;
|
2019-04-12 18:25:53 +03:00
|
|
|
|
|
2019-08-09 19:02:42 +03:00
|
|
|
|
std::stringstream ss;
|
2020-11-11 15:35:39 +03:00
|
|
|
|
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 << getDurationInMilliseconds(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) {
|
|
|
|
|
|
progressBarTotalCount = niter;
|
|
|
|
|
|
}
|
|
|
|
|
|
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) {
|
|
|
|
|
|
slog::info << "BENCHMARK IS IN INFERENCE ONLY MODE." << slog::endl;
|
|
|
|
|
|
slog::info << "Input blobs will be filled once before performance measurements." << slog::endl;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
slog::info << "BENCHMARK IS IN FULL MODE." << slog::endl;
|
|
|
|
|
|
slog::info << "Inputs setup stage will be included in performance measurements." << slog::endl;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2021-12-30 19:09:12 +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;
|
2021-12-30 19:09:12 +03:00
|
|
|
|
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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
inferRequest->setTensor(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 {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
auto requestTensor = inferRequest->getTensor(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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
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
|
|
|
|
}
|
2021-12-30 19:09:12 +03:00
|
|
|
|
copyTensorData(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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
auto outputTensors =
|
|
|
|
|
|
::gpu::getRemoteOutputTensors(compiledModel, inferRequest->getOutputClBuffer());
|
|
|
|
|
|
for (auto& output : compiledModel.outputs()) {
|
|
|
|
|
|
inferRequest->setTensor(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.getIdleRequest();
|
|
|
|
|
|
if (!inferRequest) {
|
2021-03-23 18:57:12 +03:00
|
|
|
|
IE_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];
|
2021-12-30 19:09:12 +03:00
|
|
|
|
inferRequest->setTensor(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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
auto outputTensors = ::gpu::getRemoteOutputTensors(compiledModel, inferRequest->getOutputClBuffer());
|
|
|
|
|
|
for (auto& output : compiledModel.outputs()) {
|
|
|
|
|
|
inferRequest->setTensor(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->startAsync();
|
|
|
|
|
|
}
|
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
|
|
|
|
inferRequestsQueue.waitAll();
|
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
|
|
|
|
|
2020-07-27 16:45:07 +03:00
|
|
|
|
auto duration_ms = double_to_string(inferRequestsQueue.getLatencies()[0]);
|
|
|
|
|
|
slog::info << "First inference took " << 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) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{{"first inference time (ms)", 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
|
|
|
|
}
|
2019-08-09 19:02:42 +03:00
|
|
|
|
inferRequestsQueue.resetTimes();
|
|
|
|
|
|
|
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 **/
|
2021-04-22 14:02:54 +03:00
|
|
|
|
/** to align number if iterations to guarantee that last infer requests are
|
|
|
|
|
|
* executed in the same conditions **/
|
2019-08-09 19:02:42 +03:00
|
|
|
|
ProgressBar progressBar(progressBarTotalCount, FLAGS_stream_output, FLAGS_progress);
|
2021-08-11 14:47:29 +03:00
|
|
|
|
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.getIdleRequest();
|
|
|
|
|
|
if (!inferRequest) {
|
2021-03-23 18:57:12 +03:00
|
|
|
|
IE_THROW() << "No idle Infer Requests!";
|
2019-08-09 19:02:42 +03:00
|
|
|
|
}
|
2019-01-21 21:31:31 +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->setLatencyGroupId(iteration % app_inputs_info.size());
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (isDynamicNetwork) {
|
|
|
|
|
|
batchSize = getBatchSize(inputs);
|
2021-12-30 19:09:12 +03:00
|
|
|
|
if (!std::any_of(inputs.begin(),
|
|
|
|
|
|
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;
|
|
|
|
|
|
}
|
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()];
|
2021-12-30 19:09:12 +03:00
|
|
|
|
inferRequest->setTensor(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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
auto outputTensors =
|
|
|
|
|
|
::gpu::getRemoteOutputTensors(compiledModel, inferRequest->getOutputClBuffer());
|
|
|
|
|
|
for (auto& output : compiledModel.outputs()) {
|
|
|
|
|
|
inferRequest->setTensor(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 {
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// As the inference request is currently idle, the wait() adds no
|
|
|
|
|
|
// additional overhead (and should return immediately). The primary
|
|
|
|
|
|
// reason for calling the method is exception checking/re-throwing.
|
|
|
|
|
|
// Callback, that governs the actual execution can handle errors as
|
|
|
|
|
|
// well, but as it uses just error codes it has no details like ‘what()’
|
|
|
|
|
|
// method of `std::exception` So, rechecking for any exceptions here.
|
2020-02-11 22:48:49 +03:00
|
|
|
|
inferRequest->wait();
|
2019-08-09 19:02:42 +03:00
|
|
|
|
inferRequest->startAsync();
|
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-04-12 18:25:53 +03:00
|
|
|
|
|
2019-08-09 19:02:42 +03:00
|
|
|
|
if (niter > 0) {
|
|
|
|
|
|
progressBar.addProgress(1);
|
|
|
|
|
|
} else {
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// calculate how many progress intervals are covered by current
|
|
|
|
|
|
// iteration. depends on the current iteration time and time of each
|
|
|
|
|
|
// progress interval. Previously covered progress intervals must be
|
|
|
|
|
|
// skipped.
|
2019-08-09 19:02:42 +03:00
|
|
|
|
auto progressIntervalTime = duration_nanoseconds / progressBarTotalCount;
|
|
|
|
|
|
size_t newProgress = execTime / progressIntervalTime - progressCnt;
|
|
|
|
|
|
progressBar.addProgress(newProgress);
|
|
|
|
|
|
progressCnt += newProgress;
|
2018-11-23 16:19:43 +03:00
|
|
|
|
}
|
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.waitAll();
|
|
|
|
|
|
|
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
|
|
|
|
LatencyMetrics generalLatency(inferRequestsQueue.getLatencies());
|
|
|
|
|
|
std::vector<LatencyMetrics> groupLatencies = {};
|
|
|
|
|
|
if (FLAGS_pcseq && app_inputs_info.size() > 1) {
|
|
|
|
|
|
for (auto lats : inferRequestsQueue.getLatencyGroups()) {
|
|
|
|
|
|
groupLatencies.push_back(LatencyMetrics(lats));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2019-10-04 19:26:43 +03:00
|
|
|
|
double totalDuration = inferRequestsQueue.getDurationInMilliseconds();
|
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 fps = (FLAGS_api == "sync") ? batchSize * 1000.0 / generalLatency.percentile(FLAGS_latency_percentile)
|
|
|
|
|
|
: 1000.0 * processedFramesN / totalDuration;
|
2019-10-04 19:26:43 +03:00
|
|
|
|
|
|
|
|
|
|
if (statistics) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{"total execution time (ms)", double_to_string(totalDuration)},
|
|
|
|
|
|
{"total number of iterations", std::to_string(iteration)},
|
|
|
|
|
|
});
|
2019-10-04 19:26:43 +03:00
|
|
|
|
if (device_name.find("MULTI") == std::string::npos) {
|
2021-07-23 10:29:55 +03:00
|
|
|
|
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)";
|
2021-07-23 10:29:55 +03:00
|
|
|
|
} else {
|
|
|
|
|
|
latency_label = "latency (" + std::to_string(FLAGS_latency_percentile) + " percentile) (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
|
|
|
|
statistics->addParameters(
|
|
|
|
|
|
StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{latency_label, double_to_string(generalLatency.percentile(FLAGS_latency_percentile))},
|
|
|
|
|
|
});
|
|
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{"Average latency (ms)", double_to_string(generalLatency.average())},
|
|
|
|
|
|
});
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
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
|
|
|
|
{"Min latency (ms)", double_to_string(generalLatency.min())},
|
2021-08-11 14:47:29 +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
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{"Max latency (ms)", double_to_string(generalLatency.max())},
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
if (FLAGS_pcseq && app_inputs_info.size() > 1) {
|
|
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{"Latency for each data shape group:", ""},
|
|
|
|
|
|
});
|
|
|
|
|
|
for (size_t i = 0; i < app_inputs_info.size(); ++i) {
|
|
|
|
|
|
std::string data_shapes_string = "";
|
|
|
|
|
|
data_shapes_string += std::to_string(i + 1) + ". ";
|
|
|
|
|
|
for (auto& item : app_inputs_info[i]) {
|
|
|
|
|
|
data_shapes_string += item.first + " : " + getShapeString(item.second.dataShape) + " ";
|
|
|
|
|
|
}
|
|
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{data_shapes_string, ""},
|
|
|
|
|
|
});
|
|
|
|
|
|
statistics->addParameters(
|
|
|
|
|
|
StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{latency_label,
|
|
|
|
|
|
double_to_string(groupLatencies[i].percentile(FLAGS_latency_percentile))},
|
|
|
|
|
|
});
|
|
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{"Average (ms)", double_to_string(groupLatencies[i].average())},
|
|
|
|
|
|
});
|
|
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{"Min (ms)", double_to_string(groupLatencies[i].min())},
|
|
|
|
|
|
});
|
|
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{"Max (ms)", double_to_string(groupLatencies[i].max())},
|
|
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2018-11-23 16:19:43 +03:00
|
|
|
|
}
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{{"throughput", double_to_string(fps)}});
|
2019-04-12 18:25:53 +03:00
|
|
|
|
}
|
2019-08-09 19:02:42 +03:00
|
|
|
|
progressBar.finish();
|
|
|
|
|
|
|
2021-04-22 14:02:54 +03:00
|
|
|
|
// ----------------- 11. Dumping statistics report
|
|
|
|
|
|
// -------------------------------------------------------------
|
2019-08-09 19:02:42 +03:00
|
|
|
|
next_step();
|
2018-11-23 16:19:43 +03:00
|
|
|
|
|
2020-04-15 19:01:57 +03:00
|
|
|
|
#ifdef USE_OPENCV
|
|
|
|
|
|
if (!FLAGS_dump_config.empty()) {
|
|
|
|
|
|
dump_config(FLAGS_dump_config, config);
|
|
|
|
|
|
slog::info << "Inference Engine configuration settings were dumped to " << FLAGS_dump_config << slog::endl;
|
|
|
|
|
|
}
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
2019-04-12 18:25:53 +03:00
|
|
|
|
if (!FLAGS_exec_graph_path.empty()) {
|
2019-08-09 19:02:42 +03:00
|
|
|
|
try {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
std::string fileName = fileNameNoExt(FLAGS_exec_graph_path);
|
|
|
|
|
|
ov::pass::Serialize serializer(fileName + ".xml", fileName + ".bin");
|
|
|
|
|
|
serializer.run_on_model(std::const_pointer_cast<ov::Model>(compiledModel.get_runtime_model()));
|
2019-08-09 19:02:42 +03:00
|
|
|
|
slog::info << "executable graph is stored to " << FLAGS_exec_graph_path << slog::endl;
|
2021-04-22 14:02:54 +03:00
|
|
|
|
} 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) {
|
2021-12-30 19:09:12 +03:00
|
|
|
|
std::vector<std::vector<ov::runtime::ProfilingInfo>> perfCounts;
|
2019-08-09 19:02:42 +03:00
|
|
|
|
for (size_t ireq = 0; ireq < nireq; ireq++) {
|
2019-10-04 19:26:43 +03:00
|
|
|
|
auto reqPerfCounts = inferRequestsQueue.requests[ireq]->getPerformanceCounts();
|
|
|
|
|
|
if (FLAGS_pc) {
|
2021-02-16 13:08:54 +09:00
|
|
|
|
slog::info << "Performance counts for " << ireq << "-th infer request:" << slog::endl;
|
2021-12-30 19:09:12 +03:00
|
|
|
|
printPerformanceCounts(reqPerfCounts, std::cout, getFullDeviceName(core, FLAGS_d), false);
|
2019-10-04 19:26:43 +03:00
|
|
|
|
}
|
|
|
|
|
|
perfCounts.push_back(reqPerfCounts);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (statistics) {
|
|
|
|
|
|
statistics->dumpPerformanceCounters(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
|
|
|
|
|
|
slog::info << "Count: " << iteration << " iterations" << slog::endl;
|
|
|
|
|
|
slog::info << "Duration: " << double_to_string(totalDuration) << " ms" << slog::endl;
|
2021-07-23 10:29:55 +03:00
|
|
|
|
if (device_name.find("MULTI") == std::string::npos) {
|
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 << "Latency: " << slog::endl;
|
|
|
|
|
|
generalLatency.logTotal(FLAGS_latency_percentile);
|
|
|
|
|
|
|
|
|
|
|
|
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;
|
2021-12-30 19:09:12 +03:00
|
|
|
|
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 << " : " << getShapeString(item.second.dataShape);
|
|
|
|
|
|
}
|
|
|
|
|
|
slog::info << slog::endl;
|
|
|
|
|
|
|
|
|
|
|
|
groupLatencies[i].logTotal(FLAGS_latency_percentile);
|
|
|
|
|
|
}
|
2021-07-23 10:29:55 +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
|
|
|
|
slog::info << "Throughput: " << double_to_string(fps) << " FPS" << slog::endl;
|
|
|
|
|
|
|
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) {
|
2021-08-11 14:47:29 +03:00
|
|
|
|
statistics->addParameters(StatisticsReport::Category::EXECUTION_RESULTS,
|
|
|
|
|
|
{
|
|
|
|
|
|
{"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;
|
|
|
|
|
|
}
|