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

Stage1 support bf16 #58212

Merged
merged 3 commits into from
Oct 24, 2023
Merged

Conversation

SecretXV
Copy link
Contributor

@SecretXV SecretXV commented Oct 18, 2023

PR types

New features

PR changes

APIs

Description

stage1 support bf16
refine dygraph_group_sharded_stage1_fp16.py

用户接口改动:

  1. DistributedStrategyamp_configs添加use_pure_bf16选项

@paddle-bot
Copy link

paddle-bot bot commented Oct 18, 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.

@paddle-bot paddle-bot bot added the contributor External developers label Oct 18, 2023
use_pure_bf16(bool): Whether to use the pure bf16 training. Default False.

use_amp_guard(bool): Whether to use `amp_guard` when constructing the program.
Default True. Only takes effect when `use_pure_fp16` or `use_pure_bf16` is turned on.
Copy link
Contributor

Choose a reason for hiding this comment

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

这里可能会引起不兼容升级,如果用户原来使用的时候设置了use_fp16_guard,现在可能无法生效了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

save_dtype=None,
dtype="bfloat16",
)

Copy link
Contributor

Choose a reason for hiding this comment

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

90~108行这2个针对不同dtype的代码,可以简化下。其他设置都一样,只有dtype不同

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

optional bool use_optimizer_fp16 = 12
optional bool use_pure_bf16 = 11 [ default = false ];
optional bool use_amp_guard = 12 [ default = true ];
optional bool use_optimizer_fp16 = 13
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

@XieYunshen XieYunshen left a comment

Choose a reason for hiding this comment

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

LGTM for set_tests_properties(test_dygraph_sharding_stage1_bf16 PROPERTIES TIMEOUT "200")

@zhangting2020 zhangting2020 merged commit b85e6d1 into PaddlePaddle:develop Oct 24, 2023
28 checks passed
jiahy0825 pushed a commit to jiahy0825/Paddle that referenced this pull request Oct 26, 2023
danleifeng pushed a commit to danleifeng/Paddle that referenced this pull request Nov 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants