DeformableConv v8: reference implementation (#6514)

* DeformableConv v8:reference implementation

* ngraph codestyle

* update reference iplementation

* Disable tests on GPU

* fix unit tests

* Update DeformConv single layer tests

* fix serialization tests
This commit is contained in:
Ivan Tikhonov
2021-07-19 06:15:34 +03:00
committed by GitHub
parent bc36425381
commit 697c52abfe
12 changed files with 3367 additions and 66 deletions

View File

@@ -404,6 +404,7 @@ set(MULTI_TEST_SRC
backend/dft.in.cpp
backend/divide.in.cpp
backend/deformable_convolution.in.cpp
backend/deformable_convolution_opset8.in.cpp
backend/depth_to_space.in.cpp
backend/dyn_reshape.in.cpp
backend/experimental_detectron_generate_proposals.in.cpp

File diff suppressed because it is too large Load Diff

View File

@@ -1609,6 +1609,14 @@ IE_CPU.deformable_convolution_2D_integral_offsets_groups_and_deforgroups
IE_CPU.deformable_convolution_2D_real_offsets_groups_basic
IE_CPU.deformable_convolution_2D_real_offsets_groups_complex
IE_CPU.deformable_convolution_2D_real_offsets_groups_and_deforgroups
# No plugin support for DeformableConvolution v8
IE_GPU.deformable_convolution_opset8_2D_v8_zeroed_offsets_default_mask
IE_GPU.deformable_convolution_opset8_2D_real_offsets_groups_and_deforgroups_mask
IE_GPU.deformable_convolution_opset8_2D_real_offsets_groups_and_deforgroups_mask_2
IE_GPU.deformable_convolution_opset8_2D_neg_offsets_groups_and_deforgroups_mask
# results missmatch, ticket: 59600
IE_GPU.deformable_convolution_2D_integral_offsets_groups_and_deforgroups
IE_GPU.deformable_convolution_opset8_2D_integral_offsets_groups_and_deforgroups
# No plugin support for AdaptiveAvgPool and AdaptiveMaxPool
adaptive_avg_pool_1d

View File

@@ -345,6 +345,60 @@ namespace
return true;
}
template <element::Type_t ET>
bool evaluate(const shared_ptr<op::v8::DeformableConvolution>& op,
const HostTensorVector& outputs,
const HostTensorVector& inputs) {
const auto in_data_ptr = inputs[0]->get_data_ptr<ET>();
const auto offset_data_ptr = inputs[1]->get_data_ptr<ET>();
const auto filter_data_ptr = inputs[2]->get_data_ptr<ET>();
auto out_data_ptr = outputs[0]->get_data_ptr<ET>();
const auto& out_shape = outputs[0]->get_shape();
const auto& in_shape = inputs[0]->get_shape();
const auto& offset_shape = inputs[1]->get_shape();
const auto& filter_shape = inputs[2]->get_shape();
if (inputs.size() == 3) {
runtime::reference::deformable_convolution<typename element_type_traits<ET>::value_type>(
in_data_ptr,
offset_data_ptr,
filter_data_ptr,
out_data_ptr,
in_shape,
offset_shape,
filter_shape,
out_shape,
op->get_strides(),
op->get_dilations(),
op->get_pads_begin(),
op->get_pads_end(),
op->get_group(),
op->get_deformable_group(),
op->get_bilinear_interpolation_pad());
} else {
const auto mask_data_ptr = inputs[3]->get_data_ptr<ET>();
const auto& mask_shape = inputs[3]->get_shape();
runtime::reference::deformable_convolution<typename element_type_traits<ET>::value_type>(
in_data_ptr,
offset_data_ptr,
filter_data_ptr,
mask_data_ptr,
out_data_ptr,
in_shape,
offset_shape,
filter_shape,
mask_shape,
out_shape,
op->get_strides(),
op->get_dilations(),
op->get_pads_begin(),
op->get_pads_end(),
op->get_group(),
op->get_deformable_group(),
op->get_bilinear_interpolation_pad());
}
return true;
}
template <element::Type_t ET>
bool evaluate(const shared_ptr<op::v1::DeformableConvolution>& op,
const HostTensorVector& outputs,