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

Method stop

deepspeed/utils/timer.py:60–71  ·  view source on GitHub ↗

Stop the timer.

(self, reset=False, record=False)

Source from the content-addressed store, hash-verified

58 self.started_ = True
59
60 def stop(self, reset=False, record=False):
61 """Stop the timer."""
62 assert self.started_, "timer is not started"
63 if self.use_host_timer:
64 self.end_time = time.time()
65 else:
66 if self.stop_event is None:
67 event_class = get_accelerator().Event
68 self.stop_event = event_class(enable_timing=True)
69 self.stop_event.record()
70 self.read_pending = True
71 self.started_ = False
72
73 def _read_latest(self):
74 if not self.read_pending:

Callers

nothing calls this directly

Calls 2

get_acceleratorFunction · 0.90
recordMethod · 0.45

Tested by

no test coverage detected