vlm: support SGLANG_MM_SKIP_COMPUTE_HASH for bypassing multimodal feature hashing (#16555)

This commit is contained in:
siyu
2026-01-08 11:10:00 +08:00
committed by GitHub
parent 5a5cece561
commit 6b3f93c4dd
2 changed files with 8 additions and 0 deletions

View File

@@ -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)

View File

@@ -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