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

Method unregister

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

Source from the content-addressed store, hash-verified

483 return grad
484
485 def unregister(self, state):
486 with self._lock:
487 if not state.active:
488 return
489 for graph_task_id in state.graph_task_ids:
490 refcount = self._graph_task_refcounts[graph_task_id] - 1
491 if refcount:
492 self._graph_task_refcounts[graph_task_id] = refcount
493 else:
494 del self._graph_task_refcounts[graph_task_id]
495 state.active = False
496 self._active_states.remove(state)
497
498 def is_current_graph_registered(self):
499 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