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

Method _post_forward_hook

deepspeed/inference/engine.py:249–257  ·  view source on GitHub ↗
(self, module, input, output)

Source from the content-addressed store, hash-verified

247 self._start = time.time()
248
249 def _post_forward_hook(self, module, input, output):
250 if self.use_cuda_events:
251 self.timers(INFERENCE_MODEL_TIMER).stop()
252 elapsed_time = self.timers(INFERENCE_MODEL_TIMER).elapsed(reset=True)
253 else:
254 get_accelerator().synchronize()
255 self._end = time.time()
256 elapsed_time = (self._end - self._start) * 1e3 # convert seconds to ms
257 self._model_times.append(elapsed_time)
258
259 def _create_model_parallel_group(self, config):
260 # Call the init process

Callers

nothing calls this directly

Calls 5

get_acceleratorFunction · 0.90
stopMethod · 0.45
elapsedMethod · 0.45
synchronizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected