ijepa icon indicating copy to clipboard operation
ijepa copied to clipboard

Why there is no **unscale_** when you use amp?

Open jsrdcht opened this issue 8 months ago • 0 comments

Your code is

if use_bfloat16:
    scaler.scale(loss).backward()
    scaler.step(optimizer)
    scaler.update()

I think it should be

if use_bfloat16:
    scaler.scale(loss).backward()
    scaler.unscale_(optimizer)
    scaler.step(optimizer)
    scaler.update()

Am I right?

jsrdcht avatar Jun 06 '24 13:06 jsrdcht