Skip to content

Commit 5653931

Browse files
liusy58Johnsonms
authored andcommitted
Skip mm feature pool init to avoid EPD OOM (sgl-project#16388)
1 parent fa5f8c7 commit 5653931

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

python/sglang/srt/disaggregation/encode_receiver.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,11 @@ def __init__(
303303
else:
304304
raise e
305305
self.mm_processor = get_mm_processor(
306-
hf_config, server_args, _processor, transport_mode
306+
hf_config,
307+
server_args,
308+
_processor,
309+
transport_mode,
310+
skip_mm_pool=True,
307311
)
308312

309313
def create_req(self, recv_req):

python/sglang/srt/managers/multimodal_processor.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,13 @@ def import_processors(package_name: str, overwrite: bool = False):
4141

4242

4343
def get_mm_processor(
44-
hf_config, server_args: ServerArgs, processor, transport_mode
44+
hf_config, server_args: ServerArgs, processor, transport_mode, **kwargs
4545
) -> BaseMultimodalProcessor:
4646
for model_cls, processor_cls in PROCESSOR_MAPPING.items():
4747
if model_cls.__name__ in hf_config.architectures:
48-
return processor_cls(hf_config, server_args, processor, transport_mode)
48+
return processor_cls(
49+
hf_config, server_args, processor, transport_mode, **kwargs
50+
)
4951

5052
raise ValueError(
5153
f"No processor registered for architecture: {hf_config.architectures}.\n"

python/sglang/srt/multimodal/processors/base_processor.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ def __init__(
234234
"input_features",
235235
]
236236

237-
if SGL_USE_CUDA_IPC:
237+
skip_mm_pool = kwargs.get("skip_mm_pool", False)
238+
239+
if SGL_USE_CUDA_IPC and not skip_mm_pool:
238240
self.cudaipc_mmfeature_pool = MmItemMemoryPool(
239241
MM_FEATURE_CACHE_SIZE,
240242
MM_ITEM_MEMORY_POOL_RECYCLE_INTERVAL,

0 commit comments

Comments
 (0)