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

Fix shared weights sync for PipelineLayer #7775

Merged
merged 2 commits into from Jan 4, 2024

Conversation

DrownFish19
Copy link
Collaborator

PR types

Bug fixes

PR changes

Others

Description

  1. PipelineLayer will create parameters for each layer and call _synchronize_shared_weights() to synchronize the shared parameters.
  2. When setting the model state_dict, _synchronize_shared_weights will be called to synchronize the shared parameters. However, self._init_weights will re-initialize the parameters without synchronizing the shared parameters. If the following step does not load a checkpoint, the shared parameters will be different.

Copy link

paddle-bot bot commented Jan 4, 2024

Thanks for your contribution!

Copy link

codecov bot commented Jan 4, 2024

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (0658258) 57.30% compared to head (9c2ce79) 57.30%.

Files Patch % Lines
paddlenlp/transformers/model_utils.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##           release/2.7    #7775      +/-   ##
===============================================
- Coverage        57.30%   57.30%   -0.01%     
===============================================
  Files              584      584              
  Lines            87688    87690       +2     
===============================================
+ Hits             50252    50253       +1     
- Misses           37436    37437       +1     

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

@ZHUI ZHUI merged commit 4952069 into PaddlePaddle:release/2.7 Jan 4, 2024
5 of 7 checks passed
@DrownFish19 DrownFish19 deleted the fix-gpt-pp-release-2.7 branch January 5, 2024 02:27
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.

None yet

2 participants