[Kimi K3 Perf] option to shard the shared expert for non mega case, 16.98 GiB memory/GPU saved (#50912)

Signed-off-by: yewentao256 <zhyanwentao@126.com>
This commit is contained in:
Wentao Ye
2026-08-04 14:00:44 -04:00
committed by GitHub
parent 7cab4368f2
commit d31de3c421
3 changed files with 10 additions and 18 deletions
@@ -81,6 +81,9 @@ class SharedExperts(torch.nn.Module):
# - we are using eplb with non-default backend, because of correctness issues
# - we are using flashinfer with DP, since there nothing to gain
parallel_config = self._moe_config.moe_parallel_config
if getattr(self._layer, "shard_sequence_parallel", False):
# TODO: we may enable this to optimize further
return True
return (
parallel_config.enable_eplb
and parallel_config.all2all_backend != "allgather_reducescatter"