Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
[ghstack-poisoned]
  • Loading branch information
fegin committed Feb 26, 2025
1 parent 6368448 commit 206df62
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions torchtitan/components/checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,12 +314,13 @@ def __init__(
)

def __del__(self):
if self.enable_checkpoint and self.mp and self.mp.is_alive():
self.mp_queue_send.put(Terminate())
self.mp.join()
if self.purge_thread and self.purge_thread.is_alive():
self.purge_queue.put(Terminate())
self.purge_thread.join()
if self.enable_checkpoint
if self.mp and self.mp.is_alive():
self.mp_queue_send.put(Terminate())
self.mp.join()
if self.purge_thread and self.purge_thread.is_alive():
self.purge_queue.put(Terminate())
self.purge_thread.join()

@torch.no_grad()
def save(self, curr_step: int, force: bool = False) -> None:
Expand Down

0 comments on commit 206df62

Please sign in to comment.