MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _pre_forward_hook

Method _pre_forward_hook

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

Source from the content-addressed store, hash-verified

259 return AutoTPMeta(num_attention_heads=num_heads, num_kv_heads=num_kv_heads)
260
261 def _pre_forward_hook(self, module, *inputs, **kwargs):
262 if self.use_cuda_events:
263 self.timers(INFERENCE_MODEL_TIMER).start()
264 else:
265 get_accelerator().synchronize()
266 self._start = time.time()
267
268 def _post_forward_hook(self, module, input, output):
269 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