Skip to content

Conversation

@KakaruHayate
Copy link

fix "input Linear" and "output Linear" optim by Muon
Returns:
A list of parameters that should be optimized with muon.
"""
excluded_module_classes = (AdamWLinear, AdamWCov1d)
Copy link
Member

@yqzhishen yqzhishen Jan 14, 2026

Choose a reason for hiding this comment

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

excluded_module_classes = (nn.Embedding, AdamWLinear, AdamWCov1d)

for param in module.parameters(recurse=False):
if not param.requires_grad:
continue
if not isinstance(module, nn.Embedding) and param.ndim >= 2:
Copy link
Member

@yqzhishen yqzhishen Jan 14, 2026

Choose a reason for hiding this comment

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

if param.ndim >= 2:

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants