From a34e9ed64adeb7b9f3b3809390e33f1ee87a2080 Mon Sep 17 00:00:00 2001 From: Aurick Qiao Date: Wed, 25 Mar 2026 19:59:05 -0700 Subject: [PATCH] Add adjusted_filter_batch (#21260) --- python/sglang/srt/sampling/sampling_batch_info.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/python/sglang/srt/sampling/sampling_batch_info.py b/python/sglang/srt/sampling/sampling_batch_info.py index a8f17c754..914dde0f6 100644 --- a/python/sglang/srt/sampling/sampling_batch_info.py +++ b/python/sglang/srt/sampling/sampling_batch_info.py @@ -191,6 +191,12 @@ class SamplingBatchInfo: def adjusted_merge_batch(self, other: "SamplingBatchInfo"): pass + # placeholder for override + def adjusted_filter_batch( + self, keep_indices: List[int], keep_indices_device: torch.Tensor + ): + pass + def __len__(self): return len(self.temperatures) @@ -267,6 +273,8 @@ class SamplingBatchInfo: if self.logit_bias is not None: self.logit_bias = self.logit_bias[keep_indices_device] + self.adjusted_filter_batch(keep_indices, keep_indices_device) + def _filter_batch_custom_logit_processor( self, keep_indices: List[int], keep_indices_device: torch.Tensor ):