Skip to content

Remove dynamic allocation for ThreadPool ParallelSection#12429

Merged
yuslepukhin merged 2 commits intomasterfrom
yuslepukhin/tp_ps_thread_local
Aug 4, 2022
Merged

Remove dynamic allocation for ThreadPool ParallelSection#12429
yuslepukhin merged 2 commits intomasterfrom
yuslepukhin/tp_ps_thread_local

Conversation

@yuslepukhin
Copy link
Member

@yuslepukhin yuslepukhin commented Aug 2, 2022

Description:

Construct ThreadPool Paralel section in a thread local std::optional. This allows to avoid repeated dynamic memory allocation.

Empty std::optional would construct on the first reference and destructed on thread exit.

Motivation and Context
Improve latency variance when running parallel section in a thread pool.

@lgtm-com
Copy link

lgtm-com bot commented Aug 3, 2022

This pull request fixes 1 alert when merging a2e777f into c9e0d0f - view on LGTM.com

fixed alerts:

  • 1 for Local variable address stored in non-local memory

Copy link
Contributor

@tlh20 tlh20 left a comment

Choose a reason for hiding this comment

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

Approve changes, but could you confirm that there is no impact / +ve impact on models using GRU? That's the operator that motivated introducing parallel sections -- when I worked on that, it was used in prod_model10 in our tests

@yuslepukhin
Copy link
Member Author

Approve changes, but could you confirm that there is no impact / +ve impact on models using GRU? That's the operator that motivated introducing parallel sections -- when I worked on that, it was used in prod_model10 in our tests

Confirmed.

@yuslepukhin yuslepukhin merged commit a4ef0e7 into master Aug 4, 2022
@yuslepukhin yuslepukhin deleted the yuslepukhin/tp_ps_thread_local branch August 4, 2022 16:46
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