Skip to content
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] Fix the issue missing data padding info in update_shape #26276

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions src/plugins/intel_gpu/src/graph/primitive_inst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,13 +425,23 @@ void primitive_inst::update_shape() {

_impl_params->memory_deps = memory_deps;


auto new_layouts = _node->type()->calc_output_layouts(*_node, *_impl_params);
for (size_t i = 0; i != _impl_params->output_layouts.size(); ++i) {
set_shape_change();
_impl_params->output_layouts[i].set_partial_shape(new_layouts[i].get_partial_shape());
for (size_t idx = 0; idx != new_layouts.size(); ++idx) {
auto& new_layout = new_layouts[idx];
if (!_node->is_type<reshape>() || (!_node->get_input_layout(0).has_dynamic_pad() && !_node->can_be_optimized())) {
_impl_params->output_layouts[i].data_padding = padding::max(_impl_params->output_layouts[i].data_padding, new_layouts[i].data_padding);
auto data_padding = padding::max(_impl_params->get_output_layout(idx).data_padding, new_layout.data_padding);
new_layout.data_padding = padding::max(_node->get_primitive()->get_output_padding(idx), data_padding);
}

if (_impl_params->get_output_layout(idx) != new_layout) {
GPU_DEBUG_TRACE_DETAIL << id() << ": update shape: was: " << _impl_params->get_output_layout(idx).to_short_string()
<< " now: " << new_layout.to_short_string() << std::endl;
set_shape_change();
}

_impl_params->output_layouts[idx].data_padding = new_layout.data_padding;
_impl_params->output_layouts[idx].set_partial_shape(new_layouts[idx].get_partial_shape());
}

// Update descriptors of fused operations and set output_layout's shape to all fused ops
Expand Down
Loading