-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Improve static cached_op optimization #15187
Conversation
Change-Id: If90c6f0997548ffd5daa67cc18bab7405f24213b
@@ -595,7 +595,10 @@ inline bool CheckAndInferShape(nnvm::Graph* p_g, mxnet::ShapeVector&& shapes, | |||
*contain_unknown = false; | |||
} | |||
nnvm::Graph& g = *p_g; | |||
if (g.attrs.count("shape")) { | |||
if (use_inputs) { |
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.
Please add the comments in the code
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.
This code is removed from previous commit by mistake. This is just to recover them back.
Thanks for your contributions @xinyu-intel . @mxnet-label-bot Add [pr-awaiting-review, Operator, Backend] |
Please also try dmlc/gluon-nlp#690 |
@pengzhao-intel I've tested dmlc/gluon-nlp#690, and everything works fine. |
Thanks :) |
@@ -290,7 +290,7 @@ bool CachedOp::CheckDynamicShapeExists(const Context& default_ctx, | |||
CheckAndInferShape(&g, std::move(shape_inputs), true, | |||
{0, 0}, {0, 0}, | |||
&contain_dynamic_shape); | |||
if (contain_dynamic_shape && erase_result) { | |||
if (!config_.static_shape && erase_result) { |
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.
Sounds like something wasn't properly tested here? Maybe add a test to cover this path?
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.
It's already covered by current UT, there're 2 cases failed before fixing this.
@PatricZhao @ZhennanQin Is this good to go? Although we are not sure if this fix is related, can we add this to 1.5.0 anyway since #14931 is already in 1.5.0.rc0 ? |
Agree! I think the PR is ready to merge. |
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.
LGTM
@roywei merged, please take it into 1.5 and try if the regression issue is fixed. |
* Fix cached op Change-Id: If90c6f0997548ffd5daa67cc18bab7405f24213b * Fix UT * trigger
* Fix cached op Change-Id: If90c6f0997548ffd5daa67cc18bab7405f24213b * Fix UT * trigger
fix along with #14931
@pengzhao-intel @ZhennanQin
Description
(Brief description on what this PR is about)
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
Comments