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

Throw exception when request period larger than max tokens rather than infinite loop #403

Merged
merged 2 commits into from
Sep 29, 2023
Merged
Changes from 1 commit
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: 8 additions & 0 deletions src/c++/perf_analyzer/periodic_concurrency_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,14 @@ PeriodicConcurrencyWorker::WorkerCallback(uint32_t infer_context_id)
period_completed_callback_();
}
if (ctxs_.at(infer_context_id)->HasReceivedFinalResponse()) {
bool has_not_completed_period{
ctxs_.at(infer_context_id)->GetNumResponsesForCurrentRequest() <
request_period_};
if (has_not_completed_period) {
throw std::runtime_error(
"Request received final response before request period was reached. "
"Request period parameter must be less than or equal to max tokens.");
matthewkotila marked this conversation as resolved.
Show resolved Hide resolved
}
request_completed_callback_();
}
}
Expand Down
Loading