[sglang] fix mm token padded value overlap with text token id (#17781)

This commit is contained in:
Bi Xue
2026-01-30 17:09:13 -08:00
committed by GitHub
parent e86476acfc
commit 5d00150e99
2 changed files with 25 additions and 2 deletions
@@ -106,6 +106,7 @@ from sglang.srt.layers.sampler import create_sampler
from sglang.srt.layers.torchao_utils import apply_torchao_config_to_model
from sglang.srt.lora.lora_manager import LoRAManager
from sglang.srt.lora.lora_registry import LoRARef
from sglang.srt.managers.schedule_batch import sanity_check_mm_pad_shift_value
from sglang.srt.mem_cache.allocator import BaseTokenToKVPoolAllocator
from sglang.srt.mem_cache.memory_pool import ReqToTokenPool
from sglang.srt.model_executor.cpu_graph_runner import CPUGraphRunner
@@ -390,6 +391,9 @@ class ModelRunner(ModelRunnerKVCacheMixin):
self.initialize(min_per_gpu_memory)
self.check_quantized_moe_compatibility()
if self.is_multimodal:
sanity_check_mm_pad_shift_value(self.model_config.vocab_size)
# Temporary cached values
self.support_pp = (
"pp_proxy_tensors" in inspect.signature(self.model.forward).parameters