Skip to content

Create the continuous batching CPU group with local synchronization - #48302

Merged
remi-or merged 4 commits into
mainfrom
fix-cb-tp-subgroup
Aug 26, 2026
Merged

remi-or merged 4 commits into
mainfrom
fix-cb-tp-subgroup

Conversation

@qgallouedec

@qgallouedec qgallouedec commented Aug 25, 2026 •

Copy link
Copy Markdown
Member

CPU CI GPU run-slow

What does this PR do?

Part of #48294.

DistributedHelper creates the TP CPU (gloo) group with a plain dist.new_group, which requires every rank of the default group to participate in the call. That holds when the TP group spans the whole world (the current CB TP setup), but not when the TP group is a subset: with one CB manager per node and data parallelism across nodes (16 ranks, two 8-rank TP groups), the two concurrent per-subset calls deadlock in gloo's connectFullMesh until timeout:

RuntimeError: Gloo connectFullMesh failed with ... Connect timeout

Change: pass use_local_synchronization=True when the TP group is a strict subset of the world, restricting group creation to the member ranks. The world-spanning case keeps the current call unchanged.

Validation: a 2-node run (TP sharding within each node, weights replicated across nodes, gradients all-reduced across nodes, both nodes generating with CB while training) deadlocks before and works after, on Qwen3-0.6B (TP8 x DP2) and Qwen3-30B-A3B (TP4 x DP2).

Who can review?

@remi-or (continuous batching)

qgallouedec and others added 3 commits August 25, 2026 05:44
DistributedHelper creates the TP CPU (gloo) group with a plain new_group, which requires every
rank of the default group to participate in the call. When the TP group is a subset of the world
(one continuous batching manager per node, data parallelism across nodes), the concurrent
per-subset calls deadlock in gloo's connectFullMesh until timeout. use_local_synchronization
restricts the creation to the group members, which is exactly the situation here; for the
world-spanning TP case it is a no-op behavior-wise.
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 32874872589:1
Result: success | Jobs: 2 | Tests: 25 | Failures: 0 | Duration: 2m 36s

@remi-or remi-or left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks!

@remi-or
remi-or added this pull request to the merge queue Aug 26, 2026
Merged via the queue into main with commit dabae5f Aug 26, 2026
112 checks passed
@remi-or
remi-or deleted the fix-cb-tp-subgroup branch August 26, 2026 14:56
sbucaille pushed a commit to sbucaille/transformers that referenced this pull request Sep 16, 2026
…uggingface#48302)

* Create the continuous batching CPU group with local synchronization

DistributedHelper creates the TP CPU (gloo) group with a plain new_group, which requires every
rank of the default group to participate in the call. When the TP group is a subset of the world
(one continuous batching manager per node, data parallelism across nodes), the concurrent
per-subset calls deadlock in gloo's connectFullMesh until timeout. use_local_synchronization
restricts the creation to the group members, which is exactly the situation here; for the
world-spanning TP case it is a no-op behavior-wise.

* Trim comment
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.

3 participants