Repository navigation
Conversation
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
Adds the warmup-stable-decay (WSD) LR schedule and the other
transformersschedulers that need kwargs.TRL (1.7.0 and 1.17.1) passes
lr_scheduler_typeandlr_scheduler_kwargstotransformers.get_scheduler, so the schedules already existed upstream. The block wasLRSchedulerKwargs: it had onlymin_lr_rate, so OmegaConf rejected all other keys.LRSchedulerKwargsnow has the kwargs of all supported schedulers. Only set fields are forwarded.num_decay_stepsuses thewarmup_stepsrule: (0, 1) is a ratio of the training steps, >= 1 is a step count. A ratio is converted to steps before training and is not allowed withnum_train_epochs.src/post_training/utils/lr_scheduler.pyvalidates the scheduler config in the submission phase. It rejects kwargs that the scheduler does not accept, values out of range, a missingmin_lr/min_lr_rate,constantwith a warmup, and a WSD warmup + decay that is longer than the run.reduce_lr_on_plateauandgreedyare not supported, because they need an evaluation loop.lr_scheduler_typeis nowlinear. The new validation rejectscosine_with_min_lrwithoutmin_lrormin_lr_rate, andLRSchedulerKwargssets neither by default. Withlinear, a config without scheduler fields stays valid. All shipped configs set the scheduler explicitly, so they do not change.configs/trl/{sft,dpo}.yamlshow the new options.Type of change
Validation
tests/test_lr_scheduler.py(36 tests) builds each scheduler throughSFTConfigandTrainer.create_scheduler, checks the WSD LR curve and the ratio-to-steps conversion, and checks each rejection. The tests pass with TRL 1.7.0 and TRL 1.17.1. The pre-commit hooks pass. A real training run was not done.