Skip to content

Commit

Permalink
[Fix] Fix the chunked prefill condition (#2628)
Browse files Browse the repository at this point in the history
This PR fixes a bug of the prefill chunking which may cause the
running batch size exceeding the maximum allowed batch size.
  • Loading branch information
MasterJH5574 committed Jul 5, 2024
1 parent 5b63980 commit ebf5617
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cpp/serve/engine_actions/batch_prefill_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ BatchPrefillBaseActionObj::GetRequestStateEntriesToPrefill(EngineState estate) {

total_input_length += input_length;
total_required_pages += num_require_pages;
if (CanPrefill(estate, num_prefill_rsentries, total_input_length, total_required_pages,
if (CanPrefill(estate, num_prefill_rsentries + 1, total_input_length, total_required_pages,
num_available_pages, current_total_seq_len, num_running_rsentries,
kv_state_kind, sliding_window_enabled)) {
prefill_inputs.push_back({rsentry, input_length, 0, /*is_decode=*/false});
Expand Down

0 comments on commit ebf5617

Please sign in to comment.