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 5 commits into from
May 27, 2023

Conversation

HolyFalafel
Copy link
Contributor

When using cuda_events, the measured model time is stored in ms.
When not using cuda_events, the measured model time was stored in seconds.
This commit fixes the units and aligns them to store ms, the same as elapsed() function.
This was observed when running the following pytest:
unit/inference/test_model_profiling.py::TestModelProfiling::test[False-True-roberta-base-fill-mask]

Returned values were:
count=0 e2e_t=895.174312 model_t=0.8529715538024902
count=1 e2e_t=7.500252 model_t=0.0041310787200927734
count=2 e2e_t=3.887346 model_t=0.0018568038940429688
count=3 e2e_t=3.577845 model_t=0.0016334056854248047
count=4 e2e_t=3.43976 model_t=0.0016703605651855469
count=5 e2e_t=3.310903 model_t=0.0016107559204101562
count=6 e2e_t=3.299556 model_t=0.001603841781616211
count=7 e2e_t=3.605722 model_t=0.0015969276428222656
count=8 e2e_t=3.273741 model_t=0.0015516281127929688
count=9 e2e_t=3.46306 model_t=0.0016617774963378906

The units difference is observed here, when model_t is in ther order of 10e-3 comparing to e2e_t

   When using cuda_events, the measured model time is stored in ms.
   When not using cuda_events, the measured model time was stored in seconds.
   This commit fixes the units and aligns them to store ms, the same as elapsed() function.
   This was observed when running the following pytest:
   unit/inference/test_model_profiling.py::TestModelProfiling::test[False-True-roberta-base-fill-mask]

   Returned values were:
     count=0 e2e_t=895.174312 model_t=0.8529715538024902
     count=1 e2e_t=7.500252 model_t=0.0041310787200927734
     count=2 e2e_t=3.887346 model_t=0.0018568038940429688
     count=3 e2e_t=3.577845 model_t=0.0016334056854248047
     count=4 e2e_t=3.43976 model_t=0.0016703605651855469
     count=5 e2e_t=3.310903 model_t=0.0016107559204101562
     count=6 e2e_t=3.299556 model_t=0.001603841781616211
     count=7 e2e_t=3.605722 model_t=0.0015969276428222656
     count=8 e2e_t=3.273741 model_t=0.0015516281127929688
     count=9 e2e_t=3.46306 model_t=0.0016617774963378906

   The units difference is observed here, when model_t is in ther order of 10e-3 comparing to e2e_t
Copy link
Contributor

@mrwyattii mrwyattii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @HolyFalafel

@mrwyattii mrwyattii enabled auto-merge (squash) May 26, 2023 23:07
@mrwyattii mrwyattii merged commit d755b9d into microsoft:master May 27, 2023
molly-smith pushed a commit that referenced this pull request Jun 23, 2023
* Align InferenceEngine to store ms in _model_times

   When using cuda_events, the measured model time is stored in ms.
   When not using cuda_events, the measured model time was stored in seconds.
   This commit fixes the units and aligns them to store ms, the same as elapsed() function.
   This was observed when running the following pytest:
   unit/inference/test_model_profiling.py::TestModelProfiling::test[False-True-roberta-base-fill-mask]

   Returned values were:
     count=0 e2e_t=895.174312 model_t=0.8529715538024902
     count=1 e2e_t=7.500252 model_t=0.0041310787200927734
     count=2 e2e_t=3.887346 model_t=0.0018568038940429688
     count=3 e2e_t=3.577845 model_t=0.0016334056854248047
     count=4 e2e_t=3.43976 model_t=0.0016703605651855469
     count=5 e2e_t=3.310903 model_t=0.0016107559204101562
     count=6 e2e_t=3.299556 model_t=0.001603841781616211
     count=7 e2e_t=3.605722 model_t=0.0015969276428222656
     count=8 e2e_t=3.273741 model_t=0.0015516281127929688
     count=9 e2e_t=3.46306 model_t=0.0016617774963378906

   The units difference is observed here, when model_t is in ther order of 10e-3 comparing to e2e_t

* Update engine.py

---------

Co-authored-by: Michael Wyatt <michaelwyatt@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants