diff --git a/fastdeploy/output/token_processor.py b/fastdeploy/output/token_processor.py index 764028419d3..406252fd445 100644 --- a/fastdeploy/output/token_processor.py +++ b/fastdeploy/output/token_processor.py @@ -750,7 +750,9 @@ def _process_batch_output(self): and self.cfg.cache_config.enable_prefix_caching and self.cfg.cache_config.enable_output_caching ): - if (task.num_total_tokens - 1) % self.cfg.cache_config.block_size == 0: + if (task.num_total_tokens - 1) % self.cfg.cache_config.block_size == 0 and ( + task_id not in self.resource_manager.to_be_rescheduled_request_id_set + ): self.resource_manager.cache_output_tokens( task ) # when enable prefix caching, cache kv cache for output tokens