Repository navigation
fix(nightly): check nano35 logprob-error tails at every step - #4593
Draft
fujial-code wants to merge 3 commits into
Draft
fujial-code wants to merge 3 commits into
fujial-code wants to merge 3 commits into
Conversation
Adapt the tail metrics and plotting fix from Jonas Yang in PR #4459. Keep the existing 20-step convergence schedule and require complete, finite per-step metrics with provisional P99.9 and severe-token-count limits. Co-authored-by: Jonas Yang <[email protected]> Signed-off-by: fujial <[email protected]>
Contributor
Author
|
/ok to test 437be36 |
Prevent rare NaN/Inf loss-token errors from escaping the percentile and count gates. Cover masked values and the strict 10-nat boundary. Retain the per-step limits with evidence from 60 reconstructed H100 training batches. Signed-off-by: fujial <[email protected]>
Contributor
Author
|
/ok to test 3130dad |
Signed-off-by: fujial <[email protected]>
Contributor
Author
|
/ok to test 233f48c |
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.
What does this PR do?
Check logprob-error tails at every step of the Nano 3.5 DAPO nightly. A few finite outliers dominate the existing mean of exp(abs(logprob error)), making the final-step and median-of-step-means assertions unreliable. Adapt Jonas Yang's metrics from #4459 to require both conditions at each of steps 1–20:
num_tokens_logprob_error_above_10_natstoken_mult_prob_error_p999Check all steps together after training, requiring both metrics at exactly steps 1–20 and finite values. Any NaN/Inf error on a valid loss token now makes the percentile infinite: a single non-finite token must not disappear into the excluded 0.1% tail or fit under the severe-token allowance. Masked-out values remain excluded. This does not introduce a training-time abort.
Keep 20 training steps, the 240-minute limit, step-20 accuracy >0.4, and mean generation KL <0.001. Retain #4459's correction to the worst-sample plot, which previously selected samples with no loss tokens.
Threshold evidence
#4459 reports P99.9 of 1.407–1.501 and 0–2 severe tokens per step in two 20-step runs. I additionally reconstructed both metrics from all 60 saved training batches of the three complete 4×8 H100 Nano runs used for #4569 validation:
These are new offline measurements of existing GPU runs, not newly launched training runs of this PR. The runs used
rl.72105789.sqsh; the eager source was8bf6bd4bafc05ca29cf34981ad9c378fa38db72dand PIECEWISE source was70ebabebad4817bf532bee4244b964d7e9080d72. The eager recipe differs from this PR's recipe only in thedtensor_cfg→automodel_cfgrename, but source/dependency revisions differ. Treat the modes separately; they are not three identical repeats of the current PR.Reconstruction uses float32 subtraction, the serialized
token_loss_mask * sample_loss_mask, and nearest-rank P99.9. It covers 77,400,772 valid tokens, with 1,069,905–1,612,237 per step. Reconstructed mean probability error agrees with the original logged metric within 2.52e-7 relative error, independently checking masking/alignment. All eight actual nightly expressions pass on each reconstructed run.The severe-token counts were zero at 50 steps, one at nine steps, and two at one step. A cap of one rejects an observed step; caps of two, three, five, and ten all pass these observations. Keep three as the existing proposal: the observed maximum of two plus one token of headroom. There is no measured need to loosen it to ten. Likewise, 1.55 leaves margin above both the reconstructed maximum (1.4963) and #4459's reported maximum (1.501); a 1.50 gate would reject the latter. These are empirical recipe-specific bounds, not a statistical guarantee of a nightly failure rate. Recalibrate if token volume, runtime, or model configuration changes.
Both PIECEWISE runs failed the old final-step mean gate and pass these tail gates. This is the intended tolerance for a small number of finite spikes; it does not establish numerical equivalence of eager and graph execution or prove the spikes harmless.
Validation
Current head
233f48cc44b59dad2ce55b75c64b1dae8ad3cd7cmerges maind8b376aa. Fresh CI run: branch freshness, lint, documentation build/linkcheck, and automatic test approval pass. H100 image build is queued awaiting thenemo-ci-aws-gpu-x2runner; the full CI result is pending.Current-head CPU preflight: 466 passed, 1 skipped (CUDA unavailable), job 19952832. Image
rl.72628646.sqshmatches this checkout’suv.lock,pyproject.toml, and Automodel submodule (72daceffa54d77783e1f73a5ac165eb39b6b5ea1).Full 4×8 H100, 20-step nightly submitted as job 19952844, with a 240-minute allocation. Its preflight completed successfully; the job is pending Slurm resource scheduling (
Priority). It uses the unchanged recipe and all eight nightly gate expressions; only external W&B upload is disabled. GPU results remain pending.Existing head
437be364393a731e22624331122635c10d6e350d: latest CI run has 42 successful and 10 skipped jobs, including all 27 L0 unit-test jobs, lint, docs, and the CI quality check. The earlier cancelled run is superseded.Reconstructed all 60 steps from preserved token-level logs and applied the nightly script's actual expressions, including original accuracy and KL gates: all three runs pass. Source-file SHA256 digests and per-step results are retained with local validation artifacts.
Added regression coverage for a single NaN/+Inf/-Inf among 2,000 valid tokens, exclusion of masked non-finite values, and the strict >10-nat boundary.
Local CPU validation: 461 passed, 1 skipped (CUDA unavailable), covering the complete GRPO, utility, logger, metric-checker, and recipe/suite test files; no test-fixture bypass. Job 19950980 used
rl.72126403.sqsh, which providesnemo.lens. This convenience image is not lockfile/submodule-identical to the checkout, so this does not replace target-runtime GPU validation.Ruff 0.9.9 lint and format checks, shell syntax, and whitespace checks pass.
Related work and remaining validation
Split from #4459 and adapted from Jonas Yang's implementation. The release-only minimum fix #4592 has merged. This PR targets
main, independently of router replay (#4458).Keep this PR in Draft until the final code passes CI and a fresh 20-step GPU nightly validates logging/collection end to end on the target runtime. The threshold evidence above supports retaining ≤3 and <1.55; it does not replace that final runtime check.