Skip to content

Commit

Permalink
[GPU] Disabling the removal of reorder before weights reorder
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyamin-Roman committed Sep 18, 2023
1 parent 1e7b707 commit eb6b80e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ void remove_redundant_reorders::run(program& p) {
bool remove_dep = r_dep_node.is_simple_reorder() &&
r_dep_node.get_users().size() == 1 &&
!r_dep_node.is_output() &&
!r_dep_node.get_primitive()->has_surface_input();
!r_dep_node.get_primitive()->has_surface_input() &&
!r_node.get_primitive()->weights_reorder_params;

// for chains like
// fp32 -> reorder -> u8 -> reorder -> fp32
Expand Down Expand Up @@ -262,9 +263,7 @@ void remove_redundant_reorders::run(program& p) {

if (!r_node.is_simple_reorder() ||
no_output_optimization ||
r_node.get_primitive()->has_surface_input() ||
(r_node.get_primitive()->weights_reorder_params &&
r_node.get_primitive()->weights_reorder_params->should_be_transposed()))
r_node.get_primitive()->has_surface_input())
continue;

auto o_layout = r_node.get_output_layout();
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_gpu/src/graph/include/reorder_inst.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ struct typed_program_node<reorder> : public typed_program_node_base<reorder> {
bool is_simple_reorder() const {
return !has_fused_primitives() &&
!has_mean() &&
get_primitive()->subtract_per_feature.empty();
get_primitive()->subtract_per_feature.empty() &&
!get_primitive()->weights_reorder_params;
}

std::shared_ptr<NodeFuseParams> get_fuse_params() const override {
Expand Down

0 comments on commit eb6b80e

Please sign in to comment.