-
Notifications
You must be signed in to change notification settings - Fork 1k
graph: handle different engine instances in compied parition cache #3413
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: main
Are you sure you want to change the base?
Conversation
ea29874
to
2ff64a5
Compare
make test |
@@ -97,6 +97,10 @@ struct sdp_primitive_kernel_t : public kernel_base_t { | |||
|
|||
DEF_KERNEL_METHOD_STR(sdp_primitive_kernel_t) | |||
DNNL_DISALLOW_COPY_AND_ASSIGN(sdp_primitive_kernel_t) | |||
status_t reset_engine(const engine_t *g_engine) override { | |||
UNUSED(g_engine); |
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.
why unused here?
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.
For sdp_primitive_kernel_t
, the executable object is primitive_t
L70. For primitive_t
object, there is no engine
in this object. So we don't need to reset engine for it.
2ff64a5
to
6ebe88b
Compare
make test |
@@ -113,7 +113,7 @@ status_t dnnl_partition_impl_t::compile( | |||
compiled_partition_t *compiled_partition, | |||
const std::vector<logical_tensor_t> &inputs, | |||
const std::vector<logical_tensor_t> &outputs, | |||
const engine_t *g_engine) const { | |||
engine_t *g_engine) const { |
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.
What does this mean? We do have a const
engine in the public compile API. I assume that const-ness will propagate from API to internal implementations.
@@ -91,6 +91,7 @@ struct batch_norm_fwd_t : public kernel_base_t { | |||
|
|||
DEF_KERNEL_METHOD_STR(batch_norm_fwd_t) | |||
DNNL_DISALLOW_COPY_AND_ASSIGN(batch_norm_fwd_t) | |||
KERNEL_RESET_ENGINE |
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.
KERNEL_RESET_ENGINE | |
DEF_KERNEL_METHOD_RESET_ENGINE |
Just try to align with the name of DEF_KERNEL_METHOD_STR
.
6ebe88b
to
06880e9
Compare
Fix MFDNN-12121
In this PR, we add the
reset_engine
method to reset the compiled partition's and kernel's engine. With this PR, the compiled partition and primitive cache can be hit for different engine cases (Same member functions and member variables)