Skip to content

Commit 89cd9e8

Browse files
hushenwei2000Jonathans575WYB27xiaoguoguo626807DrownFish19
authored
[Unified MoE Layer]: Add MoE Layer with DeepEP EP Support; Add Qwen3MoE EP (#2702)
Co-authored-by: Jonathans575 <[email protected]> Co-authored-by: YB <[email protected]> Co-authored-by: xiaoguoguo626807 <[email protected]> Co-authored-by: Weiguo Zhu <[email protected]> Co-authored-by: Ace <[email protected]> Co-authored-by: Liujie0926 <[email protected]> Co-authored-by: llbdyiu66 <[email protected]> Co-authored-by: llbdyiu66 <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 380318d commit 89cd9e8

File tree

10 files changed

+1679
-9
lines changed

10 files changed

+1679
-9
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import sys
16+
from contextlib import suppress
17+
from typing import TYPE_CHECKING
18+
19+
from ...utils.lazy_import import _LazyModule
20+
21+
import_structure = {
22+
"modular_moe_layer": ["ModularMoELayer"],
23+
"moe_communication": ["MoECommunicationInterface", "AllToAllMoECommunication", "DeepEPMoECommunication"],
24+
"moe_expert": ["MoEExpertInterface", "StandardMoEExpert", "Qwen2MLP"],
25+
"moe_gate": ["PretrainedMoEGate"],
26+
"moe_factory": ["QuickAccessMoEFactory"],
27+
}
28+
29+
if TYPE_CHECKING:
30+
from .modular_moe_layer import ModularMoELayer
31+
from .moe_communication import (
32+
AllToAllMoECommunication,
33+
DeepEPMoECommunication,
34+
MoECommunicationInterface,
35+
)
36+
from .moe_expert import MoEExpertInterface, Qwen2MLP, StandardMoEExpert
37+
from .moe_factory import *
38+
from .moe_gate import PretrainedMoEGate
39+
else:
40+
sys.modules[__name__] = _LazyModule(
41+
__name__,
42+
globals()["__file__"],
43+
import_structure,
44+
module_spec=__spec__,
45+
)

0 commit comments

Comments
 (0)