Skip to content

Commit

Permalink
refine comments for GradScaler state_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo9674 committed Oct 19, 2021
1 parent 10f0a0f commit 769811b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions python/paddle/amp/grad_scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,15 @@ def state_dict(self):
Reurns:
A dict of scaler includes:
init_loss_scaling (float, optional): The initial loss scaling factor.
incr_ratio(float, optional): The multiplier to use when increasing the loss scaling.
decr_ratio(float, optional): The less-than-one-multiplier to use when decreasing the loss scaling.
incr_every_n_steps(int, optional): Increases loss scaling every n consecutive steps with finite gradients.
decr_every_n_nan_or_inf(int, optional): Decreases loss scaling every n accumulated steps with nan or inf gradients.
scale (tensor): The loss scaling factor.
incr_ratio(float): The multiplier to use when increasing the loss scaling.
decr_ratio(float): The less-than-one-multiplier to use when decreasing the loss scaling.
incr_every_n_steps(int): Increases loss scaling every n consecutive steps with finite gradients.
decr_every_n_nan_or_inf(int): Decreases loss scaling every n accumulated steps with nan or inf gradients.
incr_count(int): The number of recent consecutive unskipped steps.
decr_count(int): The number of recent consecutive skipped steps.
use_dynamic_loss_scaling(bool): Whether to use dynamic loss scaling. If False, fixed loss_scaling is used. If True, the loss scaling is updated dynamicly. Default is True.
Examples:
Expand Down

1 comment on commit 769811b

@paddle-bot-old
Copy link

@paddle-bot-old paddle-bot-old bot commented on 769811b Oct 19, 2021

Choose a reason for hiding this comment

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

🕵️ CI failures summary

🔍 PR: #36522 Commit ID: 769811b contains failed CI.

🔹 Failed: PR-CI-CPU-Py2

approve_failed
2021-10-19 10:30:35 100     5  100     5    0     0      2      0  0:00:02  0:00:01  0:00:01     2
2021-10-19 10:30:47 /usr/local/lib/python3.9/site-packages/paddle/fluid/framework.py:312: UserWarning: You are using GPU version Paddle, but your CUDA device is not set properly. CPU device will be used by default.
2021-10-19 10:30:47 warnings.warn(
2021-10-19 10:30:47 ****************
2021-10-19 10:30:47 Please find RD for approval first, and then find TPM for approval.
2021-10-19 10:30:47 0. You must have one TPM approval for API documents change:
2021-10-19 10:30:47 jzhang533/ZhangJun, dingjiaweiww/DingJiaWei, Heeenrrry/LiKunLun, TCChenlong/ChenLong for general API docs
2021-10-19 10:30:47 PangHua/XiangHui for distributed related API docs
2021-10-19 10:30:47 twismon/WangYunKai, CheQiXiao/CheQiXiao for inference related API docs.
2021-10-19 10:30:47
2021-10-19 10:30:47 There are 1 approved errors.
2021-10-19 10:30:47 ****************
2021-10-19 10:30:50 API Difference is:
2021-10-19 10:30:50 - paddle.amp.GradScaler.state_dict (ArgSpec(args=['self'], varargs=None, varkw=None, defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={}), ('document', '40971d2b1910d10f0b6003a7abfb86a1'))
2021-10-19 10:30:50 ? ^ -- ^^^^^^^^^^^^^^^^^^^^^^^^^
2021-10-19 10:30:50
2021-10-19 10:30:50 + paddle.amp.GradScaler.state_dict (ArgSpec(args=['self'], varargs=None, varkw=None, defaults=None, kwonlyargs=[], kwonlydefaults=None, annotations={}), ('document', '6d0436c34766789ca5586f1f1f5f2726'))
2021-10-19 10:30:50 ? +++ ^^^^^^^^^^ ++++++++++++++ ^
2021-10-19 10:30:50
2021-10-19 10:30:50 + approval_error=6
2021-10-19 10:30:50 + '[' 6 '!=' 0 ']'

Please sign in to comment.