Skip to content

Commit

Permalink
[fix] freeze 参数冗余存储 兼容shard-reshard (PaddlePaddle#9067)
Browse files Browse the repository at this point in the history
  • Loading branch information
bo-ke committed Sep 18, 2024
1 parent 4503dd3 commit 83a3c19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion paddlenlp/trainer/utils/sharding_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def filter_sharded_params(state_dict, optimizer, sharding_group):
for (k, v) in state_dict.items():
if v.name in filtered_parameters:
filtered_state_dict[k] = v
else:
elif v.name not in [p.name for p in parameters]:
if sharding_rank == 0:
filtered_state_dict[k] = v
return filtered_state_dict
Expand Down

0 comments on commit 83a3c19

Please sign in to comment.