Skip to content

[Unified Checkpoint] fix load missing keys #9523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions paddlenlp/trainer/unified_checkpoint/check_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@
state_dict = get_expected_state_dict(model)

for key in state_dict.keys():
if model._keys_to_ignore_on_load_missing is not None and key in model._keys_to_ignore_on_load_missing:
continue

Check warning on line 190 in paddlenlp/trainer/unified_checkpoint/check_completion.py

View check run for this annotation

Codecov / codecov/patch

paddlenlp/trainer/unified_checkpoint/check_completion.py#L189-L190

Added lines #L189 - L190 were not covered by tests
if sharding_group.nranks > 1:
static_name = struct2static_name_mappings.get(key, None)
param_rank = param2rank.get(static_name, None)
Expand Down