from local

This commit is contained in:
dohe0342 2022-12-13 11:26:08 +09:00
parent 42259f2af5
commit 298e087b76
2 changed files with 3 additions and 2 deletions

View File

@ -1073,9 +1073,10 @@ def train_one_epoch(
# of the grad scaler is configurable, but we can't configure it to have different
# behavior depending on the current grad scale.
cur_grad_scale = scaler._scale.item()
'''
if cur_grad_scale < 1.0 or (cur_grad_scale < 8.0 and batch_idx % 400 == 0):
continue
#scaler.update(cur_grad_scale * 2.0)
scaler.update(cur_grad_scale * 2.0)
'''
if cur_grad_scale < 0.01:
logging.warning(f"Grad scale is small: {cur_grad_scale}")
if cur_grad_scale < 1.0e-05: