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

disable kernel promotion for amp traning #1085

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

zhangting2020
Copy link

背景:过去框架AMP在O2模式下,当OP支持低精度就会选择低精度的kernel,但这样的策略出现精度问题的风险较高。为保障训练精度,框架在2.5版本对AMP 策略进行了调整,即在O2模式下,仅当Op所有输入为低精度时才会选择低精度kernel,否则则采用FP32 Kernel(即promote的策略),因此可能会引起部分模型出现性能下降。

目前可以通过给auto_cast设置use_promote=False参数来回退到旧版本的O2策略,本PR给套件添加该参数的设置功能,当前套件默认设置为use_promote=False,使用的是旧版本的O2策略,以解决性能下降问题。

PaddlePaddle框架动态图下默认的行为是use_promote=True,未来可以根据模型特点进行调试。

框架PR:PaddlePaddle/Paddle#53742

@CLAassistant
Copy link

CLAassistant commented Sep 25, 2024

CLA assistant check
All committers have signed the CLA.

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