From 6b3f93c4dd15606d886696ab9327c7395283f80a Mon Sep 17 00:00:00 2001 From: siyu Date: Thu, 8 Jan 2026 11:10:00 +0800 Subject: [PATCH] vlm: support SGLANG_MM_SKIP_COMPUTE_HASH for bypassing multimodal feature hashing (#16555) --- python/sglang/srt/environ.py | 2 ++ python/sglang/srt/managers/schedule_batch.py | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/python/sglang/srt/environ.py b/python/sglang/srt/environ.py index e757f9d93..445035643 100644 --- a/python/sglang/srt/environ.py +++ b/python/sglang/srt/environ.py @@ -377,6 +377,8 @@ class Envs: SGLANG_MM_BUFFER_SIZE_MB = EnvInt(0) SGLANG_MM_PRECOMPUTE_HASH = EnvBool(False) SGLANG_VIT_ENABLE_CUDA_GRAPH = EnvBool(False) + SGLANG_MM_SKIP_COMPUTE_HASH = EnvBool(False) + # VLM Item CUDA IPC Transport SGLANG_USE_CUDA_IPC_TRANSPORT = EnvBool(False) diff --git a/python/sglang/srt/managers/schedule_batch.py b/python/sglang/srt/managers/schedule_batch.py index 3513bd02e..d7037b3ed 100644 --- a/python/sglang/srt/managers/schedule_batch.py +++ b/python/sglang/srt/managers/schedule_batch.py @@ -258,6 +258,12 @@ class MultimodalDataItem: from sglang.srt.managers.mm_utils import hash_feature + if envs.SGLANG_MM_SKIP_COMPUTE_HASH.get(): + import uuid + + self.hash = uuid.uuid4().int + self.pad_value = self.hash % (1 << 30) + return if self.hash is None: if self.feature is not None: hashed_feature = self.feature