Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
olpipi committed Dec 3, 2024
1 parent bba9f93 commit e82d3ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cpp/src/model_runner.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class ModelRunner {
size_t group_position_id = sequence_group->get_num_processed_tokens();
size_t prompt_len = sequence_group->get_prompt_len();
size_t seq_len_after_gather = 0;
bool echo_output = sequence_group->get_sampling_parameters().echo;

// spec: In case of multiple input tokens for current sequence (prompt_len > 1),
// context_len corresponds to first token within subgroup of scheduled tokens
Expand All @@ -146,7 +147,7 @@ class ModelRunner {
sequence->get_generated_ids()[position_id - sequence_group->get_prompt_len()];

if (matmul_gathering_is_required) {
if (group_position_id + token_id >= prompt_len - 1) {
if (group_position_id + token_id >= prompt_len - 1 || echo_output) {
gather_indice_values.push_back(gathering_current_index);
seq_len_after_gather++;
}
Expand Down

0 comments on commit e82d3ce

Please sign in to comment.