{"record":{"id":"81282ae979eab9a1","repo":"huggingface/pytorch-image-models","slug":"adamw-lr-is-deprecated-use-fallback-lr-scale-adam","errorCode":null,"errorMessage":"adamw_lr is deprecated, use fallback_lr_scale=adamw_lr/lr instead. adamw_lr will be removed in a future release.","messagePattern":"adamw_lr is deprecated, use fallback_lr_scale=adamw_lr/lr instead\\. adamw_lr will be removed in a future release\\.","errorType":"console","errorClass":"FutureWarning","httpStatus":null,"severity":"warning","filePath":"timm/optim/muon.py","lineNumber":738,"sourceCode":"\n            # Manual control over parameter groups\n            optimizer = Muon([\n                {'params': weight_matrices, 'lr': 0.02},\n                {'params': biases, 'use_fallback': True, 'lr': 3e-4}, # use AdamW if use_fallback=True\n            ])\n            ```\n        \"\"\"\n        _validate_scalar(\"learning rate\", lr)\n        _validate_scalar(\"weight_decay\", weight_decay)\n        _validate_scalar(\"momentum\", momentum, max_value=1.0)\n        _validate_scalar(\"epsilon\", eps)\n        if conv_mode not in [\"flatten\", \"batched\"]:\n            raise ValueError(f\"Invalid conv_mode: {conv_mode}\")\n        if algo not in [\"muon\", \"adamuon\"]:\n            raise ValueError(f\"Invalid algo: {algo}. Must be 'muon' or 'adamuon'\")\n\n        if adamw_lr is not None:\n            warnings.warn(\n                \"adamw_lr is deprecated, use fallback_lr_scale=adamw_lr/lr instead. \"\n                \"adamw_lr will be removed in a future release.\",\n                FutureWarning,\n                stacklevel=2,\n            )\n            if torch.is_tensor(lr):\n                raise ValueError(\"adamw_lr is not supported with tensor lr; use fallback_lr_scale instead.\")\n            if lr == 0:\n                raise ValueError(\"Cannot compute fallback_lr_scale from adamw_lr when lr=0\")\n            fallback_lr_scale = adamw_lr / lr\n\n        defaults = dict(\n            lr=lr,\n            weight_decay=weight_decay,\n            momentum=momentum,\n            nesterov=nesterov,\n            ns_steps=ns_steps,\n            ns_coefficients=ns_coefficients,","sourceCodeStart":720,"sourceCodeEnd":756,"githubUrl":"https://github.com/huggingface/pytorch-image-models/blob/9a5261e31b3b5128526eb2658333b4c0a54464ae/timm/optim/muon.py#L720-L756","documentation":"Muon's __init__ warns that the adamw_lr argument (separate LR for params handled by the AdamW fallback path) is deprecated. It will be removed; express it as a scale of the main lr via fallback_lr_scale = adamw_lr / lr.","triggerScenarios":"timm.optim.Muon(..., adamw_lr=0.0035) or create_optimizer_v2(..., opt='muon', adamw_lr=...) with any non-None adamw_lr.","commonSituations":"Configs copied from modded-nanogpt style Muon recipes (e.g. adamw_lr=3.5e-3 with lr=0.02) after timm changed the API.","solutions":["Replace adamw_lr=X with fallback_lr_scale=X/lr (compute the ratio)","Keep lr itself unchanged so effective fallback LR stays the same","Update any YAML/CLI configs that pass adamw_lr"],"exampleFix":"# before\nMuon(model.parameters(), lr=0.02, adamw_lr=0.0035)\n# after\nMuon(model.parameters(), lr=0.02, fallback_lr_scale=0.0035/0.02)","handlingStrategy":"validation","validationCode":"adamw_lr, lr = 0.0035, 0.02\nassert adamw_lr is None, 'migrate: pass fallback_lr_scale=adamw_lr/lr'\nopt = Muon(params, lr=lr, fallback_lr_scale=adamw_lr / lr)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Express fallback LR as a ratio of lr in configs","Fail fast on FutureWarning in config tests","Track timm optimizer API changes in release notes"],"tags":["timm","optimizer","muon","deprecation","api-change"],"backgroundTag":"deprecated-argument","analyzedSha":"9a5261e31b3b5128526eb2658333b4c0a54464ae","analyzedAt":"2026-08-27T02:34:25.417Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}