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

[oneDNN] Cache oneDNN stream not to recreate in each oneDNN op #30358

Merged
merged 7 commits into from
Jan 25, 2021

Conversation

jczaja
Copy link
Contributor

@jczaja jczaja commented Jan 12, 2021

PR types

Performance optimization

PR changes

OPs

Describe

created on dnnl::stream involves small memory allocation. stream can be created once and then reused so this PR makes stream to be created one per thread and store in per thread object.

- compilation fix

- fix

- Fix

- fix

- added stream holder

- compilation fix

- Modified all remining files

- fix

- lint
@jczaja jczaja added the Intel label Jan 12, 2021
@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@jczaja jczaja requested a review from wozna January 12, 2021 16:35
Copy link
Contributor

@arogowie-intel arogowie-intel left a comment

Choose a reason for hiding this comment

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

Please use auto& to make sure that you're not doing copy while reaching for stream object.

paddle/fluid/platform/device_context.h Outdated Show resolved Hide resolved
@jczaja
Copy link
Contributor Author

jczaja commented Jan 19, 2021

@arogowie-intel I have added some additional change (last commit) to fix a problem exposed by test-analyzer-detect. If you want more details then ask me.

Copy link
Contributor

@jakpiase jakpiase left a comment

Choose a reason for hiding this comment

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

LGTM

@jczaja
Copy link
Contributor Author

jczaja commented Jan 20, 2021

@luotao1 Could you please start your review? CI will not pass without approval. This PR is changing way oneDNN stream was created , so due to API change I had do it all at once in all locations. So there many files modified, but most of them it is single line of change.

@luotao1 luotao1 requested a review from raindrops2sea January 21, 2021 02:41
@luotao1 luotao1 merged commit 173660b into PaddlePaddle:develop Jan 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants