8000 [LLM] [Cherry-Pick] valid loss before optimizer step (#9255) by SylarTiaNII · Pull Request #9705 · PaddlePaddle/PaddleNLP · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[LLM] [Cherry-Pick] valid loss before optimizer step (#9255) #9705

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 1 commit into from
Dec 27, 2024

Conversation

SylarTiaNII
Copy link
Contributor
@SylarTiaNII SylarTiaNII commented Dec 26, 2024

PR types

New features

PR changes

Others

Description

CP from: #9255
report error when getting loss of NaN of Inf, for LLM training platform integration.
[Pcard-88789]

Copy link
paddle-bot bot commented Dec 26, 2024

Thanks for your contribution!

Copy link
codecov bot commented Dec 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.02%. Comparing base (a0c4b4c) to head (0f556d8).
Report is 263 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9705      +/-   ##
===========================================
+ Coverage    51.99%   53.02%   +1.02%     
===========================================
  Files          726      718       -8     
  Lines       115607   112374    -3233     
===========================================
- Hits         60110    59581     -529     
+ Misses       55497    52793    -2704     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -1133,6 +1133,9 @@ def fused_allreduce_gradients_no_sync(paramlist, hcg):
if self.args.pipeline_parallel_degree <= 1 and self._enable_delay_scale_loss():
tr_loss /= self.args.gradient_accumulation_steps

# assert if loss is invalid
self._check_loss_valid(tr_loss)

Copy link
Collaborator

Choose a reason for hiding this comment

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

有个疑问,如果是float16的训练出现nan或者inf,会直接报错?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fp16训练不会报错,在下面的函数实现里会有判断。

Copy link
Collaborator
@wawltor wawltor left a comment

Choose a reason for hiding this comment

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

LGTM

@wawltor wawltor merged commit 691ae01 into PaddlePaddle:develop Dec 27, 2024
10 of 12 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
0