[Fix] Reset output_ids for requests with input_embeds during retraction (#14110)
This commit is contained in:
@@ -1121,6 +1121,14 @@ class Req(ReqDllmMixin):
|
||||
self.extend_batch_idx = 0
|
||||
self.decode_batch_idx = 0
|
||||
|
||||
# When using input_embeds, we cannot easily mix the original input embeddings
|
||||
# with the newly generated output token IDs during re-prefill of retracted request.
|
||||
# output_ids will have no use, but will lead to wrong size cache indexes.
|
||||
# Therefore, we discard the generated output_ids and restart prefill and generation
|
||||
# to ensure shape consistency in KV cache.
|
||||
if self.input_embeds is not None:
|
||||
self.output_ids = []
|
||||
|
||||
def offload_kv_cache(self, req_to_token_pool, token_to_kv_pool_allocator):
|
||||
token_indices = req_to_token_pool.req_to_token[
|
||||
self.req_pool_idx, : self.seqlen - 1
|
||||
|
||||
Reference in New Issue
Block a user