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

LLM / CB: simplify condition #1592

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

Conversation

ilya-lavrenov
Copy link
Contributor

sg->has_finished() already assumes that request can be OOM or it's handle can be dropped

size_t num_finished_seqs() const {
return std::count_if(m_sequences.begin(), m_sequences.end(), [this] (Sequence::CPtr seq) {
return seq->has_finished() || seq->out_of_memory() || handle_dropped();
});
}
size_t num_running_seqs() const {
return num_total_seqs() - num_finished_seqs();
}
bool has_finished() const {
return num_running_seqs() == 0;
}

@ilya-lavrenov ilya-lavrenov added this to the 2025.1 milestone Jan 18, 2025
@github-actions github-actions bot added the category: LLM LLM pipeline (stateful, static) label Jan 18, 2025
@github-actions github-actions bot added the category: continuous batching Continuous batching label Jan 18, 2025
@ilya-lavrenov ilya-lavrenov changed the title LLM: simplify condition LLM / CB: simplify condition Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: continuous batching Continuous batching category: LLM LLM pipeline (stateful, static)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants