Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions tests/pytorch/distributed/test_fusible_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def world_group() -> torch.distributed.ProcessGroup:
init_method=f"file://{os.environ['NVTE_TEST_RDZV_PATH']}",
world_size=world_size,
rank=rank,
device_id=torch.device("cuda", rank),
)
return group

Expand Down Expand Up @@ -1124,10 +1125,16 @@ def main() -> None:
if args.compile and not args.parallel:
parser.error("--compile requires --parallel")
if args.parallel:
if args.compile:
run_compile_parallel_tests()
else:
run_parallel_tests()
try:
if args.compile:
run_compile_parallel_tests()
else:
run_parallel_tests()
torch.distributed.barrier(world_group())
torch.cuda.synchronize()
Comment thread
timmoon10 marked this conversation as resolved.
finally:
if torch.distributed.is_initialized():
torch.distributed.destroy_process_group()
Comment thread
timmoon10 marked this conversation as resolved.


if __name__ == "__main__":
Expand Down
1 change: 1 addition & 0 deletions tests/pytorch/distributed/test_parallel_cross_entropy.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def _run_tensor_parallel(rank, world_size, init_file, label_smoothing):
init_method=f"file://{init_file}",
rank=rank,
world_size=world_size,
device_id=device,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would be good to understand why device_id needs to be set manually.

@timmoon10 and I had offline discussion regarding this. It might be because this particular test doesnt use torchrun like other tests do, and so the device is not auto-set to "cuda:rank" like other tests

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I do actually have a diff already that changes this test to torchrun to avoid this. Can make PR today. @timmoon10

)
try:
generator = torch.Generator().manual_seed(2025)
Expand Down
Loading