Skip to content

StableAdamW: Missing divisor in RMS computation #27

Closed

Description

@EricZimmermann

Hello

It seems as though there is a minor error in computing RMS in Stable Adam:

RMS is computed as:

rms = torch.norm(p.grad.data.div(root_sqr_avg.maximum(eps_t)), 2)

And is missing a normalization coefficient for the mean:
rms = torch.norm(p.grad.data.div(root_sqr_avg.maximum(eps_t)), 2) / math.sqrt(p.grad.data.div.numel())

as per
image

Additionally, another eps can be added in the final normalization.

Activity

  1. warner-benjamin commented on Jun 3, 2024

    @warner-benjamin
    Owner

    I'm in the process of porting over the fastxtend optimizers to use the optimi implementations, which should resolve this.

  2. warner-benjamin commented on Jun 9, 2024

    @warner-benjamin
    Owner

    @EricZimmermann #28 tracks the progress of porting over the fastxtend optimizers to use the optimi implementations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions