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

Method unregister

deepspeed/runtime/engine.py:484–495  ·  view source on GitHub ↗
(self, state)

Source from the content-addressed store, hash-verified

482 return grad
483
484 def unregister(self, state):
485 with self._lock:
486 if not state.active:
487 return
488 for graph_task_id in state.graph_task_ids:
489 refcount = self._graph_task_refcounts[graph_task_id] - 1
490 if refcount:
491 self._graph_task_refcounts[graph_task_id] = refcount
492 else:
493 del self._graph_task_refcounts[graph_task_id]
494 state.active = False
495 self._active_states.remove(state)
496
497 def is_current_graph_registered(self):
498 graph_task_id = torch._C._current_graph_task_id() if self.supported() else -1

Callers 1

backwardMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected