Skip to content

PP env GA test: compare the trained adapter at 5e-5 - #16457

Merged
danielhanchen merged 1 commit into
mainfrom
dh/pp-env-adapter-tol
Nov 2, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
dh/pp-env-adapter-tol

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Repo tests (CPU, gloo-tp-pp) failed on #16444 and #16451 in tests/test_pp_env_gloo.py, which #16407 added. Neither PR touches pipeline parallel. Both failures are the same case, with an identical value:

test_pp_env_gradient_accumulation_and_microbatches[gemma3_ga1_bs4]
base_model.model.model.layers.0.mlp.gate_proj.lora_A.weight: Tensor-likes are not close!
Mismatched elements: 1 / 64 (1.6%)
Greatest absolute difference: 1.5791505575180054e-05 at index (2, 2) (up to 1e-05 allowed)

The identical value means the result depends on the runner's CPU, not on chance, so any run that lands on that runner type fails.

The adapter comparison runs after several optimizer steps, so it carries the fp32 reduction-order noise of a 2-stage split against the single-process reference. The file already records that noise for the grad norms ("3e-5 absolute ... between two identical reference runs"). On this host, the largest adapter difference across all five cases of the test is 3.7e-6, which is why 1e-5 looked safe.

Change

tests/test_pp_env_gloo.py: in test_pp_env_gradient_accumulation_and_microbatches only, the trained-adapter comparison takes atol = 5e-5, about 3x the CI value. rtol is unchanged, and so is every other _same_tensors call: save_pretrained, Trainer.save_model and export.

The _close call just before it is also unchanged. It pins the step count and every loss at rel 1e-5. It pins the first grad norm at rel 1e-5 and the rest at 1e-4.

Testing

  • tests/test_pp_env_gloo.py: 14 passed, 1 skipped.
  • Sabotage: I temporarily scaled every lora_A by 1 + 1e-4 in the pipeline-parallel ranks only. [ga1_bs4] and [gemma3_ga1_bs4] both still fail, as they do at 1 + 1e-3. So a real divergence much smaller than any pipeline bug would be still fails the test.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-02T05:36:18.279301Z 23a3e28 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 23a3e28f9c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@danielhanchen
danielhanchen merged commit d4dcba7 into main Nov 2, 2026
@danielhanchen
danielhanchen deleted the dh/pp-env-adapter-tol branch November 2, 2026 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant