-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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] Onednn integration for handling reorders #7764
[GPU] Onednn integration for handling reorders #7764
Conversation
inference-engine/thirdparty/clDNN/src/graph_optimizer/add_required_reorders.cpp
Outdated
Show resolved
Hide resolved
f9c4503
to
c3d2150
Compare
aeb8e1a
to
86903fd
Compare
// Avoid optimization of nv12 reorder | ||
if (node.get_dependencies().size() != 1) | ||
continue; | ||
|
||
bool all_users_fuse = true; | ||
std::vector<program_node*> recalc_list; | ||
|
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.
I found there is change like below. Did you omit it intentionally?
@@ -318,7 +318,6 @@ void remove_redundant_reorders::run(program_impl& p) {
auto& dep = node_ptr->get_dependency(0);
if (!usr->is_type<quantize>() ||
(dep.get_output_layout().format != format::b_fs_yx_fsv16 &&
- dep.get_output_layout().format != format::fs_b_yx_fsv32 &&
dep.get_output_layout().format != format::bfyx))
continue;
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.
modified
@@ -343,8 +348,8 @@ void remove_redundant_reorders::run(program& p) { | |||
auto& dep = node->get_dependency(0); | |||
if (!(usr->is_type<convolution>()) || | |||
(usr->get_output_layout().data_type != dep.get_output_layout().data_type) || | |||
(dep.get_output_layout().format != format::bfyx) || | |||
(usr->get_output_layout().format != format::fs_b_yx_fsv32)) | |||
(usr->get_output_layout().format != format::fs_b_yx_fsv32 && usr->get_output_layout().format != format::b_fs_yx_fsv32) || |
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 is now mismatching with the comment. Could you check the comment just above this line?
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.
I found that this code was initially inserted by @sshlyapn.
Sergey, do we have update in convolution code as well to support b_fs_yx_fsv32?
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.
conv fusion of (b_fs_yx_fsv32 reorder) is supported only on onednn.
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 will be fixed as discussed.
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.
I think this is quite became quite difficult now. What about rewriting as below? It will include the diff in line 366.
if (!(usr->is_type<convolution>()) ||
usr->get_output_layout().data_type != dep.get_output_layout().data_type ||
dep.get_output_layout().format != format::bfyx))
return;
if (usr->as<convolution().get_preferred_impl_type() == impl_types::cldnn &&
usr->get_output_layout().format != format::fs_b_yx_fsv32)
return;
if (usr->as<convolution().get_preferred_impl_type() == impl_types::onednn &&
usr->get_output_layout().format != format::b_fs_yx_fsv32)
return;
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.
Ok.
1256933
to
bbad62c
Compare
if ((usr->as<quantize>().get_preferred_impl_type() != impl_types::onednn) && | ||
(dep.get_output_layout().format == format::fs_b_yx_fsv32)) | ||
continue; | ||
|
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.
From what I remember, we should not apply this snippet. 1) fs_b_yx_fsv32 won't be selected for onednn. 2) we should not touch cldnn logic.
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.
Ok it will be removed.
@@ -343,8 +348,8 @@ void remove_redundant_reorders::run(program& p) { | |||
auto& dep = node->get_dependency(0); | |||
if (!(usr->is_type<convolution>()) || | |||
(usr->get_output_layout().data_type != dep.get_output_layout().data_type) || | |||
(dep.get_output_layout().format != format::bfyx) || | |||
(usr->get_output_layout().format != format::fs_b_yx_fsv32)) | |||
(usr->get_output_layout().format != format::fs_b_yx_fsv32 && usr->get_output_layout().format != format::b_fs_yx_fsv32) || |
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.
I think this is quite became quite difficult now. What about rewriting as below? It will include the diff in line 366.
if (!(usr->is_type<convolution>()) ||
usr->get_output_layout().data_type != dep.get_output_layout().data_type ||
dep.get_output_layout().format != format::bfyx))
return;
if (usr->as<convolution().get_preferred_impl_type() == impl_types::cldnn &&
usr->get_output_layout().format != format::fs_b_yx_fsv32)
return;
if (usr->as<convolution().get_preferred_impl_type() == impl_types::onednn &&
usr->get_output_layout().format != format::b_fs_yx_fsv32)
return;
c0025ab
to
909caa9
Compare
Passed dry-run with gpu_tools/dryrun_benchmark.sh update. |
Signed-off-by: Min, Byungil <[email protected]>
909caa9
to
48cd925
Compare
Signed-off-by: Min, Byungil [email protected]
Details:
Tickets: