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

Method start

deepspeed/utils/timer.py:46–58  ·  view source on GitHub ↗

Start the timer.

(self)

Source from the content-addressed store, hash-verified

44 self.num_intervals = 0
45
46 def start(self):
47 """Start the timer."""
48 assert not self.started_, f"{self.name_} timer has already been started"
49 # Measure the previous interval before its events are recorded again.
50 self._read_latest()
51 if self.use_host_timer:
52 self.start_time = time.time()
53 else:
54 if self.start_event is None:
55 event_class = get_accelerator().Event
56 self.start_event = event_class(enable_timing=True)
57 self.start_event.record()
58 self.started_ = True
59
60 def stop(self, reset=False, record=False):
61 """Stop the timer."""

Callers

nothing calls this directly

Calls 3

_read_latestMethod · 0.95
get_acceleratorFunction · 0.90
recordMethod · 0.45

Tested by

no test coverage detected