Skip to content

Commit

Permalink
clear incoming buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
lzhangzz committed Nov 6, 2023
1 parent bd6b89c commit 8c8d8bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/turbomind/models/llama/LlamaBatch.cc
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,10 @@ bool LlamaBatch<T>::Initialize()
static_assert(sizeof(uintptr_t) == sizeof(void*));
}

// clear incoming buffer
std::fill(incoming_->requests.begin(), incoming_->requests.end(), nullptr);
std::fill(incoming_->sequences.begin(), incoming_->sequences.end(), nullptr);

// in case of swap-in/swap-out or there are holes in active buffer, layout of the buffers is changed
// generation & sampling need to be re-initialized for correctness
return exchange || active_holes;
Expand Down

0 comments on commit 8c8d8bf

Please sign in to comment.