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

Method _pre_forward_hook

deepspeed/inference/engine.py:242–247  ·  view source on GitHub ↗
(self, module, *inputs, **kwargs)

Source from the content-addressed store, hash-verified

240 self.module.transformer.build_alibi_tensor = build_bloom_alibi_tensor
241
242 def _pre_forward_hook(self, module, *inputs, **kwargs):
243 if self.use_cuda_events:
244 self.timers(INFERENCE_MODEL_TIMER).start()
245 else:
246 get_accelerator().synchronize()
247 self._start = time.time()
248
249 def _post_forward_hook(self, module, input, output):
250 if self.use_cuda_events:

Callers

nothing calls this directly

Calls 3

get_acceleratorFunction · 0.90
startMethod · 0.45
synchronizeMethod · 0.45

Tested by

no test coverage detected