Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

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

@jsrdcht

Description

@jsrdcht

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions