Implement Warmup-Stable-Decay (WSD) Learning Rate Schedule #2883
+180
−31
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.
Description
This PR implements the Warmup-Stable-Decay (WSD) learning rate schedule as a configurable option alongside the existing Cosine schedule. This allows users to choose between the standard cosine decay and a schedule that maintains a stable peak learning rate for the majority of training before a linear decay.
Details and Context:
src/MaxText/configs/base.ymlto introducelr_schedule_type(defaulting to'cosine') and WSD-specific parameters:wsd_learning_rate_final_fractionandwsd_decay_steps_fraction.src/MaxText/configs/types.pyto include aLearningRateScheduleTypeEnum and validation logic in theOptimizerclass.create_learning_rate_scheduleinsrc/MaxText/maxtext_utils.pyto generate the schedule usingoptaxbased on the selected type.Tests
I have added a new test suite,
TestLearningRateSchedules, intests/maxtext_utils_test.pyto verify the logic.cosineandwsdschedules generate correct learning rate values at specific steps (warmup, stable, decay, and end phases).ValueError.To reproduce/test:
Fixes: #2882
Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.