diff options
author | Jongsoo Park <jongsoo@fb.com> | 2020-04-09 20:12:11 +0300 |
---|---|---|
committer | Jongsoo Park <jongsoo@fb.com> | 2020-04-09 20:12:11 +0300 |
commit | 45ad43d59578bd0fc23aaa4fb043d027bfa45c34 (patch) | |
tree | b652c7cdaf86d24fa48cb17a866826bf6a469a47 | |
parent | 1910f8c0e3eb62e82bece7ee6ad08b01961612f9 (diff) |
Re-sync with internal repository
-rw-r--r-- | include/fbgemm/Utils.h | 7 | ||||
-rw-r--r-- | src/RefImplementations.cc | 50 |
2 files changed, 2 insertions, 55 deletions
diff --git a/include/fbgemm/Utils.h b/include/fbgemm/Utils.h index 45b17ea..36966ca 100644 --- a/include/fbgemm/Utils.h +++ b/include/fbgemm/Utils.h @@ -91,11 +91,8 @@ struct simd_info<inst_set_t::avx512> { }; template <> -struct simd_info<inst_set_t::avx512_vnni> { - static constexpr int WIDTH_BITS = 512; - static constexpr int WIDTH_BYTES = 64; - static constexpr int WIDTH_32BIT_ELEMS = 16; -}; +struct simd_info<inst_set_t::avx512_vnni> + : public simd_info<inst_set_t::avx512> {}; /** * @brief A function to compare data in two buffers for closeness/equality. diff --git a/src/RefImplementations.cc b/src/RefImplementations.cc index 6433a1a..f8c90b9 100644 --- a/src/RefImplementations.cc +++ b/src/RefImplementations.cc @@ -513,56 +513,6 @@ FBGEMM_API void conv_ref( } // for each n } -void conv_ref( - const conv_param_t<2>& conv_p, - const float* A, - const float* B, - float* C) { - // filters are assumed to be in G RS C/G x K format - int IC = conv_p.IC; - int OC = conv_p.OC; - int G = conv_p.G; - assert(IC % G == 0); - assert(OC % G == 0); - array<int, 2> IN_DIM = conv_p.IN_DIM; - array<int, 2> OUT_DIM = conv_p.OUT_DIM; - array<int, 2> K = conv_p.K; - - for (int n = 0; n < conv_p.MB; ++n) { - for (int h = 0; h < OUT_DIM[0]; ++h) { - for (int w = 0; w < OUT_DIM[1]; ++w) { - for (int g = 0; g < G; ++g) { - for (int m = 0; m < OC / G; ++m) { - float sum = 0.0f; - for (int r = 0; r < K[0]; ++r) { - int h_in = -conv_p.pad[0] + h * conv_p.stride[0] + - r * conv_p.dilation[0]; - for (int s = 0; s < K[1]; ++s) { - int w_in = -conv_p.pad[1] + w * conv_p.stride[1] + - s * conv_p.dilation[1]; - for (int c = 0; c < IC / G; ++c) { - float a = h_in < 0 || h_in >= IN_DIM[0] || w_in < 0 || - w_in >= IN_DIM[1] - ? 0.0f - : A[((n * IN_DIM[0] + h_in) * IN_DIM[1] + w_in) * IC + - g * (IC / G) + c]; - float b = - B[(((g * K[0] + r) * K[1] + s) * (IC / G) + c) * - (OC / G) + - m]; - sum = std::fma(a, b, sum); - } // for each c - } // for each s - } // for each r - C[((n * OUT_DIM[0] + h) * OUT_DIM[1] + w) * OC + g * (OC / G) + m] = - sum; - } // for each m - } // for each group - } // for each w - } // for each h - } // for each n -} - // 3D Conv template <> FBGEMM_API void conv_ref( |