From 3f862937f43aee2897667aa00f9b9c816969528b Mon Sep 17 00:00:00 2001 From: Zhennan Qin Date: Wed, 26 Dec 2018 09:55:45 +0800 Subject: [PATCH 1/6] Check CI --- src/operator/quantization/quantization_utils.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/operator/quantization/quantization_utils.h b/src/operator/quantization/quantization_utils.h index ee7112205892..7083c47420cd 100644 --- a/src/operator/quantization/quantization_utils.h +++ b/src/operator/quantization/quantization_utils.h @@ -27,6 +27,7 @@ #include #include #include "../mxnet_op.h" +#include "../tensor/broadcast_reduce_op.h" namespace mxnet { namespace op { From 075d3c5c738bed1149107b4ad7baeda6e5ca3db1 Mon Sep 17 00:00:00 2001 From: Zhennan Qin Date: Fri, 28 Dec 2018 09:20:02 +0800 Subject: [PATCH 2/6] Try fix. --- .gitmodules | 2 +- 3rdparty/mshadow | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 836d824a6f5a..b0bf4a300582 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "3rdparty/mshadow"] path = 3rdparty/mshadow - url = https://github.com/dmlc/mshadow.git + url = https://github.com/ZhennanQin/mshadow.git [submodule "3rdparty/dmlc-core"] path = 3rdparty/dmlc-core url = https://github.com/dmlc/dmlc-core.git diff --git a/3rdparty/mshadow b/3rdparty/mshadow index 6dc04f7c729c..40d0a53b67e8 160000 --- a/3rdparty/mshadow +++ b/3rdparty/mshadow @@ -1 +1 @@ -Subproject commit 6dc04f7c729cd5c6c6210d5d4d2026a26ce0bfbf +Subproject commit 40d0a53b67e88f346cefe29f7351bae451b3eae9 From d69afc3a7f372cb295b11f7fbd301998121f5e1e Mon Sep 17 00:00:00 2001 From: Zhennan Qin Date: Fri, 28 Dec 2018 09:25:34 +0800 Subject: [PATCH 3/6] Retrigger CI --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 10dea2522182..0c02afda24c7 100644 --- a/LICENSE +++ b/LICENSE @@ -642,3 +642,4 @@ other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form. + From 74fc3eeb621cc9fbebf43fad963e0fe7fdb2f79b Mon Sep 17 00:00:00 2001 From: Zhennan Qin Date: Fri, 28 Dec 2018 09:55:43 +0800 Subject: [PATCH 4/6] Fix compare --- src/operator/convolution_v1-inl.h | 10 ++++++---- src/operator/nn/deconvolution-inl.h | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/operator/convolution_v1-inl.h b/src/operator/convolution_v1-inl.h index 758ce12d8006..c1664a1980ce 100644 --- a/src/operator/convolution_v1-inl.h +++ b/src/operator/convolution_v1-inl.h @@ -335,10 +335,12 @@ class ConvolutionV1Op : public Operator { oshape[2] * oshape[3]); // param_.workspace is in elements of sizeof(DType) // if param_.workspace is set to zero the nstep_ equals ishape[0] (batch) - nstep_ = std::max( - std::min(static_cast(param_.workspace) / - (shape_colunit_.Size() + shape_dstunit_.Size()), ishape[0]), - 1); + nstep_ = std::max( + std::min( + static_cast( + param_.workspace / (shape_colunit_.Size() + shape_dstunit_.Size())), + ishape[0]), + 1L); mshadow::Shape<2> scol = mshadow::Shape2(shape_colunit_[0], shape_colunit_[1] * nstep_); diff --git a/src/operator/nn/deconvolution-inl.h b/src/operator/nn/deconvolution-inl.h index d89a489c0183..73e9f82efd40 100644 --- a/src/operator/nn/deconvolution-inl.h +++ b/src/operator/nn/deconvolution-inl.h @@ -459,10 +459,12 @@ class DeconvolutionOp { oshape[1] / param_.num_group, oshape[2] * oshape[3]); // See convolution for workspace calculations. nstep_ will be the effective batch size - nstep_ = std::max( - std::min(static_cast(param_.workspace) / - (shape_colunit_.Size() + shape_dstunit_.Size()), ishape[0]), - 1); + nstep_ = std::max( + std::min( + static_cast( + param_.workspace / (shape_colunit_.Size() + shape_dstunit_.Size())), + ishape[0]), + 1L); mshadow::Shape<2> scol = mshadow::Shape2(shape_colunit_[0], shape_colunit_[1] * nstep_); From 635e7fec37861838fe5ac6dac88269a25ebb3401 Mon Sep 17 00:00:00 2001 From: Zhennan Qin Date: Fri, 28 Dec 2018 10:06:47 +0800 Subject: [PATCH 5/6] Fix windows build --- src/operator/convolution_v1-inl.h | 10 ++++------ src/operator/nn/deconvolution-inl.h | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/operator/convolution_v1-inl.h b/src/operator/convolution_v1-inl.h index c1664a1980ce..c9c34399b8d1 100644 --- a/src/operator/convolution_v1-inl.h +++ b/src/operator/convolution_v1-inl.h @@ -335,12 +335,10 @@ class ConvolutionV1Op : public Operator { oshape[2] * oshape[3]); // param_.workspace is in elements of sizeof(DType) // if param_.workspace is set to zero the nstep_ equals ishape[0] (batch) - nstep_ = std::max( - std::min( - static_cast( - param_.workspace / (shape_colunit_.Size() + shape_dstunit_.Size())), - ishape[0]), - 1L); + nstep_ = std::max(std::min(static_cast(param_.workspace / (shape_colunit_.Size() + + shape_dstunit_.Size())), + ishape[0]), + static_cast(1)); mshadow::Shape<2> scol = mshadow::Shape2(shape_colunit_[0], shape_colunit_[1] * nstep_); diff --git a/src/operator/nn/deconvolution-inl.h b/src/operator/nn/deconvolution-inl.h index 73e9f82efd40..3169e3bc69b5 100644 --- a/src/operator/nn/deconvolution-inl.h +++ b/src/operator/nn/deconvolution-inl.h @@ -459,12 +459,10 @@ class DeconvolutionOp { oshape[1] / param_.num_group, oshape[2] * oshape[3]); // See convolution for workspace calculations. nstep_ will be the effective batch size - nstep_ = std::max( - std::min( - static_cast( - param_.workspace / (shape_colunit_.Size() + shape_dstunit_.Size())), - ishape[0]), - 1L); + nstep_ = std::max(std::min(static_cast(param_.workspace / (shape_colunit_.Size() + + shape_dstunit_.Size())), + ishape[0]), + static_cast(1)); mshadow::Shape<2> scol = mshadow::Shape2(shape_colunit_[0], shape_colunit_[1] * nstep_); From e5081a909bdf59fb0bc9078394d493462a7e75f0 Mon Sep 17 00:00:00 2001 From: Zhennan Qin Date: Thu, 3 Jan 2019 14:59:08 +0800 Subject: [PATCH 6/6] clean code --- LICENSE | 1 - src/operator/convolution_v1-inl.h | 9 +++++---- src/operator/nn/deconvolution-inl.h | 9 +++++---- src/operator/quantization/quantization_utils.h | 1 - 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/LICENSE b/LICENSE index 0c02afda24c7..10dea2522182 100644 --- a/LICENSE +++ b/LICENSE @@ -642,4 +642,3 @@ other computer software, distribute, and sublicense such enhancements or derivative works thereof, in binary and source code form. - diff --git a/src/operator/convolution_v1-inl.h b/src/operator/convolution_v1-inl.h index c9c34399b8d1..e0baa4efb1d3 100644 --- a/src/operator/convolution_v1-inl.h +++ b/src/operator/convolution_v1-inl.h @@ -335,10 +335,11 @@ class ConvolutionV1Op : public Operator { oshape[2] * oshape[3]); // param_.workspace is in elements of sizeof(DType) // if param_.workspace is set to zero the nstep_ equals ishape[0] (batch) - nstep_ = std::max(std::min(static_cast(param_.workspace / (shape_colunit_.Size() + - shape_dstunit_.Size())), - ishape[0]), - static_cast(1)); + nstep_ = + std::max(std::min(static_cast(param_.workspace / (shape_colunit_.Size() + + shape_dstunit_.Size())), + ishape[0]), + 1); mshadow::Shape<2> scol = mshadow::Shape2(shape_colunit_[0], shape_colunit_[1] * nstep_); diff --git a/src/operator/nn/deconvolution-inl.h b/src/operator/nn/deconvolution-inl.h index 3169e3bc69b5..8f1470b9eb67 100644 --- a/src/operator/nn/deconvolution-inl.h +++ b/src/operator/nn/deconvolution-inl.h @@ -459,10 +459,11 @@ class DeconvolutionOp { oshape[1] / param_.num_group, oshape[2] * oshape[3]); // See convolution for workspace calculations. nstep_ will be the effective batch size - nstep_ = std::max(std::min(static_cast(param_.workspace / (shape_colunit_.Size() + - shape_dstunit_.Size())), - ishape[0]), - static_cast(1)); + nstep_ = + std::max(std::min(static_cast(param_.workspace / (shape_colunit_.Size() + + shape_dstunit_.Size())), + ishape[0]), + 1); mshadow::Shape<2> scol = mshadow::Shape2(shape_colunit_[0], shape_colunit_[1] * nstep_); diff --git a/src/operator/quantization/quantization_utils.h b/src/operator/quantization/quantization_utils.h index 7083c47420cd..ee7112205892 100644 --- a/src/operator/quantization/quantization_utils.h +++ b/src/operator/quantization/quantization_utils.h @@ -27,7 +27,6 @@ #include #include #include "../mxnet_op.h" -#include "../tensor/broadcast_reduce_op.h" namespace mxnet { namespace op {