Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion test/test_train_mp_imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
import torch_xla.distributed.parallel_loader as pl
import torch_xla.debug.profiler as xp
import torch_xla.utils.utils as xu
import torch_xla.core.xla_env_vars as xenv
import torch_xla.core.xla_model as xm
import torch_xla.distributed.xla_multiprocessing as xmp
import torch_xla.test.test_utils as test_utils
Expand Down Expand Up @@ -375,6 +376,6 @@ def _mp_fn(index, flags):

if __name__ == '__main__':
if dist.is_torchelastic_launched():
_mp_fn(FLAGS)
_mp_fn(xu.getenv_as(xenv.LOCAL_RANK, int), FLAGS)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is set by torchrun, right? Just confirming my understanding.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes

else:
xmp.spawn(_mp_fn, args=(FLAGS,), nprocs=FLAGS.num_cores)