Merged
Conversation
- Modify FSDPLRScheduler.get_lr() to accept param_group parameter like Megatron - Update FSDP actor logging to use lr_scheduler.get_lr(group) instead of group['lr'] - Ensure consistent LR logging behavior between FSDP and Megatron backends
- Update step() method to call get_lr(param_group) for each param_group individually - Allow different param_groups to have different learning rates based on their max_lr/min_lr settings - Previously all param_groups got the same LR regardless of their individual settings
- Fix lr_scheduler.step() call in actor.py to use standard PyTorch interface - Ensure proper inheritance from torch.optim.lr_scheduler.LRScheduler - Verify get_lr() returns list[float] as required by PyTorch standard - Confirm state_dict/load_state_dict compatibility
Contributor
Author
|
@PopSoda2002 Hi! I think this pr is ready for review |
Hecate0821
reviewed
Dec 6, 2025
Collaborator
|
LGTM |
Co-authored-by: andy <andy271828@163.com>
zhuzilin
approved these changes
Dec 7, 2025
This was referenced Dec 7, 2025
Fengzdadi
pushed a commit
to Fengzdadi/slime
that referenced
this pull request
Dec 19, 2025
Co-authored-by: AI Assistant <ai@example.com> Co-authored-by: andy <andy271828@163.com>
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.
PR Description
[FSDP] Support LR scheduler
Implement
FSDPLRSchedulerfor FSDP backend to align with Megatron-LM's learning rate scheduling behavior.Key Changes
FSDPLRSchedulerclass inheriting from PyTorchLRSchedulerRelated issue #962
Reference
Based on Megatron-LM OptimizerParamScheduler
This ensures consistent LR scheduling behavior between FSDP and Megatron backends.
Example
Load and Save Test
