From 949be3bcf7a311cda7655219c384185d4221543c Mon Sep 17 00:00:00 2001 From: luyuxiang Date: Fri, 26 Feb 2021 10:40:12 +0800 Subject: [PATCH] fix amp init_loss_scaling --- demo/optimization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/optimization.py b/demo/optimization.py index 9271ae6..dffccdb 100644 --- a/demo/optimization.py +++ b/demo/optimization.py @@ -73,7 +73,7 @@ def optimization( #amp_list = P.fluid.contrib.mixed_precision.AutoMixedPrecisionLists( # custom_white_list=['softmax', 'layer_norm', 'gelu']) optimizer = P.fluid.contrib.mixed_precision.decorate( - optimizer, init_loss_scaling=3**15, use_dynamic_loss_scaling=True) + optimizer, init_loss_scaling=2**15, use_dynamic_loss_scaling=True) _, param_grads = optimizer.minimize(loss) loss_scaling = P.static.default_main_program().global_block().var( 'loss_scaling_0') -- GitLab