From 17460a833f92137671cdd59dba16210294111e91 Mon Sep 17 00:00:00 2001 From: cmcamdy <1027740945@qq.com> Date: Fri, 12 Dec 2025 02:52:16 +0000 Subject: [PATCH] fix mtp multi batch --- fastdeploy/worker/xpu_model_runner.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fastdeploy/worker/xpu_model_runner.py b/fastdeploy/worker/xpu_model_runner.py index 79ca6048f7c..c03e7f3b3d5 100644 --- a/fastdeploy/worker/xpu_model_runner.py +++ b/fastdeploy/worker/xpu_model_runner.py @@ -1393,6 +1393,9 @@ def update_share_input_block_num(self, num_gpu_blocks: int) -> None: # Reset block table and kv cache with global block num self.initialize_kv_cache() + if self.speculative_method in ["mtp"]: + self.proposer.initialize_kv_cache(main_model_num_blocks=self.num_gpu_blocks) + # Reset free list free_list = list( range(