Skip to content

Commit

Permalink
[Serving][Fix] Fix chunked prefill condition (#2082)
Browse files Browse the repository at this point in the history
This PR fixes a bug when trying to chunk an input and do prefill.
The stats prior ot this PR was wrong.
  • Loading branch information
MasterJH5574 authored Apr 5, 2024
1 parent 41da87a commit 791623a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cpp/serve/engine_actions/new_request_prefill.cc
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ class NewRequestPrefillActionObj : public EngineActionObj {
std::min(input_length, kv_cache_config_->prefill_chunk_size - total_input_length);
num_require_pages =
(input_length + kv_cache_config_->page_size - 1) / kv_cache_config_->page_size;
total_input_length += input_length;
total_required_pages += num_require_pages;
if (input_length > 0 &&
CanPrefill(estate, num_prefill_rsentries + 1 + rsentry->child_indices.size(),
total_input_length, total_required_pages, num_available_pages,
Expand Down

0 comments on commit 791623a

Please sign in to comment.