Skip to content

Don't set a device per rank for gloo tensor-parallel tests - #49636

Merged
vasqu merged 2 commits into
mainfrom
tp-test-gloo-cpu-ranks
Oct 15, 2026
Merged

vasqu merged 2 commits into
mainfrom
tp-test-gloo-cpu-ranks

Conversation

@IlyasMoutawwakil

@IlyasMoutawwakil IlyasMoutawwakil commented Oct 15, 2026 •

Copy link
Copy Markdown
Member

🤗 Transformers CI

Fixes test_dispatch_hands_experts_the_received_rows in today's daily CI (bisected to #49421).

The test spawns 2 gloo ranks on CPU, but _global_wrapper still sets the accelerator device to the rank index, so rank 1 fails with invalid device ordinal on the single-GPU runner. Gloo ranks now skip it.

Reproduced with CUDA_VISIBLE_DEVICES=0: fails on main, passes with this.

🤖 Generated with Claude Code

Gloo ranks run on CPU, and the single-GPU runner has fewer devices than ranks: rank 1 failed with an invalid device ordinal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread tests/test_tensor_parallel_mixin.py Outdated
Comment on lines +126 to +127
if backend != "gloo":
_set_rank_device(rank)

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.

hmm im surprised because set rank device should already check whether gloo / cpu is there

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it checks the device type, not the backend, so on the gpu runner it still did set_device_index(rank) for this gloo test → invalid device ordinal on rank 1. moved the guard into _set_rank_device (takes the backend now) so it lives in one place

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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

CI recap

Dashboard: View test results in Grafana
Latest run: 38734857749:1
Result: success | Jobs: 15 | Tests: 200,780 | Failures: 0 | Duration: 13h 27m

@vasqu
vasqu added this pull request to the merge queue Oct 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Oct 15, 2026
@IlyasMoutawwakil
IlyasMoutawwakil added this pull request to the merge queue Oct 15, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 15, 2026
@vasqu
vasqu added this pull request to the merge queue Oct 15, 2026
@vasqu
vasqu removed this pull request from the merge queue due to a manual request Oct 15, 2026
@vasqu
vasqu merged commit 276d3fa into main Oct 15, 2026
113 checks passed
@vasqu
vasqu deleted the tp-test-gloo-cpu-ranks branch October 15, 2026 13:48
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