From 3c3d6255d92685f10ae959705104436cd1939d2f Mon Sep 17 00:00:00 2001 From: Hank Han <54751605+HanHan009527@users.noreply.github.com> Date: Sat, 4 Oct 2025 04:39:59 +0800 Subject: [PATCH] [fix]missing prefix_lens_cpu init when p/d disaggregation (#11196) --- python/sglang/srt/disaggregation/decode.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/sglang/srt/disaggregation/decode.py b/python/sglang/srt/disaggregation/decode.py index de26d351f..a0b6de7f4 100644 --- a/python/sglang/srt/disaggregation/decode.py +++ b/python/sglang/srt/disaggregation/decode.py @@ -523,11 +523,19 @@ class DecodePreallocQueue: dtype=torch.int64, device=self.token_to_kv_pool_allocator.device, ), + prefix_lens_cpu=torch.tensor( + [0], + dtype=torch.int64, + ), seq_lens=torch.tensor( [num_tokens], dtype=torch.int64, device=self.token_to_kv_pool_allocator.device, ), + seq_lens_cpu=torch.tensor( + [num_tokens], + dtype=torch.int64, + ), last_loc=torch.tensor( [-1], dtype=torch.int64,