Skip to content

Commit

Permalink
[benchmark] Do not check nireq if sync and time is specified
Browse files Browse the repository at this point in the history
  • Loading branch information
valir committed Dec 18, 2024
1 parent 9ff5942 commit 3856693
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 6 additions & 3 deletions samples/cpp/benchmark_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ bool parse_and_check_command_line(int argc, char* argv[]) {
if (FLAGS_api != "async" && FLAGS_api != "sync") {
throw std::logic_error("Incorrect API. Please set -api option to `sync` or `async` value.");
}
if (FLAGS_api == "sync" && FLAGS_nireq > FLAGS_niter) {
throw std::logic_error(
"Number of iterations should be greater than number of infer requests when using sync API.");
if (FLAGS_api == "sync") {
if (FLAGS_t == 0)
&&(FLAGS_nireq > FLAGS_niter) {
throw std::logic_error(
"Number of iterations should be greater than number of infer requests when using sync API.");
}
}
if (!FLAGS_hint.empty() && FLAGS_hint != "throughput" && FLAGS_hint != "tput" && FLAGS_hint != "latency" &&
FLAGS_hint != "cumulative_throughput" && FLAGS_hint != "ctput" && FLAGS_hint != "none") {
Expand Down
5 changes: 3 additions & 2 deletions tools/benchmark_tool/openvino/tools/benchmark/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,9 @@ 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.")

if args.api_type == "sync" and args.number_infer_requests > args.number_iterations:
raise Exception("Number of infer requests should be less than or equal to number of iterations in sync mode.")
if args.api_type == "sync":
if args.time == 0 and (args.number_infer_requests > args.number_iterations):
raise Exception("Number of infer requests should be less than or equal to number of iterations in sync mode.")

return args, is_network_compiled

Expand Down

0 comments on commit 3856693

Please sign in to comment.