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

Class CudaEventTimer

deepspeed/utils/timer.py:21–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class CudaEventTimer(object):
22
23 def __init__(self, start_event: get_accelerator().Event, end_event: get_accelerator().Event):
24 self.start_event = start_event
25 self.end_event = end_event
26
27 def get_elapsed_msec(self):
28 get_accelerator().current_stream().wait_event(self.end_event)
29 self.end_event.synchronize()
30 return self.start_event.elapsed_time(self.end_event)
31
32
33class SynchronizedWallClockTimer:

Callers 1

stopMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected