Skip to content

Commit

Permalink
torchrun for DDP
Browse files Browse the repository at this point in the history
  • Loading branch information
wenzhangliu committed Sep 20, 2024
1 parent df5cf7c commit 046666c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xuance/torch/agents/base/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def finish(self):
if self.distributed_training:
if dist.get_rank() == 0:
if os.path.exists(self.learner.snapshot_path):
os.remove(os.path.join(self.learner.snapshot_path, "snapshot.pt"))
if os.path.exists(os.path.join(self.learner.snapshot_path, "snapshot.pt")):
os.remove(os.path.join(self.learner.snapshot_path, "snapshot.pt"))
os.removedirs(self.learner.snapshot_path)
destroy_process_group()

0 comments on commit 046666c

Please sign in to comment.