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

dp main_grad #7293

Merged
merged 5 commits into from
Nov 22, 2023
Merged

dp main_grad #7293

merged 5 commits into from
Nov 22, 2023

Conversation

tianhaodongbd
Copy link
Contributor

PR types

Others

PR changes

Others

Description

dp main_grad

@paddle-bot
Copy link

paddle-bot bot commented Oct 20, 2023

Thanks for your contribution!

@codecov
Copy link

codecov bot commented Oct 30, 2023

Codecov Report

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

Comparison is base (90f44a9) 59.34% compared to head (fc0bc57) 58.00%.
Report is 76 commits behind head on develop.

Files Patch % Lines
paddlenlp/trainer/trainer.py 80.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7293      +/-   ##
===========================================
- Coverage    59.34%   58.00%   -1.35%     
===========================================
  Files          567      579      +12     
  Lines        83355    86266    +2911     
===========================================
+ Hits         49466    50037     +571     
- Misses       33889    36229    +2340     

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

# Multi-gpu training
if self.args.world_size > 1 and not self.args.use_hybrid_parallel:
model = paddle.DataParallel(model)
# Distributed training (should be after fp16 initialization)

if self.args.amp_master_grad:
mix_precision_utils.MixPrecisionLayer(model, dtype=self.amp_dtype)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这里的model的话,dp已经包了一层。确认一下 MixPrecisionLayer 再包一次影响不?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这里这样包一次是可以的

@@ -810,9 +810,10 @@ def __post_init__(self):
self.pipeline_parallel_degree <= 1
and self.tensor_parallel_degree <= 1
and (not self.sharding or ShardingOption.FULL_SHARD in self.sharding)
and self.use_hybrid_parallel
):
raise ValueError(
Copy link
Collaborator

Choose a reason for hiding this comment

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

是不是只有stage3 不行,这里可以把判断改简单些。

Copy link
Collaborator

@ZHUI ZHUI left a comment

Choose a reason for hiding this comment

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

LGTM

@ZHUI ZHUI merged commit 628db88 into PaddlePaddle:develop Nov 22, 2023
9 checks passed
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.

2 participants