Skip to content

Commit 35479b6

Browse files
authored
[BugFix] fix tsp o_proj bias add (#5284)
* fix tsp bias add * fix * fix
1 parent 1a559c9 commit 35479b6

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
@@ -290,9 +290,13 @@ def get_expert_ranges(fd_config):
290290
no_tp_action_keys = copy.deepcopy(num_local_ffn_keys)
291291
if fd_config.parallel_config.use_sequence_parallel_moe:
292292
for i in range(fd_config.model_config.moe_layer_start_index, fd_config.model_config.num_hidden_layers):
293-
k = f"ernie.{prefix_layer_name}.{i}.self_attn.o_proj.weight"
294-
if k in weight_list:
295-
no_tp_action_keys.append(k)
293+
no_tp_keys = [
294+
f"ernie.{prefix_layer_name}.{i}.self_attn.o_proj.weight",
295+
f"ernie.{prefix_layer_name}.{i}.self_attn.o_proj.bias",
296+
]
297+
for k in no_tp_keys:
298+
if k in weight_list:
299+
no_tp_action_keys.append(k)
296300
tp_actions = cls._get_tensor_parallel_mappings(fd_config.model_config.pretrained_config)
297301
new_actions = {k: v for k, v in tp_actions.items() if k not in no_tp_action_keys}
298302

0 commit comments

Comments
 (0)