Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Paramuzov <[email protected]>
  • Loading branch information
vladimir-paramuzov committed Dec 5, 2024
1 parent 33af9c1 commit fe2a5cf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -846,27 +846,6 @@ void prepare_buffer_fusing::run(program& p) {
if (user_info.first) {
node.get_users().front()->set_output_layout(user_info.second);
}

// In case that the rank of weight node of gemm is less than 4 and,
// it transforms to extend to 4 dims by adding 1 to begin().
// Therefore, the padding of crop_layout should be shifted properly.
const size_t TDIM = 4;
auto user = node.get_users().front();
bool allow_new_shape_infer = node.get_program().is_new_shape_infer();
if (!allow_new_shape_infer && user->is_type<gemm>() && user->get_dependency(1).id().compare(node.id()) == 0) {
auto input_rank = user->get_kernel_impl_params()->typed_desc<gemm>()->weight_rank;
if (input_rank < TDIM) {
std::vector<int32_t> l_pad = {0, 0, 0, 0};
std::vector<int32_t> u_pad = {0, 0, 0, 0};

//shift right
size_t shift_right = TDIM - input_rank;
std::copy_n(crop_layout.data_padding._lower_size.begin(), l_pad.size() - shift_right, l_pad.begin() + shift_right);
std::copy_n(crop_layout.data_padding._upper_size.begin(), u_pad.size() - shift_right, u_pad.begin() + shift_right);

crop_layout.data_padding = padding(l_pad, u_pad);
}
}
}
node.set_output_layout(crop_layout);
node.can_be_optimized(true);
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/intel_gpu/src/graph/strided_slice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void strided_slice_inst::update_output_memory() {
if (!can_be_optimized())
return;

if (node->get_program().is_new_shape_infer() && input_memory_ptr() == nullptr)
if (input_memory_ptr() == nullptr)
return;

if (static_cast<bool>(_outputs[0]) && _network.get_engine().is_the_same_buffer(output_memory(), input_memory()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ TEST_P(skip_gather_at_runtime_test, runtime_skip) {
reorder("reorder", input_info("gather"), format::get_default_format(input1_rank), data_types::f32));

ExecutionConfig config = get_test_default_config(engine);
config.set_property(ov::intel_gpu::allow_new_shape_infer(true));
config.set_property(ov::intel_gpu::optimize_data(true));

network network(engine, topology, config);
Expand Down

0 comments on commit fe2a5cf

Please sign in to comment.