Skip to content

fix(distributed): default LOCAL_RANK to 0 instead of 1 in run.py - #1650

Merged
ssiq merged 2 commits into
open-compass:mainfrom
Xayar145:fix/local-rank-default-distributed-indexing
Sep 23, 2026
Merged

ssiq merged 2 commits into
open-compass:mainfrom
Xayar145:fix/local-rank-default-distributed-indexing

Conversation

@Xayar145

Copy link
Copy Markdown
Contributor

Description

Fixes LOCAL_RANK default value in run.py:

  • In run.py, LOCAL_RANK was defaulting to 1 (int(os.environ.get("LOCAL_RANK", 1))), whereas RANK defaults to 0, WORLD_SIZE defaults to 1, and LOCAL_WORLD_SIZE defaults to 1.
  • When launchers or custom multi-process scripts initialize processes without explicitly exporting LOCAL_RANK for rank 0, process 0 calculated DEVICE_START_IDX = GPU_PER_PROC * 1 instead of 0, binding to GPU 1 and causing device collision.
  • Fixed the default value to 0, matching standard distributed environment conventions.

@ssiq
ssiq added this pull request to the merge queue Sep 23, 2026
Merged via the queue into open-compass:main with commit 17f47f1 Sep 23, 2026
11 checks passed
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.

2 participants