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

[XPU] AdamW: fp16 for moment1/moment2 #62688

Merged
merged 4 commits into from
Mar 28, 2024

Conversation

houj04
Copy link
Contributor

@houj04 houj04 commented Mar 13, 2024

PR types

New features

PR changes

OPs

Description

类似于 #57077 ,增加对“用fp16来存moment1moment2”的支持。

使用方式和之前一样:目前仅在XPU下生效,通过export xpu_adamw_moment_dtype="fp16"来打开此功能。

Copy link

paddle-bot bot commented Mar 13, 2024

你的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 Mar 21, 2024

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

moment1_output_for_xdnn,
buffer_for_findmax,
moment1_out->numel());
float moment1_scale_value = 65504.0f / moment1_max / 2.0f;
Copy link
Contributor

Choose a reason for hiding this comment

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

请教一下珏爷,这里固定的这个值不会有问题嘛

Copy link
Contributor Author

Choose a reason for hiding this comment

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

参考per tensor scale设计。内部文档就不往外面贴了。

Copy link
Contributor

@lj970926 lj970926 left a comment

Choose a reason for hiding this comment

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

LGTM

@houj04 houj04 changed the title [XPU] AdamW: fp16 for moment1/moment2 on KL3 [XPU] AdamW: fp16 for moment1/moment2 Mar 27, 2024
@QingshuChen QingshuChen merged commit d5863bf into PaddlePaddle:develop Mar 28, 2024
30 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request Mar 29, 2024
* [XPU] AdamW: fp16 for moment1/moment2 on KL3

* fix function name typo.
@houj04 houj04 added the XPU label Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants