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

[Llama2] Fix gradient accumulation for Llama2 training in auto model and add uts #7625

Merged

Conversation

haohongxiang
Copy link
Contributor

PR types

Bug fixes

PR changes

Others

Description

[Llama2] Fix gradient accumulation for Llama2 training in auto model and add uts

Copy link

paddle-bot bot commented Dec 11, 2023

Thanks for your contribution!

Copy link

codecov bot commented Dec 11, 2023

Codecov Report

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

Comparison is base (e6acb0e) 57.85% compared to head (2119b50) 57.85%.

Files Patch % Lines
paddlenlp/trainer/training_args.py 66.66% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #7625      +/-   ##
===========================================
- Coverage    57.85%   57.85%   -0.01%     
===========================================
  Files          582      582              
  Lines        86485    86489       +4     
===========================================
+ Hits         50038    50040       +2     
- Misses       36447    36449       +2     

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

@haohongxiang haohongxiang force-pushed the fix_grad_acc_in_llama_auto branch 5 times, most recently from bdfd12a to d7ba41b Compare December 11, 2023 23:51
@haohongxiang haohongxiang force-pushed the fix_grad_acc_in_llama_auto branch from d7ba41b to 2119b50 Compare December 11, 2023 23:58
Copy link
Collaborator

@zhaoyinglia zhaoyinglia left a comment

Choose a reason for hiding this comment

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

LGTM

@zhaoyinglia zhaoyinglia merged commit a4ed7ac into PaddlePaddle:develop Dec 12, 2023
9 checks passed
return max(self.sharding_parallel_degree, 1) * self.data_parallel_rank + self.sharding_parallel_rank
elif self.use_auto_parallel:
return self.data_parallel_rank
Copy link
Collaborator

Choose a reason for hiding this comment

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

自动并行没有sharding么?

Copy link
Collaborator

Choose a reason for hiding this comment

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

和动手有区别,自动并行的sharding是数据并行的一个优化,所以在取数据并行相关的维度时不需要考虑sharding维度

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.

3 participants