Skip to content

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

Open
Xayar145 wants to merge 1 commit into
open-compass:mainfrom
Xayar145:fix/local-rank-default-distributed-indexing
Open

fix(distributed): default LOCAL_RANK to 0 instead of 1 in run.py#1650
Xayar145 wants to merge 1 commit into
open-compass:mainfrom
Xayar145:fix/local-rank-default-distributed-indexing

Conversation

@Xayar145

Copy link
Copy Markdown

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.

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