Skip to content

Commit a3d8c11

Browse files
committed
shared experts
Signed-off-by: jenchen13 <[email protected]>
1 parent f70b892 commit a3d8c11

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modelopt/torch/export/plugins/mcore_nemotron.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@
7171
"router": NameRemapping("model.layers.{}.mlp.gate.", REPLICATE),
7272
"local_experts.linear_fc1": GatedMLPMerging("model.layers.{}.mlp.experts.{}.", COL_ETP),
7373
"local_experts.linear_fc2": NameRemapping("model.layers.{}.mlp.experts.{}.down_proj.", ROW_ETP),
74-
75-
74+
"shared_experts.linear_fc1": GatedMLPMerging("model.layers.{}.mlp.shared_experts.", COL_TP),
75+
"shared_experts.linear_fc2": NameRemapping(
76+
"model.layers.{}.mlp.shared_experts.down_proj.", ROW_TP
77+
),
78+
7679
}
7780

7881

@@ -101,5 +104,7 @@
101104
"router": NameRemapping("model.layers.{}.mlp.gate."),
102105
"local_experts.linear_fc1": GatedMLPSlicing("model.layers.{}.mlp.experts.{}."),
103106
"local_experts.linear_fc2": NameRemapping("model.layers.{}.mlp.experts.{}.down_proj."),
107+
"shared_experts.linear_fc1": GatedMLPSlicing("model.layers.{}.mlp.shared_experts."),
108+
"shared_experts.linear_fc2": NameRemapping("model.layers.{}.mlp.shared_experts.down_proj."),
104109

105110
}

0 commit comments

Comments
 (0)