From 6cc3cb4bcff7a5bcab228625c683fe9bda3fc6be Mon Sep 17 00:00:00 2001 From: cmcamdy <1027740945@qq.com> Date: Fri, 12 Dec 2025 14:11:20 +0800 Subject: [PATCH] fix mtp multi batch (#5521) --- 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 79ca6048f..c03e7f3b3 100644 --- a/fastdeploy/worker/xpu_model_runner.py +++ b/fastdeploy/worker/xpu_model_runner.py @@ -1393,6 +1393,9 @@ class XPUModelRunner(ModelRunnerBase): # 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(