Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align InferenceEngine to store ms in _model_times #3501

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions deepspeed/inference/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def _post_forward_hook(self, module, input, output):
else:
get_accelerator().synchronize()
self._end = time.time()
elapsed_time = self._end - self._start
elapsed_time = (self._end - self._start) * 1e3 # convert seconds to ms
self._model_times.append(elapsed_time)

def _create_model_parallel_group(self, config):
Expand Down Expand Up @@ -612,7 +612,7 @@ def forward(self, *inputs, **kwargs):

if self.model_profile_enabled and self._config.enable_cuda_graph:
get_accelerator().synchronize()
duration = time.time() - start
duration = (time.time() - start) * 1e3 # convert seconds to ms
self._model_times.append(duration)

return outputs
Expand Down