-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[GPU] Skip reorder opt when its dependency is crop #27547
[GPU] Skip reorder opt when its dependency is crop #27547
Conversation
@@ -844,6 +844,8 @@ void prepare_buffer_fusing::run(program& p) { | |||
crop_params->input_offsets[0], | |||
node.get_primitive()->axis, | |||
false); | |||
if (static_cast<bool>(crop_layout.data_padding) && node.get_users().front()->is_type<reorder>()) |
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.
As offline discussion, returning here is dangerous. So this condition must already be done within match function.
9e3852a
to
0b5aa18
Compare
0b5aa18
to
51ac5f3
Compare
51ac5f3
to
1d15768
Compare
@@ -295,6 +295,9 @@ void remove_redundant_reorders::run(program& p) { | |||
auto o_layout = r_node.get_output_layout(); | |||
const auto& i_layout = r_node.get_input_layout(0); | |||
|
|||
if (r_node.get_dependency(0).is_type<crop>()) |
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.
Do we skip reorder optimizing which has crop dep even it does not has any padding?
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.
Yes. reorder opt is determined in remove_redundant_reorders and crop padding is determined in prepare_buffer_fusing. And remove_redundant_reorders is executed before prepare_buffer_fusing. So padding info isn't known in remove_redundant_reorders pass.
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.
if (!update_implementations || (r_node.get_dependency(0).is_type<crop>() && r_node.get_dependency(0).can_be_optimized())
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.
At post optimization graph phase, update_implementations is true.
At this phase, buffer fusing is already applied, so we can check the optimization of crop.
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.
Updated as your comments. Thanks for your updated codes and kind explanations.
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.
As update_implementations needed to be confined to crop only because the code below the condition should be run sometimes, the condition was updated.
e746860
to
8d5bdd0
Compare
8d5bdd0
to
0f04110
Compare
64787a9
to
ba177e8
Compare
Details:
Tickets: