-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Avoid to run profiling code in critical stack completely if there is no need #245
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
Conversation
|
Is this PR really needed? Isn't there another PR #197 |
|
@jywu-msft we do need this PR because PR #197 and previous PR #166 doesn't solve the problem completely. There is still overhead for profiling. I make a change without build option. |
jywu-msft
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the updates.
| auto graph_viewer = session_state.GetGraphViewer(); | ||
| TimePoint sync_time_begin; | ||
| TimePoint kernel_begin_time; | ||
| bool f_profiler_enabled = session_state.Profiler().FEnabled(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool profiler_enabled = session_state.Profiler().Enabled() reads better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same with the function name, f means flag here.
With build_essential option, it runs 0.2ms faster for agi-encoder model (total cost 1.6ms ).