[Bugfix] Disable shared expert overlap if Marlin MoE is used (#28410)

Signed-off-by: mgoin <mgoin64@gmail.com>
This commit is contained in:
Michael Goin
2025-11-11 23:16:12 +00:00
committed by GitHub
parent 28534b92b9
commit e5f599d4d1
6 changed files with 13 additions and 5 deletions
@@ -678,6 +678,10 @@ class FusedMoE(CustomOp):
and self.moe_config.use_flashinfer_cutlass_kernels
)
@property
def use_marlin_kernels(self):
return getattr(self.quant_method, "use_marlin", False)
@property
def use_dp_chunking(self) -> bool:
return (
@@ -28,17 +28,17 @@ class SharedFusedMoE(FusedMoE):
super().__init__(**kwargs)
self._shared_experts = shared_experts
# Disable shared expert overlap if we are using eplb, because of
# correctness issues, or if using flashinfer with DP, since there
# is nothing to be gained in this case. Disabling the overlap
# optimization also prevents the shared experts from being hidden
# from torch.compile.
# Disable shared expert overlap if:
# - we are using eplb, because of correctness issues
# - we are using flashinfer with DP, since there nothint to gain
# - we are using marlin kjernels
self.use_overlapped = (
use_overlapped
and not (
# TODO(wentao): find the root cause and remove this condition
self.enable_eplb
or (self.moe_config.use_flashinfer_cutlass_kernels and self.dp_size > 1)
or self.use_marlin_kernels
)
and self._shared_experts is not None
)