Skip to content

Commit 8894f6c

Browse files
authored
fix(torch): add barrier before process group destruction in training example (#76)
1 parent 033f7c0 commit 8894f6c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

advanced/pytorch-example/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ def transform(example):
8484
torch.save(model.module.state_dict(), "mnist_model.pth")
8585
print("Model saved as mnist_model.pth")
8686

87+
dist.barrier()
8788
dist.destroy_process_group()
8889

8990
if __name__ == "__main__":

0 commit comments

Comments
 (0)