Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions python/sglang/srt/models/minimax_m3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1612,10 +1612,12 @@ def shared_experts_fusion_disable_reason(cls, hf_config, quant_config):
"Shared and routed experts may use different quantization formats "
"in ModelOpt mixed-precision checkpoints."
)
if not _is_cuda:
return "Shared experts fusion currently requires CUDA devices."
if not (_is_cuda or _is_hip):
return "Shared experts fusion currently requires CUDA or ROCm devices."
if _is_cuda and (_device_sm is not None) and (_device_sm < 80):
return "Shared experts fusion requires SM80 or newer GPUs."
if _is_hip and not _is_gfx95_supported:
return "Shared experts fusion on ROCm is validated on gfx950 only."
if get_parallel().moe_ep_size > 1:
return "Shared experts fusion is not supported together with expert parallelism yet."
if get_moe_a2a_backend().is_deepep():
Expand Down
19 changes: 15 additions & 4 deletions python/sglang/srt/models/minimax_m3_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,22 @@
)
from sglang.srt.models.utils import WeightsMapper
from sglang.srt.runtime_context import get_mm, get_parallel
from sglang.srt.utils import add_prefix, get_device_sm, is_cuda, log_info_on_rank0
from sglang.srt.utils import (
add_prefix,
get_device_sm,
is_cuda,
is_gfx95_supported,
is_hip,
log_info_on_rank0,
)
from sglang.srt.utils.hf_transformers_utils import get_rope_config

logger = logging.getLogger(__name__)


_is_cuda = is_cuda()
_is_hip = is_hip()
_is_gfx95_supported = is_gfx95_supported()
_device_sm = get_device_sm()


Expand Down Expand Up @@ -152,10 +161,12 @@ def shared_experts_fusion_disable_reason(cls, hf_config, quant_config):
"Shared and routed experts may use different quantization formats "
"in ModelOpt mixed-precision checkpoints."
)
if not _is_cuda:
return "Shared experts fusion currently requires CUDA devices."
if (_device_sm is not None) and (_device_sm < 80):
if not (_is_cuda or _is_hip):
return "Shared experts fusion currently requires CUDA or ROCm devices."
if _is_cuda and (_device_sm is not None) and (_device_sm < 80):
return "Shared experts fusion requires SM80 or newer GPUs."
if _is_hip and not _is_gfx95_supported:
return "Shared experts fusion on ROCm is validated on gfx950 only."
if get_parallel().moe_ep_size > 1:
return (
"Shared experts fusion is not supported together with expert "
Expand Down
Loading