Skip to content

Commit

Permalink
Drop request if it's aborted by streamer
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Oct 13, 2024
1 parent 03965d6 commit 784c331
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cpp/src/continuous_batching_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ ContinuousBatchingPipeline::ContinuousBatchingImpl::generate(const std::vector<o
streamer_ptr->end();
}

if (!continue_generation && !m_requests.empty()) {
SequenceGroup::Ptr request = m_requests[0];
for (const auto& sequence: request->get_sequences()) {
if (m_scheduler->has_block_table(sequence->get_id())) {
m_scheduler->free_sequence(sequence->get_id());
}
}
m_sampler->clear_beam_search_info(request->get_request_id());
}

for (size_t generation_idx = 0; generation_idx < generations.size(); ++generation_idx) {
const auto& generation = generations[generation_idx];
EncodedGenerationResult result;
Expand Down

0 comments on commit 784c331

Please sign in to comment.