Interns2mobius support (#51149)

Signed-off-by: Lyu Han <lvhan_028@163.com>
This commit is contained in:
Lyu Han
2026-08-06 10:39:35 +00:00
committed by GitHub
parent e07532b035
commit 22013f74ff
8 changed files with 664 additions and 3 deletions
@@ -62,6 +62,31 @@ from vllm.utils.multi_stream_utils import maybe_execute_in_parallel
class TritonExperts(LoRAExpertsMixin, mk.FusedMoEExpertsModular):
"""Triton-based fused MoE expert implementation."""
@staticmethod
def is_supported_config(
cls: type[mk.FusedMoEExperts],
moe_config: FusedMoEConfig,
weight_key: QuantKey | None,
activation_key: QuantKey | None,
activation_format: mk.FusedMoEActivationFormat,
) -> tuple[bool, str | None]:
supported, reason = mk.FusedMoEExperts.is_supported_config(
cls,
moe_config,
weight_key,
activation_key,
activation_format,
)
if not supported or not current_platform.is_cuda_alike():
return supported, reason
padded_num_experts = (moe_config.num_experts + 31) // 32 * 32
if padded_num_experts >= 1024:
return False, (
"kernel's moe_align_block_size requires fewer than 1024 padded experts"
)
return True, None
def __init__(
self,
moe_config: FusedMoEConfig,
@@ -34,6 +34,28 @@ class TrtLlmBf16ExpertsBase:
monolithic interfaces.
"""
@staticmethod
def is_supported_config(
cls: type[mk.FusedMoEExperts],
moe_config: FusedMoEConfig,
weight_key: QuantKey | None,
activation_key: QuantKey | None,
activation_format: mk.FusedMoEActivationFormat,
) -> tuple[bool, str | None]:
supported, reason = mk.FusedMoEExperts.is_supported_config(
cls,
moe_config,
weight_key,
activation_key,
activation_format,
)
if not supported or moe_config.num_experts <= 2048:
return supported, reason
return False, (
"FlashInfer TRTLLM routing supports at most 2048 experts, "
f"but got {moe_config.num_experts}"
)
def supports_routing_replay_capture(self) -> bool:
return True
@@ -42,6 +42,28 @@ class TrtLlmFp8ExpertsBase:
interfaces.
"""
@staticmethod
def is_supported_config(
cls: type[mk.FusedMoEExperts],
moe_config: FusedMoEConfig,
weight_key: QuantKey | None,
activation_key: QuantKey | None,
activation_format: mk.FusedMoEActivationFormat,
) -> tuple[bool, str | None]:
supported, reason = mk.FusedMoEExperts.is_supported_config(
cls,
moe_config,
weight_key,
activation_key,
activation_format,
)
if not supported or moe_config.num_experts <= 2048:
return supported, reason
return False, (
"FlashInfer TRTLLM routing supports at most 2048 experts, "
f"but got {moe_config.num_experts}"
)
def __init__(
self,
moe_config: FusedMoEConfig,