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

[Semi-Auto] Support parallel cross entropy in static semi-auto training #59187

Merged
merged 7 commits into from
Nov 30, 2023

Conversation

pkuzyc
Copy link
Contributor

@pkuzyc pkuzyc commented Nov 21, 2023

PR types

Performance optimization

PR changes

Others

Description

Pcard-76459
Support parallel cross entropy in static semi-auto training.

Introduction of parallel cross entropy
Parallel cross entropy is a performance optimization strategy when the tensor is sharded on the softmax normalize axis. Parallel cross entropy will first perform some local computation and then do communication. Compared to the original pipline that performs communication before computation, parallel cross entropy reduces the communication elements size from (b,s,v) to (b,s), and also reduces the computation elements number on each process. The following figure shows the pipline difference between parallel cross entropy and the original cross entropy.

for_github

What this pr does
This pr supports parallel cross entropy in static semi-auto training. When there is a softmax_with_cross_entropy operator in the model, we will first use spmd rule (#58913) to infer the sharding status of its input and output tensors. If the input tensor is sharded on the softmax normalize axis, we will select c_softmax_with_cross_entropy kernel.

Copy link

paddle-bot bot commented Nov 21, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link

paddle-ci-bot bot commented Nov 29, 2023

Sorry to inform you that 96bdc78's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

Copy link
Contributor

@JZ-LIANG JZ-LIANG left a comment

Choose a reason for hiding this comment

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

LGTM

@JZ-LIANG JZ-LIANG merged commit 8fb0f1f into PaddlePaddle:develop Nov 30, 2023
29 checks passed
@pkuzyc pkuzyc deleted the semi_auto/c_cross_entropy branch December 22, 2023 09:42
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