MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / __init__

Method __init__

deepspeed/runtime/python_gc.py:16–24  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

14 """Coordinate process-wide GC state across multiple DeepSpeed engines."""
15
16 def __init__(self):
17 self._lock = RLock()
18 self._active_engines = 0
19 self._restore_enabled = False
20 self._generation = 0
21 if hasattr(os, "register_at_fork"):
22 os.register_at_fork(before=self._before_fork,
23 after_in_parent=self._after_fork_parent,
24 after_in_child=self._after_fork_child)
25
26 def _before_fork(self):
27 self._lock.acquire()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected