Skip to content

Commit b91113d

Browse files
author
Ronald Tse
committed
style: remaining ruff — muon dict literals, unused PKM import, parity import order
1 parent f501d60 commit b91113d

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

‎src/gpu/muon.py‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,27 @@ def __init__(self, params, lr: float = 0.01, momentum: float = 0.95,
4141
weight_decay: float = 0.0) -> None:
4242
super().__init__(
4343
list(params),
44-
dict(lr=lr, momentum=momentum, nesterov=nesterov,
45-
ns_steps=ns_steps, weight_decay=weight_decay, adamw=False),
44+
{
45+
"lr": lr,
46+
"momentum": momentum,
47+
"nesterov": nesterov,
48+
"ns_steps": ns_steps,
49+
"weight_decay": weight_decay,
50+
"adamw": False,
51+
},
4652
)
4753

4854
def add_adamw_group(self, params, lr: float = 1e-4, betas=(0.9, 0.999),
4955
weight_decay: float = 0.0) -> None:
5056
"""Embedding-like parameters: standard AdamW math, shared
5157
scheduler (the cosine scales every group's lr)."""
52-
self.add_param_group(dict(params=list(params), lr=lr, betas=tuple(betas),
53-
weight_decay=weight_decay, adamw=True))
58+
self.add_param_group({
59+
"params": list(params),
60+
"lr": lr,
61+
"betas": tuple(betas),
62+
"weight_decay": weight_decay,
63+
"adamw": True,
64+
})
5465

5566
@torch.no_grad()
5667
def step(self, closure=None): # noqa: ARG002

0 commit comments

Comments
 (0)