-
Notifications
You must be signed in to change notification settings - Fork 1.1k
all: asynchronous Eigen threadpool runtime support #4297
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
base: dzarukin/async_runtime_prepare
Are you sure you want to change the base?
all: asynchronous Eigen threadpool runtime support #4297
Conversation
Gemm-based infrastructure requires a lot of changes to support asynchronous runtime. However, it's impossible to disable asynchronous runtime solely as threadpool is not avaialble at creation time through conventional API. There's an option to introduce API to register a threadpool before calling a primitive_desc creation function. If this gets implemented, then introduced calls can be modified to check for registered threadpool and if it is present, then check its flag to decide if an implementation should be enabled/disabled. For the simplicity this API is not a part of this commit.
Changing capture is needed to copy a lambda function as it will be destroyed after submitter exits its creation context.
Co-authored-by: Dmitrii Zarukin <[email protected]>
|
make test |
TaoLv
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.
Thank you Dima for taking care of the graph part. 👍
| } | ||
|
|
||
| void prolong_temporary_scratchpad_lifetime(const stream_t *g_stream, | ||
| const std::shared_ptr<temporary_scratchpad_t> &scratchpad) { |
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.
We may need below to avoid compiler or tidy complains:
MAYBE_UNUSED(g_stream);
MAYBE_UNUSED(scratchpad);
This is the final PR that covers all the current needs for asynchronous Eigen threadpool runtime support.
Important notes:
These two key principles now must be followed for updated CPU implementations (in the future, probably, every primitive and every implementation).
In a nutshell, a developer should treat async Eigen runtime in the following way:
Covered primitives: