Skip to content

TP host embedding gloo test: barrier before rank 0 tears down the store (intermittent Broken pipe) - #18115

Merged
danielhanchen merged 1 commit into
mainfrom
ci-tp-embed-gloo-final-barrier
Nov 17, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci-tp-embed-gloo-final-barrier

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

tests/test_tp_host_input_embedding_gloo.py::test_tp_narrower_than_world_keeps_the_embedding (added in #18068) fails intermittently in the Repo tests (CPU, gloo-tp-env) shard, seen on the staging run of #18106 (a frontend-only PR):

[rank1] TCPStore.cpp:106 sendBytes failed ...: Broken pipe
  File "tests/test_tp_host_input_embedding_gloo.py", line 107, in _case_world_wider_than_tp
    mesh = init_device_mesh("cpu", (world, 1), mesh_dim_names = ("dp", "tp"))
torch.distributed.DistNetworkError: Broken pipe
E   AssertionError: rank exit codes [0, 1]

Cause

In the dp_x_tp case each rank builds a (world, 1) mesh, so its tp group has one member and rank 0 never waits for rank 1. Rank 0 hosts the TCPStore, finishes, destroys its process group and exits. If rank 1 is still creating its mesh groups through that store, its next store write hits a closed socket. The TP code is fine; the test worker let rank 0 leave first.

Fix

The worker calls dist.barrier() after a case has saved its result, before destroy_process_group(), so no rank tears the store down while another still uses it. On a failure path nothing changes.

Verification

  • Rank 1 delayed by 3 s before init_device_mesh (local only, not committed):
    • main: rank exit codes [0, 1] with the same Broken pipe as CI.
    • this branch: passes.
  • Whole file: 5 passed.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 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-17T08:44:31.805858Z a6b5ea1 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. Can't wait for the next one!

Reviewed commit: a6b5ea1f2e

ℹ️ 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 6ae43cd into main Nov 17, 2026
@danielhanchen
danielhanchen deleted the ci-tp-embed-gloo-final-barrier branch November 17, 2026 08:44
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