[config] Reject unknown optimizer names in ParamGroupConfig - #4565
Open
YeonwooSung wants to merge 1 commit into
Open
[config] Reject unknown optimizer names in ParamGroupConfig#4565YeonwooSung wants to merge 1 commit into
YeonwooSung wants to merge 1 commit into
Conversation
A typo like Adamw only failed after model build. Validate the closed Adam/AdamW/DistMuon set when the param group is constructed.
YeonwooSung
requested review from
fegin,
tianyu-l,
wconstab and
wwwjn
as code owners
September 10, 2026 03:03
tianyu-l
reviewed
Sep 10, 2026
| @@ -60,12 +68,20 @@ class ParamGroupConfig: | |||
| E.g. '.*bias$', '.*norm.*', '.*\\.embed_tokens\\..*', '.*' (catch-all)""" | |||
|
|
|||
| optimizer_name: str | |||
Contributor
There was a problem hiding this comment.
instead, we should
- create torchtitan native
Optimizer(Configurable, torch.optim.Optimizer) - create torchtitan native
AdamWandDistMuon(https://github.com/pytorch/torchtitan/blob/main/torchtitan/distributed/flex_shard/dist_muon.py#L252) -- theAdamWone can be done via afrom_torchhelper. - here specify
optimizer: Optimizer.Config
if it sounds complicated, leave it to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParamGroupConfig.optimizer_nameaccepted any string. A typo such asAdamwbecameNotImplementedErroronly after the model was built.The allowed set is still
Adam,AdamW, andDistMuon, now as a single module-level factory map. Unknown names raiseValueErrorwhen the param group is constructed.Test plan
ParamGroupConfigonly (no model / container): accept the three names; rejectAdamwandfootest_optimizer_param_groups.py