Repository navigation
Accept warmup_num_steps=0 in the warmup LR schedulers again - #8804
Draft
vineethsaivs wants to merge 1 commit into
Draft
vineethsaivs wants to merge 1 commit into
vineethsaivs wants to merge 1 commit into
Conversation
The positive-integer check from deepspeedai#8126 rejects 0, which HF Trainer writes into "warmup_num_steps": "auto" whenever no warmup is set. Before that check, 0 was clamped to 2 like 1. Reject only negative values so 0 keeps that behavior. Signed-off-by: Vineeth Sai <vineethsai4444@gmail.com>
vineethsaivs
force-pushed
the
fix/warmup-schedulers-zero-steps
branch
from
November 29, 2026 08:42
bc71e0e to
8c4806e
Compare
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.
WarmupLR,WarmupDecayLRandWarmupCosineLRraiseValueError: warmup_num_steps must be a positive integer, got 0since 0.19.3. HF Trainer writes 0 into"warmup_num_steps": "auto"when no warmup is set, so those runs fail at startup on transformers before 5.18 (5.18 works around it withmax(1, ...)in huggingface/transformers#48640). HodeTech/ForgeLM#502 hit this.Cause: #8126 added a
<= 0check. Before it, 0 was valid andmax(2, warmup_num_steps)clamped it to 2, the same as 1.Fix: Reject only negative values in both checks, so 0 behaves as before.
Noneand negative values still raise.Test: New
test_warmup_schedulers_accept_zero_warmup_num_stepschecks that 0 gives the same LRs as 2 for all three schedulers. It fails on master with that ValueError and passes after.test_lr_schedulers.pypasses (91 tests, CPU). yapf and flake8 are clean.