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

【AutoParallel】Promote fuselinear pass in auto-parallel #59188

Merged
merged 13 commits into from
Dec 6, 2023

Conversation

heavyrain-lzy
Copy link
Contributor

@heavyrain-lzy heavyrain-lzy commented Nov 21, 2023

PR types

Performance optimization

PR changes

Others

Description

Pcard-76459
Add a pass before the fused_linear pass to promote the performance. This pass mainly solve the following scenario when enabling the MP or TP parallelism:

  • The origin linear operator as follows:
matmul --> add
  • After enabling MPor TP, some linear operators may become as follows:
matmul --> comm_op --> add

The communication operator prohibits the matmul and add from being fused.

experiment

Take the experiment on the GPT-3 with 6.7B parameters using the single host with 8 V100 GPUs:

strategy tokens/s speed change
no-FusedLinear 2166 BaseLine
FusedLinear 2203 1.71%
FusedLinear-Promotion 2215 2.26%

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
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

Add an unittest

@heavyrain-lzy
Copy link
Contributor Author

Add an unittest

The unittest 'test_auto_parallel_fused_linear_promotion_pass.py' has been added. But the machine of CI/CE can't run the test, because the 'fused_gemm_epilogue' requires the CUDA11.6 at least. I have run the test by myself:
image

Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@XiaoguangHu01 XiaoguangHu01 left a comment

Choose a reason for hiding this comment

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

LGTM

@heavyrain-lzy heavyrain-lzy merged commit 77f80a5 into PaddlePaddle:develop Dec 6, 2023
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