MCPcopy Create free account
hub / github.com/AIS-SNU/Smart-Infinity / elapsed

Method elapsed

deepspeed/utils/timer.py:90–104  ·  view source on GitHub ↗

Calculate the elapsed time.

(self, reset=True)

Source from the content-addressed store, hash-verified

88 self.event_timers.clear()
89
90 def elapsed(self, reset=True):
91 """Calculate the elapsed time."""
92 started_ = self.started_
93 # If the timing in progress, end it first.
94 if self.started_:
95 self.stop()
96 # Get the elapsed time.
97 elapsed_ = self._get_elapsed_msec()
98 # Reset the elapsed time
99 if reset:
100 self.reset()
101 # If timing was in progress, set it back.
102 if started_:
103 self.start()
104 return elapsed_
105
106 def mean(self):
107 self.elapsed(reset=False)

Callers 10

meanMethod · 0.95
logMethod · 0.45
print_model_profileMethod · 0.45
_post_forward_hookMethod · 0.45
stepMethod · 0.45
_write_monitorMethod · 0.45
train_batchMethod · 0.45
forwardMethod · 0.45
forwardMethod · 0.45
log_wrapperFunction · 0.45

Calls 4

stopMethod · 0.95
_get_elapsed_msecMethod · 0.95
resetMethod · 0.95
startMethod · 0.95

Tested by

no test coverage detected