Skip to content

Gloo two-rank precision test: ranks leave together and skip interpreter teardown - #19070

Merged
danielhanchen merged 1 commit into
mainfrom
fix/gloo-child-orderly-exit
Nov 23, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix/gloo-child-orderly-exit

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

(Python 3.13, diffusion) still occasionally fails studio/backend/tests/test_diffusion_ddp_effective_precision.py::test_real_gloo_two_ranks. With the diagnostics from #19044, the latest occurrence (the staging run for #18925, on a base that has #19044) says where it hangs:

Failed: the two Gloo ranks did not finish within 180 s:
rank 0 rc=0
stdout:
[Gloo] Rank 0 is connected to 1 peer ranks. Expected number of connected peer ranks is : 1
REFUSED Multi-GPU training stopped: the GPUs ended up training different base precisions after conversion (rank 0: fp8, rank 1: bf16). ...
rank 1 rc=-9
stdout:
[Gloo] Rank 1 is connected to 1 peer ranks. Expected number of connected peer ranks is : 1
REFUSED Multi-GPU training stopped: the GPUs ended up training different base precisions after conversion (rank 0: fp8, rank 1: bf16). ...

Root cause

The test's child script, not diffusion_ddp. Both ranks run the precision check and print the correct verdict; rank 0 then exits, and rank 1 never does: it hangs at interpreter exit, in the teardown of a Gloo process group whose peer has already gone. The child never leaves the group itself. The trainer does not have this problem: DistContext.close() destroys the group on a bounded thread for exactly this reason ("a communicator whose peers already exited must not hold up the trainer child").

Fix

studio/backend/tests/test_diffusion_ddp_effective_precision.py only. After printing its verdict, each rank:

An exception anywhere before that still propagates and gives a nonzero exit, which the parent reports with both ranks' output.

Testing

  • The file: 17 passed, three runs in a row, and under -n 2.
  • The hang does not reproduce on a quiet host (each case takes about 1.5 s here), so the evidence for the cause is the rank report above.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T13:07:27.209698Z 725d1f2 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. Keep them coming!

Reviewed commit: 725d1f2ded

ℹ️ 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 51b2b0e into main Nov 23, 2026
@danielhanchen
danielhanchen deleted the fix/gloo-child-orderly-exit branch November 23, 2026 13:09
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