From 8f2a4e70f824d1dfec90a784dfde5ac6f3e58b9e Mon Sep 17 00:00:00 2001 From: Mick Date: Tue, 26 May 2026 08:58:32 +0800 Subject: [PATCH] [SRT] minor: reuse req input id array for unpadded ids (#26232) --- python/sglang/srt/managers/schedule_batch.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/python/sglang/srt/managers/schedule_batch.py b/python/sglang/srt/managers/schedule_batch.py index ce81a8cad..cda0d4513 100755 --- a/python/sglang/srt/managers/schedule_batch.py +++ b/python/sglang/srt/managers/schedule_batch.py @@ -690,10 +690,12 @@ class Req(ReqDllmMixin): ): # Input and output info self.rid = rid - self.origin_input_ids_unpadded = array( - "q", origin_input_ids_unpadded or origin_input_ids - ) # Before image padding self.origin_input_ids = array("q", origin_input_ids) + self.origin_input_ids_unpadded = ( + array("q", origin_input_ids_unpadded) + if origin_input_ids_unpadded + else self.origin_input_ids + ) # Before image padding # Each decode stage's output ids self.output_ids = array("q") # fill_ids = origin_input_ids + output_ids. Updated if chunked.