-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add paddle.is_autocast_enabled and get_autocast_gpu_dtype API #74441
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
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
47172c0
to
8d1c2fd
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #74441 +/- ##
==========================================
Coverage ? 90.00%
==========================================
Files ? 3
Lines ? 20
Branches ? 0
==========================================
Hits ? 18
Misses ? 2
Partials ? 0 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
python/paddle/amp/auto_cast.py
Outdated
if TYPE_CHECKING: | ||
from paddle._typing import PlaceLike |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if TYPE_CHECKING
不要放在 import 中间,放在其他 import 之后
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
/re-run all-failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/re-run all-failed |
…Paddle#74441) * Add get_autocast_dtype. get_autocast_gpu_dtype and is_autocast_enable APIs * refine docs * set default dtype to fp16
PR Category
User Experience
PR Types
Improvements
Description
新增 paddle.is_autocast_enabled 、get_autocast_dtype get_autocast_gpu_dtype API。其中,get_autocast_gpu_dtype是get_autocast_dtype的别名。
三个 API 均接收一个可选参数
device_dtype
,仅出于兼容 torch 对应 API 而设置。Paddle 中所有设备共享同一套 AMP 配置,device_dtype
不影响返回结果。CN doc: PaddlePaddle/docs#7375