MCPcopy Create free account
hub / github.com/apple/axlearn / _gc_loop

Method _gc_loop

axlearn/common/checkpointer.py:1093–1101  ·  view source on GitHub ↗

Starts garbage collection loop. Will block the current thread.

(self, *, context_stack: list[InvocationContext])

Source from the content-addressed store, hash-verified

1091 logging.info("gc_thread finished")
1092
1093 def _gc_loop(self, *, context_stack: list[InvocationContext]):
1094 """Starts garbage collection loop. Will block the current thread."""
1095 cfg: Checkpointer.Config = self.config
1096 install_context_stack(context_stack)
1097 while True:
1098 if self._gc_stopping.wait(timeout=cfg.gc_loop_interval_seconds):
1099 break
1100 self._run_garbage_collection()
1101 logging.info("GC loop done")
1102
1103 def ckpt_dir(self, step: int) -> str:
1104 """Obtains the checkpoint dir for the given step."""

Callers

nothing calls this directly

Calls 2

install_context_stackFunction · 0.90

Tested by

no test coverage detected