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

[benchmark] Do not check nireq if sync and time is specified #28134

Merged
merged 1 commit into from
Jan 8, 2025
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
8 changes: 5 additions & 3 deletions samples/cpp/benchmark_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ 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
Loading