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

[Dy2St][AMP] Support local enable the auto_cast #58977

Merged

Conversation

SigureMo
Copy link
Member

@SigureMo SigureMo commented Nov 14, 2023

PR types

New features

PR changes

Others

Description

#58628 基础上进行修改,支持了「局部开」的 AMP 策略

将 Operator 上的 should_auto_cast: bool 修改为拥有更多信息的 amp_options: AmpOptions,原来的 op.should_auto_cast 可通过 op.amp_options.enable 来访问,同样,prepare_op_should_auto_cast 也 rename 为 prepare_op_amp_options

因为原来假定了全局一定是启用 AMP 的,但对于「局部开」来说,全局应该是关的,因此在 prepare_op_amp_options 时需要额外传入全局的状态,可参考新增单测 test_should_auto_cast_3 即为「全局关局部开」的示例

PCard-66972

Copy link

paddle-bot bot commented Nov 14, 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.

LGTM

@SigureMo SigureMo merged commit 3d6a255 into PaddlePaddle:develop Nov 15, 2023
28 checks passed
@SigureMo SigureMo deleted the dy2st/support-local-enable-auto-cast branch November 15, 2023 08:03
SecretXV pushed a commit to SecretXV/Paddle that referenced this pull request Nov 28, 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