[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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user