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

Add parameter to execute inference requests at a fixed frequency #26820

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

boonsino
Copy link

@boonsino boonsino commented Sep 27, 2024

Details:

  • Add parameter to execute inference requests at a fixed frequency

Tickets:

  • ticket-id

@github-actions github-actions bot added the category: samples OpenVINO Runtime Samples label Sep 27, 2024
@sys-openvino-ci sys-openvino-ci added the ExternalIntelPR External contributor from Intel label Sep 27, 2024
@boonsino boonsino marked this pull request as ready for review September 27, 2024 06:39
@boonsino boonsino requested review from a team as code owners September 27, 2024 06:39
@boonsino boonsino requested review from ilya-lavrenov and removed request for a team September 27, 2024 06:39
@@ -65,6 +65,11 @@ static const char cache_dir_message[] = "Optional. Enables caching of loaded mod
static const char load_from_file_message[] = "Optional. Loads model from file directly without read_model."
" All CNNNetwork options (like re-shape) will be ignored";

/// @brief message for run frequency
static const char run_frequency_message[] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in serving it's typically named "requests rate"

/// @brief message for run frequency
static const char run_frequency_message[] =
"Execute at a fixed frequency. Note if the targeted rate per second cannot be reached, "
"the benchmark would start the next run immediately, trying its best to catch up.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Every iteration of the main loop starts with inferRequest = inferRequestsQueue.get_idle_request(); which blocks. That means the benchmark would not start the next run immediately.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, keep C++ and Python implementations aligned

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -307,6 +312,9 @@ DEFINE_string(api, "async", api_message);
/// @brief Number of infer requests in parallel
DEFINE_uint64(nireq, 0, infer_requests_count_message);

/// @brief Execute infer requests at a fixed frequency
DEFINE_double(rfreq, 0, run_frequency_message);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default could be infinity. That way you don't need to handle 0 separately.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If set to INFINITY, then the function if (FLAGS_rfreq > 0) will still get executed which is redundant right? Having default as 0 would simply skip that and runs without delay. What do you think?

Copy link
Contributor

@Wovchena Wovchena Oct 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know for sure. You should try. I'd expect sleep_for to have the similar logic inside: if <=0 then return.

samples/cpp/benchmark_app/main.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nkogteva, what were your reasons against limiting infer requests rate introduction?

@Wovchena
Copy link
Contributor

build_jenkins

@boonsino boonsino requested review from a team as code owners October 30, 2024 06:13
@boonsino boonsino requested review from tsavina and removed request for a team October 30, 2024 06:13
@github-actions github-actions bot added category: docs OpenVINO documentation category: tools OpenVINO C++ / Python tools labels Oct 30, 2024
@boonsino boonsino force-pushed the add-benchmark-test-fps-arg branch 2 times, most recently from fa49ebc to 91982ac Compare October 30, 2024 08:26
@boonsino boonsino requested a review from a team as a code owner October 30, 2024 08:26
Signed-off-by: Maciej Falkowski <maciej.falkowski@intel.com>
Signed-off-by: Ooi, Boon Sin <boon.sin.ooi@intel.com>
Signed-off-by: Ooi, Boon Sin <boon.sin.ooi@intel.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: docs OpenVINO documentation category: samples OpenVINO Runtime Samples category: tools OpenVINO C++ / Python tools ExternalIntelPR External contributor from Intel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants