Skip to content

Commit b990644

Browse files
authored
Update load_weight_utils.py (#5285)
1 parent 89ed1a9 commit b990644

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

fastdeploy/model_executor/load_weight_utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,13 @@ def get_expert_ranges(fd_config):
288288
no_tp_action_keys = copy.deepcopy(num_local_ffn_keys)
289289
if fd_config.parallel_config.use_sequence_parallel_moe:
290290
for i in range(fd_config.model_config.moe_layer_start_index, fd_config.model_config.num_hidden_layers):
291-
k = f"ernie.{prefix_layer_name}.{i}.self_attn.o_proj.weight"
292-
if k in weight_list:
293-
no_tp_action_keys.append(k)
291+
no_tp_keys = [
292+
f"ernie.{prefix_layer_name}.{i}.self_attn.o_proj.weight",
293+
f"ernie.{prefix_layer_name}.{i}.self_attn.o_proj.bias",
294+
]
295+
for k in no_tp_keys:
296+
if k in weight_list:
297+
no_tp_action_keys.append(k)
294298
tp_actions = cls._get_tensor_parallel_mappings(fd_config.model_config.pretrained_config)
295299
new_actions = {k: v for k, v in tp_actions.items() if k not in no_tp_action_keys}
296300

0 commit comments

Comments
 (0)