Skip to content

Implement Muon optimizer on ssl-diffusion branch - #2682

Merged
shmh40 merged 4 commits into
ecmwf:develop-ssl-diffusion-v1from
ankitpatnala:develop-ssl-diffusion-v1_muon_experiments
Jul 25, 2026
Merged

Implement Muon optimizer on ssl-diffusion branch#2682
shmh40 merged 4 commits into
ecmwf:develop-ssl-diffusion-v1from
ankitpatnala:develop-ssl-diffusion-v1_muon_experiments

Conversation

@ankitpatnala

@ankitpatnala ankitpatnala commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

In this branch, few commits from earlier muon PR (#2639) are cherry-picked on develop-ssl-diffusion-v1.

@ankitpatnala

ankitpatnala commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@sophie-xhonneux @clessig Can you provide me any config, so that I can test on this branch?

@github-actions github-actions Bot added eval anything related to the model evaluation pipeline infra Issues related to infrastructure labels Jul 24, 2026
# aiming for beta1 = 0.9 at one node, ie kappa=B=4
beta1 = max(0.5, 1.0 - kappa * (1.0 - optimizer_cfg.adamw.beta1))
# aiming for beta2 = 0.95 at one node, ie B=4
beta2 = max(0.9, 1.0 - kappa * (1.0 - optimizer_cfg.adamw.beta2))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a new clamp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model.parameters(),
lr=shared_lr_cfg.lr_start,
weight_decay=optimizer_cfg.weight_decay,
fused=True,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new too

"earthkit-data==0.17.0",
"earthkit-utils==0.1.2",
"imageio[ffmpeg]>=2.37.2",
"scipy>=1.12",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this needed or something else?

else:
new_entry[key] = val
self.optimizer.state[param] = new_entry
optimizer.state[param] = new_entry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the reference to this optimizer state lost? I don't think I quite get the ownership model here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, the parameters are collected into a dict and linked to the corresponding optimizer from the set of optimizers (self.optimizers). This is then called while iterating through the model parameters, at this line

@shmh40
shmh40 merged commit 04f3b39 into ecmwf:develop-ssl-diffusion-v1 Jul 25, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

eval anything related to the model evaluation pipeline infra Issues related to infrastructure

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants