From 43bf90f90cf9e5a80da1698f9658c0f110e14d83 Mon Sep 17 00:00:00 2001 From: Yury Gaydaychuk Date: Mon, 5 Jun 2023 12:17:54 +0200 Subject: [PATCH] [CPU] Align jit and ref offsets handling in DeformableConvolution implementation (#10686) --- src/plugins/intel_cpu/src/nodes/def_conv.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/plugins/intel_cpu/src/nodes/def_conv.cpp b/src/plugins/intel_cpu/src/nodes/def_conv.cpp index baed2bea09d..5f15520a870 100644 --- a/src/plugins/intel_cpu/src/nodes/def_conv.cpp +++ b/src/plugins/intel_cpu/src/nodes/def_conv.cpp @@ -138,7 +138,6 @@ private: jg(ow_tail, T_NEAR); oc_loop(jcp_.ur_w); - add(reg_input, jcp_.ur_w * jcp_.stride_w * jcp_.ic * jcp_.typesize_in); add(reg_sampled_wei, jcp_.ur_w * jcp_.kh * jcp_.kw * sampledPointsPerPixel * jcp_.typesize_sampled_wei); // type = float add(reg_sampled_offs, jcp_.ur_w * jcp_.kh * jcp_.kw * sampledPointsPerPixel * jcp_.typesize_sampled_offsets); // type = int @@ -310,7 +309,6 @@ private: Label nullify_v4_end_tail; mov(aux2_reg_input, aux_reg_input); - add(aux2_reg_input, (ow * jcp_.stride_w * jcp_.ic) * jcp_.typesize_in); mov(aux3_reg_input_buffer, aux2_reg_input_buffer); add(aux3_reg_input_buffer, (ow * jcp_.kh * jcp_.kw * jcp_.ic) * jcp_.typesize_in); @@ -915,9 +913,6 @@ void DeformableConvolution::DefConvExecutor::prepareSamplingWeights( const int h_in = oh * KSH - padT; const int w_in = ow * KSW - padL; - const int waOffsetH = (enforceRef ? 0 : h_in); - const int waOffsetW = (enforceRef ? 0 : w_in); - const float *data_offset_ptr = offsets + mb * offStrides[0] + (dg * 2 * KH * KW) * offStrides[1]; const float *modulation_offset_ptr = nullptr; if (modulation != nullptr) { @@ -964,10 +959,10 @@ void DeformableConvolution::DefConvExecutor::prepareSamplingWeights( float lw = map_w - w_low; float hh = 1 - lh, hw = 1 - lw; - int h_ind_low = std::max(h_low, 0) - waOffsetH; - int h_ind_high = std::min(h_high, cur_h_end - 1) - waOffsetH; - int w_ind_low = std::max(w_low, 0) - waOffsetW; - int w_ind_high = std::min(w_high, cur_w_end - 1) - waOffsetW; + int h_ind_low = std::max(h_low, 0); + int h_ind_high = std::min(h_high, cur_h_end - 1); + int w_ind_low = std::max(w_low, 0); + int w_ind_high = std::min(w_high, cur_w_end - 1); hh = (h_low >= 0 ? hh : 0); hw = (w_low >= 0 ? hw : 0); @@ -1262,8 +1257,7 @@ void DeformableConvolution::DefConvJitExecutor::exec(const float* src, const flo const size_t _oc = g * jcp.nb_oc; const size_t _ic = g * jcp.nb_ic; - par_conv.src = &src[n * srcStrides[0] + _ic*jcp.ic_block * srcStrides[1] + - (oh * jcp.stride_h - jcp.t_pad) * srcStrides[2] - jcp.l_pad * srcStrides[3]]; + par_conv.src = &src[n * srcStrides[0] + _ic*jcp.ic_block * srcStrides[1]]; par_conv.sampledWei = &(pInterpWeightsVector[(n * jcp.dg * jcp.oh + oh) * jcp.kh * jcp.kw * jcp.ow * sampledPointsPerPixel]); par_conv.sampledCoords = &(pSampledCoordsVector[(n * jcp.dg * jcp.oh + oh) * jcp.kh * jcp.kw * jcp.ow * sampledPointsPerPixel]); par_conv.filt = &weights[g * jcp.nb_oc * jcp.nb_ic * jcp.kh * jcp.kw * jcp.ic_block * jcp.oc_block];