Skip to content
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

[WIP][Unified Checkpoint] Add split param and refactor code #9240

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

DesmonDay
Copy link
Contributor

@DesmonDay DesmonDay commented Oct 10, 2024

PR types

New features

PR changes

Others

Description

  1. Support sharding stage1 v2 for unified checkpoint.
  2. Refactor uc code.

Copy link

paddle-bot bot commented Oct 10, 2024

Thanks for your contribution!

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ DesmonDay
❌ gongel
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

Attention: Patch coverage is 11.15312% with 940 lines in your changes missing coverage. Please review.

Project coverage is 53.03%. Comparing base (697a4cc) to head (ae9ddce).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
...dlenlp/trainer/plugins/unified_checkpoint_utils.py 12.25% 351 Missing ⚠️
...enlp/trainer/plugins/unified_checkpoint_dynamic.py 9.12% 259 Missing ⚠️
.../trainer/plugins/unified_checkpoint_sharding_v2.py 7.52% 172 Missing ⚠️
.../trainer/plugins/unified_checkpoint_single_card.py 13.79% 125 Missing ⚠️
paddlenlp/trainer/plugins/unified_checkpoint.py 23.52% 26 Missing ⚠️
paddlenlp/utils/nested.py 14.28% 6 Missing ⚠️
paddlenlp/trainer/trainer.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9240      +/-   ##
===========================================
- Coverage    53.09%   53.03%   -0.07%     
===========================================
  Files          657      661       +4     
  Lines       106521   106771     +250     
===========================================
+ Hits         56557    56622      +65     
- Misses       49964    50149     +185     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ZHUI ZHUI requested review from ZHUI and DrownFish19 October 11, 2024 06:42
@@ -909,7 +983,160 @@ def unified_checkpoint_into_shards(
return state_dict, shard_file, sharded_index


def load_unified_optimizer_split_param(args, model, optimizer, resume_from_checkpoint):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个函数是不是和load_unified_optimizer_locally大部分逻辑相似

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前初步开发中,后续会修改

@DesmonDay DesmonDay changed the title [Unified Checkpoint] Add split param [WIP][Unified Checkpoint] Add split param Oct 12, 2024
@DesmonDay DesmonDay force-pushed the add_split_param branch 2 times, most recently from 3abfe71 to 9bce15b Compare October 14, 2024 09:13
@DesmonDay DesmonDay changed the title [WIP][Unified Checkpoint] Add split param [WIP][Unified Checkpoint] Add split param, refactor code Oct 14, 2024
@DesmonDay DesmonDay changed the title [WIP][Unified Checkpoint] Add split param, refactor code [WIP][Unified Checkpoint] Add split param and refactor code Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants