def setup_mpi_gpus():
if '<STR_LIT>' not in os.environ:<EOL><INDENT>if sys.platform == '<STR_LIT>': <EOL><INDENT>ids = []                 <EOL><DEDENT>else:<EOL><INDENT>lrank, _lsize = get_local_rank_size(MPI.COMM_WORLD)<EOL>ids = [lrank]<EOL><DEDENT>os.environ["<STR_LIT>"] = "<STR_LIT:U+002C>".join(map(str, ids))<EOL><DEDENT>
Set CUDA_VISIBLE_DEVICES to MPI rank if not already set