vlm: support SGLANG_MM_SKIP_COMPUTE_HASH for bypassing multimodal feature hashing (#16555)
This commit is contained in:
@@ -377,6 +377,8 @@ class Envs:
|
|||||||
SGLANG_MM_BUFFER_SIZE_MB = EnvInt(0)
|
SGLANG_MM_BUFFER_SIZE_MB = EnvInt(0)
|
||||||
SGLANG_MM_PRECOMPUTE_HASH = EnvBool(False)
|
SGLANG_MM_PRECOMPUTE_HASH = EnvBool(False)
|
||||||
SGLANG_VIT_ENABLE_CUDA_GRAPH = EnvBool(False)
|
SGLANG_VIT_ENABLE_CUDA_GRAPH = EnvBool(False)
|
||||||
|
SGLANG_MM_SKIP_COMPUTE_HASH = EnvBool(False)
|
||||||
|
|
||||||
|
|
||||||
# VLM Item CUDA IPC Transport
|
# VLM Item CUDA IPC Transport
|
||||||
SGLANG_USE_CUDA_IPC_TRANSPORT = EnvBool(False)
|
SGLANG_USE_CUDA_IPC_TRANSPORT = EnvBool(False)
|
||||||
|
|||||||
@@ -258,6 +258,12 @@ class MultimodalDataItem:
|
|||||||
|
|
||||||
from sglang.srt.managers.mm_utils import hash_feature
|
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.hash is None:
|
||||||
if self.feature is not None:
|
if self.feature is not None:
|
||||||
hashed_feature = self.feature
|
hashed_feature = self.feature
|
||||||
|
|||||||
Reference in New Issue
Block a user