Skip to content

Commit

Permalink
[dGPU] avoid strided_slice to be executed in cpu (#25601)
Browse files Browse the repository at this point in the history
### Details:
- Big input tensor to StrideSlice primitive is executed in CPU will lead
to huge performance drop.
 - *...*

### Tickets:
 - CVS-147088

---------

Co-authored-by: Pavel Durandin <pavel.durandin@intel.com>
  • Loading branch information
riverlijunjie and p-durandin authored Aug 6, 2024
1 parent 7bc7283 commit f19282f
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "reshape_inst.h"
#include "eltwise_inst.h"
#include "select_inst.h"
#include "strided_slice_inst.h"
#include "gather_inst.h"
#include "pass_manager.h"

Expand Down Expand Up @@ -78,6 +79,13 @@ bool mark_shape_of_subgraphs::can_mark_node(const program_node& node) {
return false;
}

// Exclude stride_slice primitive if it's input is big const ternsor, else CPU reference implementation
// will lead to huge performance drop.
if (node.is_type<strided_slice>() && node.get_dependency(0).is_constant() &&
node.get_dependency(0).get_output_layout().count() > 1024 * 1024) {
return false;
}

auto available_impls = node.type()->get_available_impls(node);
auto cpu_impl_found = available_impls.find(impl_types::cpu) != available_impls.end();

Expand Down

0 comments on commit f19282f

Please sign in to comment.