You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# No previous checkpoint size to estimate, do nothing.
647
+
return
648
+
649
+
def_mb_size(num_bytes):
650
+
returnf"{num_bytes/1024/1024:.2f} MB"
651
+
652
+
try:
653
+
stat=shutil.disk_usage(output_dir)
654
+
free_bytes=stat.free
655
+
needed_bytes=checkpoint_size*warn_steps_ahead
656
+
657
+
log_rank_0(
658
+
f"Disk space info: free={_mb_size(free_bytes)}, last_checkpoint_size={_mb_size(checkpoint_size)} (output_dir={output_dir})"
659
+
)
660
+
iffree_bytes<needed_bytes:
661
+
log_rank_0(
662
+
f"Estimated free disk space ({_mb_size(free_bytes)}) is less than the estimated size of the next {warn_steps_ahead} checkpoints ({_mb_size(needed_bytes)}). "
663
+
"The next checkpoint(s) may fail due to insufficient disk space.",
664
+
level=logging.WARNING,
665
+
)
666
+
exceptExceptionase:
667
+
log_rank_0(
668
+
f"Could not check disk space after checkpoint: {e}",
0 commit comments