Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[BENCHMARK_APP] Show input command in output (#13402)" #14027

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 0 additions & 38 deletions samples/cpp/benchmark_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,41 +28,10 @@
#include "remote_tensors_filling.hpp"
#include "statistics_report.hpp"
#include "utils.hpp"

#if defined(_WIN32) || defined(WIN32)
# include <windows.h>
#endif
// clang-format on

static const size_t progressBarDefaultTotalCount = 1000;

std::string get_console_command(int argc, char* argv[]) {
std::stringstream args_command;

#if defined(_WIN32) || defined(WIN32)
std::string relative_path(argv[0]);
std::vector<char> buffer;

uint32_t len = 1;
do {
buffer.resize(len);
len = GetFullPathNameA(relative_path.data(), len, buffer.data(), nullptr);
} while (len > buffer.size());

std::string full_path(buffer.begin(), buffer.end());
args_command << full_path;
#else
args_command << realpath(argv[0], nullptr);
#endif
args_command << " ";

for (int i = 1; i < argc; i++) {
args_command << argv[i] << " ";
}

return args_command.str();
}

bool parse_and_check_command_line(int argc, char* argv[]) {
// ---------------------------Parsing and validating input
// arguments--------------------------------------
Expand Down Expand Up @@ -197,19 +166,12 @@ int main(int argc, char* argv[]) {

// ----------------- 1. Parsing and validating input arguments
// -------------------------------------------------

// Must be executed before parse_and_check_command_line()
// gflags::ParseCommandLineNonHelpFlags() modifies the argv array
auto command_from_args = get_console_command(argc, argv);

next_step();

if (!parse_and_check_command_line(argc, argv)) {
return 0;
}

slog::info << "Input command: " << command_from_args << slog::endl;

bool isNetworkCompiled = fileExt(FLAGS_m) == "blob";
if (isNetworkCompiled) {
slog::info << "Model is compiled" << slog::endl;
Expand Down
13 changes: 4 additions & 9 deletions tools/benchmark_tool/openvino/tools/benchmark/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def arg_not_empty(arg_value,empty_value):
raise Exception("-nstreams, -nthreads and -pin options are fine tune options. To use them you " \
"should explicitely set -hint option to none. This is not OpenVINO limitation " \
"(those options can be used in OpenVINO together), but a benchmark_app UI rule.")

if args.report_type == "average_counters" and "MULTI" in args.target_device:
raise Exception("only detailed_counters report type is supported for MULTI device")

_, ext = os.path.splitext(args.path_to_model)
is_network_compiled = True if ext == BLOB_EXTENSION else False
is_precisiton_set = not (args.input_precision == "" and args.output_precision == "" and args.input_output_precision == "")
Expand All @@ -48,21 +48,16 @@ def arg_not_empty(arg_value,empty_value):
raise Exception("Cannot set precision for a compiled model. " \
"Please re-compile your model with required precision " \
"using compile_tool")

return args, is_network_compiled

def main():
statistics = None
try:
# ------------------------------ 1. Parsing and validating input arguments ------------------------------
args_string = f"{os.path.realpath(sys.argv[0])} "
for i in range(1,len(sys.argv)):
args_string += f"{sys.argv[i]} "

next_step()
logger.info("Parsing input parameters")
args, is_network_compiled = parse_and_check_command_line()
logger.info(f"Input command: {args_string}")

command_line_arguments = get_command_line_arguments(sys.argv)
if args.report_type:
Expand Down Expand Up @@ -509,7 +504,7 @@ def set_throughput_streams():
total_sorted_list = print_perf_counters_sort(perfs_count_list,sort_flag=args.perf_counts_sort)
if statistics:
statistics.dump_performance_counters_sorted(total_sorted_list)

elif args.perf_counts:
print_perf_counters(perfs_count_list)

Expand Down