Repository navigation
TP Trainer parity tests: keep eps 1e-4 to the UNSLOTH_TP_SIZE runs, native Trainer runs back on the default - #15397
Merged
Merged
Conversation
…ative Trainer runs back on the default
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
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.
Problem
#15381 set
adam_epsilon = 1e-4in the shared_trainer_argsoftests/test_tp_native_gloo.py. That fixed the three UNSLOTH_TP_SIZE Trainer tests intest_tp_env_gloo.py, but on the CI runners it broke the two native Trainer tests that use the same helper. Comparing theglooshard before and after (both on current-main bases):test_trainer_trains_a_tensor_parallel_model_like_one_process[1-2]/[2-2]test_env_tp2_*(3 tests)lora_Astate (rtol = 1e-4, atol = 1e-6)On this host both groups pass at both settings. The runners' CPUs round differently from this machine, and I could not emulate theirs here:
ATEN_CPU_CAPABILITY=avx2aborts the spawned ranks withbuffer overflow detected. So the CI table above is the evidence for which eps each group needs.The two groups differ in their adapters. The env tests use
init_lora_weights = False, where every factor gets a real gradient from step 1; that is where the default eps amplifies reduction-order noise, as measured in #15381. The native tests use the defaultB = 0start, wherelora_A's gradients are tiny for the first steps. There, eps 1e-4 sits inside their range and moveslora_Adifferently on the two arms.Fix
_trainer_argsgoes back to AdamW's default eps, so the native Trainer tests run as they did when they passed on CI.test_tp_env_gloo.pypassesadam_epsilon = 1e-4only at its own training call, with the measurement and the reason in a comment.Tolerances are unchanged.
Verification
tests/test_tp_env_gloo.pyandtests/test_tp_native_gloo.py: 52 passed on this host.Repo tests (CPU, gloo)shard is the check on runner hardware. Both groups should pass there.Not covered here
test_tp2_x_fsdp2_dp2_matches_one_process[phi3-True-None]also fails in both CI runs above, by 6.9e-5 to 7.7e-5 relative on grad norms (tolerance 1e-5), and passes on this host. It only became visible after #15355: before that, thephi3cases errored on the removed tiny model. It uses its own hand-written loop (eps 1e-6), not_trainer_args, so this change does not touch it.