Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/FBGEMM.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJongsoo Park <jongsoo@fb.com>2018-11-16 05:21:15 +0300
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-11-16 05:24:41 +0300
commit8392eca198742b949529e18619a7ec9a25f4b399 (patch)
treeda6f827a09b6a90d6294ca566f073ff387225a3b /src/PackAWithIm2Col.cc
parentaa5b56a0de8b8f19047a9d797bf2d70cca4bc1f0 (diff)
grouped (batched) gemm (#7)
Summary: Pull Request resolved: https://github.com/pytorch/FBGEMM/pull/7 This diff allows groups > 1 . Will have a separate diff for im2col + gemm fusion and conv with group > 1 . Reviewed By: jianyuh Differential Revision: D13039210 fbshipit-source-id: f7b3b0dbdb67fc6bc865de88292f034b252d029d
Diffstat (limited to 'src/PackAWithIm2Col.cc')
-rw-r--r--src/PackAWithIm2Col.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/PackAWithIm2Col.cc b/src/PackAWithIm2Col.cc
index 71efced..7ca7059 100644
--- a/src/PackAWithIm2Col.cc
+++ b/src/PackAWithIm2Col.cc
@@ -36,6 +36,7 @@ PackAWithIm2Col<T, accT, SPATIAL_DIM>::PackAWithIm2Col(
std::multiplies<int>()) *
conv_p.IC,
pmat,
+ conv_p.G,
zero_pt),
conv_p_(conv_p),
sdata_(sdata) {
@@ -55,6 +56,11 @@ PackAWithIm2Col<T, accT, SPATIAL_DIM>::PackAWithIm2Col(
// TODO: Have default slower path
assert(0 && "unsupported architecure");
}
+ if (BaseType::numCols() % conv_p.G != 0) {
+ throw std::runtime_error(
+ "groups = " + std::to_string(conv_p.G) +
+ " does not divide numCols = " + std::to_string(BaseType::numCols()));
+ }
if (pmat) {
BaseType::buf_ = pmat;
} else {