[Core][Test] move local_rank to the last arg with default value(#3711)

[Core][Test] move local_rank to the last arg with default value to keep api compatible (#3711)
This commit is contained in:
youkaichao
2024-03-28 21:19:45 -07:00
committed by GitHub
parent 395aa823ea
commit 756b30a5f3
7 changed files with 24 additions and 14 deletions

View File

@@ -14,7 +14,9 @@ def distributed_run(fn, world_size):
for i in range(number_of_processes):
env = os.environ.copy()
env['RANK'] = str(i)
env['LOCAL_RANK'] = str(i)
env['WORLD_SIZE'] = str(number_of_processes)
env['LOCAL_WORLD_SIZE'] = str(number_of_processes)
env['MASTER_ADDR'] = 'localhost'
env['MASTER_PORT'] = '12345'
p = multiprocessing.Process(target=fn, args=(env, ))