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

auto setting for max prefetch #1937

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

borg323
Copy link
Member

@borg323 borg323 commented Dec 30, 2023

This is the next in the auto-configure series, dealing with max-prefetch, 0 for cpu backends and 32 otherwise. It also removes the params_override.h mechanism as it isn't used any more.

@@ -240,6 +240,10 @@ class SearchWorker {
max_out_of_order_ =
std::max(1, static_cast<int>(params_.GetMaxOutOfOrderEvalsFactor() *
target_minibatch_size_));
max_prefetch_batch_ = params.GetMaxPrefetchBatch();
if (max_prefetch_batch_ < 0) {
max_prefetch_batch_ = search_->network_->IsCpu() ? 0 : 32;
Copy link
Member

Choose a reason for hiding this comment

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

Would it be possible to also make sure that max_prefetch_batch_ + target_minibatch_size_ is <= GetBatchSize() returned by backends?

(also, maybe rename backend's function GetBatchSize() to something more strictly sounding? Like "GetBatchSizeLimit()orGetMaxSupportedBatchSize()`?)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think max prefetch should never exceed the requested batch size. I'll think about it.

Regarding the function naming, I plan a final revision of the API after all planned functionality is in (currently missing a backend max batch setting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants