Repository navigation
CP towers gloo test: compare in float64 so CPU kernel rounding cannot flake it - #17980
Merged
Merged
Conversation
Member
Author
|
@codex review |
Codex Review Summary: ✅ CompletedThis 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. |
Member
Author
|
@codex review |
|
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.
Summary
tests/test_cp_ulysses_media_towers_gloo.py::test_gemma4_with_towers_matches_one_process(added in #17930) fails intermittently in theRepo tests (CPU, gloo)job, always on a layer 0 attention projection. With the mismatch report from #17972 the latest failure reads:That is float32 rounding, not a context parallel bug. Layer 0 gradients go through every layer of backprop and are summed in a different order on either side of the shard seam. Running the same versions as CI (torch 2.10.0+cpu, transformers 5.17.0), the worst parameter on this host is k_proj at 0.62x the tolerance on every run, and the runners whose CPU kernels round differently hit 1.33x.
Change
The test now builds the tiny Gemma 4 model in float64 instead of float32. It checks attention routing with the towers present, so precision is not what it measures. The tolerance is unchanged. In float64 the worst parameter (the same k_proj) is at 0.012x the tolerance, so there is about 80x headroom where float32 had very little.
Verification
tests/test_cp_ulysses_media_towers_gloo.py: 2 passed.manager.attach_attention_hooks(model)in the worker fails at the same tolerance onembed_tokens.weightwith 3047 / 3072 elements mismatched and a greatest absolute difference of 2.37. That means the tight tolerance still catches real routing errors.