MCPcopy
hub / github.com/deepspeedai/DeepSpeed / _pre_forward_hook

Method _pre_forward_hook

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

Source from the content-addressed store, hash-verified

228 self.module.transformer.__class__._attn_bias = build_mpt_atten_bias_tensor
229
230 def _pre_forward_hook(self, module, *inputs, **kwargs):
231 if self.use_cuda_events:
232 self.timers(INFERENCE_MODEL_TIMER).start()
233 else:
234 get_accelerator().synchronize()
235 self._start = time.time()
236
237 def _post_forward_hook(self, module, input, output):
238 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