(self)
| 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() |
nothing calls this directly
no outgoing calls
no test coverage detected