Repository navigation
Conversation
This branch has not been deployed
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.
Megatron supports per-parameter optimizer configuration through
config_overrides, but slime's optimizer factory does not expose it. A custom multimodal model therefore needs to edit the backend to give its language, vision and projector parameters different learning rates.Add
--custom-optimizer-config-overrides-path, a callback receiving(args, optimizer_config). Its mapping is passed unchanged toget_megatron_optimizer; the default call remains unchanged when the flag is absent. The customization guide shows how to retain standard weight-decay exclusions and use nativemax_lr/min_lrgroups without replacing the scheduler. This uses the existing Megatron API and requires no Megatron patch.Validation:
python -m pytest tests/test_stateless_adam.py -q: 8 passed on CPU. Optimizer-construction coverage now checks callback arguments, exact override forwarding, the path without a callback, and that FP32 optimizer shards remain outside autograd. This file already runs incpu-unittest.ae76c60e6and slime's real scheduler passed: three distinct LR schedules through warmup/cosine decay, per-group minimum LR, and bias/1D weight-decay exclusions. It also detects deliberately removedmin_lroverrides and a linear schedule substituted for cosine.git diff --checkpassed for the changed files.No end-to-end GPU training or distributed save/resume run was performed.