Skip to content

Commit

Permalink
[TorchTitan] Add destory process group at the end of training (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
wz337 authored Apr 12, 2024
1 parent 2636cac commit c0b5ce2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import torch
import torch.nn.functional as F
from torch.distributed import destroy_process_group
from torch.distributed.elastic.multiprocessing.errors import record
from torch.distributed.tensor.parallel import loss_parallel

Expand Down Expand Up @@ -387,6 +388,8 @@ def loss_fn(pred, labels):
)

metric_logger.close()
logger.info("Training completed.")
destroy_process_group()


if __name__ == "__main__":
Expand Down

0 comments on commit c0b5ce2

Please sign in to comment.