test: disable classifier dropout in the tiny Qwen2 test checkpoint - #4000
Open
tigist-far wants to merge 1 commit into
Open
tigist-far wants to merge 1 commit into
tigist-far wants to merge 1 commit into
Conversation
test_dtensor_value_worker.py::test_value_worker_train_decreases_loss fails intermittently: 5 of 100 runs on a 2-GPU pod with the CI image. The regression value head is a Qwen2ForTokenClassification head, and HF applies its 0.1 default dropout to it because Qwen2Config defines neither classifier_dropout nor hidden_dropout. The test compares losses across three steps at lr 5e-6 on a fixed batch, where the genuine change (about -2.6e-4) is smaller than the per-step dropout noise (sd about 6.4e-4), so the 1e-3 tolerance fails in a ~5% tail. Save classifier_dropout: 0.0 into the tiny Qwen2 test checkpoint. Only classification heads read the key, so its causal-LM consumers are unaffected, and the checkpoint config is the one place the value can live: from_pretrained ignores keyword overrides for attributes the config lacks. With the loss a function of the parameters alone, the same 100-run series passed 100 of 100 with a monotone decrease in every run (step sd about 3.7e-5); the full dtensor and Megatron value modules pass against the changed asset. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Tigist Diriba <tigist@far.ai>
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.
What does this PR do ?
Saves
classifier_dropout: 0.0into the tiny Qwen2 test checkpoint so the value-head tests train without HF's default 0.1 dropout, which madetest_value_worker_train_decreases_lossflaky (about 1 failure in 20 runs).Issues
#3999
Usage
Not applicable: test-asset change only.
Before your PR is "Ready for review"
Pre checks:
Additional Information
Why the test was flaky. The regression value head is a
Qwen2ForTokenClassificationhead.GenericForTokenClassificationbuildsnn.Dropout(classifier_dropout)and falls back to 0.1 when the model config defines neitherclassifier_dropoutnorhidden_dropout;Qwen2Configdefines neither. The test trains three steps atlr=5e-6on a fixed batch and assertslosses[-1] <= losses[0] + 1e-3. Over two steps the genuine change is about -2.6e-4, while the dropout noise per step has a standard deviation of about 6.4e-4, so the tolerance sits inside the noise.Measured on the same 2-GPU environment, 100 runs each, one fresh process per run:
The training signal is unchanged; only the noise is gone.