From 6d91df0ac4364cb8d5643ec2eac9acbe54724870 Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Thu, 21 Mar 2019 22:24:26 +0800 Subject: [PATCH 01/10] use mkl sparse matrix to improve performance --- 3rdparty/sparse-matrix/Makefile | 21 +++++++++++ 3rdparty/sparse-matrix/sparse_matrix.cc | 45 +++++++++++++++++++++++ 3rdparty/sparse-matrix/sparse_matrix.h | 48 +++++++++++++++++++++++++ Makefile | 6 ++++ mkldnn.mk | 13 +++++++ src/operator/tensor/dot-inl.h | 25 ++++++++++++- 6 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 3rdparty/sparse-matrix/Makefile create mode 100644 3rdparty/sparse-matrix/sparse_matrix.cc create mode 100644 3rdparty/sparse-matrix/sparse_matrix.h diff --git a/3rdparty/sparse-matrix/Makefile b/3rdparty/sparse-matrix/Makefile new file mode 100644 index 000000000000..214312f6586c --- /dev/null +++ b/3rdparty/sparse-matrix/Makefile @@ -0,0 +1,21 @@ +CC = g++ +C = gcc +MKLROOT = /opt/intel/mkl + +ifneq ($(USE_INTEL_PATH),) + MKLROOT = $(USE_INTEL_PATH)/mkl +endif + +CFLAGS = -fpic -O2 -I/opt/intel/mkl/include -c -Wall -Werror -DMKL_ILP64 -m64 -std=c++11 +LDFLAGS = -Wl,--start-group -L${MKLROOT}/../compiler/lib/intel64 ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a -Wl,--end-group -liomp5 -lpthread -lm -ldl + +default: libsparse_matrix.so + +libsparse_matrix.so: sparse_matrix.o + $(CC) -shared -o libsparse_matrix.so sparse_matrix.o $(LDFLAGS) + +sparse_matrix.o: sparse_matrix.cc sparse_matrix.h + $(CC) $(CFLAGS) sparse_matrix.cc + +clean: + $(RM) libsparse_matrix.so *.o *~ diff --git a/3rdparty/sparse-matrix/sparse_matrix.cc b/3rdparty/sparse-matrix/sparse_matrix.cc new file mode 100644 index 000000000000..f40229438627 --- /dev/null +++ b/3rdparty/sparse-matrix/sparse_matrix.cc @@ -0,0 +1,45 @@ +#include +#include +#include +#include +#include "sparse_matrix.h" + + + +bool mkl_DotCsrDnsDns(SP_INT64* rows_start, SP_INT64* col_indx, + float* values, float* X, float* y, + int rows, int cols, int X_columns) +{ + + sparse_index_base_t indexing = SPARSE_INDEX_BASE_ZERO; + sparse_status_t status; + sparse_matrix_t A = NULL; + sparse_layout_t layout = SPARSE_LAYOUT_ROW_MAJOR; + float one, zero; + one = (float)1.0; + zero = (float)0.0; + + MKL_INT* rows_end = rows_start + 1; + status = mkl_sparse_s_create_csr(&A, indexing, rows, cols, rows_start, rows_end, col_indx, values); + + if (status != SPARSE_STATUS_SUCCESS) + { + std::cout << "mkl_sparse_s_create_csr status :" << status << std::endl; + return false; + } + sparse_operation_t operation = SPARSE_OPERATION_NON_TRANSPOSE; + struct matrix_descr descrA; + descrA.type = SPARSE_MATRIX_TYPE_GENERAL; + + status = mkl_sparse_s_mm(operation, one, A, descrA, layout, X, X_columns, X_columns, zero, y, X_columns); + if (status != SPARSE_STATUS_SUCCESS) + { + std::cout << "mkl_sparse_s_create_csr status :" << status << std::endl; + return false; + } + + mkl_sparse_destroy(A); + + return true; + +} diff --git a/3rdparty/sparse-matrix/sparse_matrix.h b/3rdparty/sparse-matrix/sparse_matrix.h new file mode 100644 index 000000000000..93054a80b374 --- /dev/null +++ b/3rdparty/sparse-matrix/sparse_matrix.h @@ -0,0 +1,48 @@ +#ifndef MXNET_OPERATOR_SPARSE_MATRIX_INL_H_ +#define MXNET_OPERATOR_SPARSE_MATRIX_INL_H_ + + +#if (!defined(__INTEL_COMPILER)) & defined(_MSC_VER) +#define SP_INT64 __int64 +#define SP_UINT64 unsigned __int64 +#else +#define SP_INT64 long long int +#define SP_UINT64 unsigned long long int +#endif + + +#if defined _WIN32 || defined __CYGWIN__ + #ifdef BUILDING_DLL + #ifdef __GNUC__ + #define SPM_API_PUBLIC __attribute__ ((dllexport)) + #else + #define SPM_API_PUBLIC __declspec(dllexport) // Note: actually gcc seems to also supports this syntax. + #endif + #else + #ifdef __GNUC__ + #define SPM_API_PUBLIC __attribute__ ((dllimport)) + #else + #define SPM_API_PUBLIC __declspec(dllimport) // Note: actually gcc seems to also supports this syntax. + #endif + #endif + #define SPM_API_LOCAL +#else + #if __GNUC__ >= 4 + #define SPM_API_PUBLIC __attribute__ ((visibility ("default"))) + #define SPM_API_LOCAL __attribute__ ((visibility ("hidden"))) + #else + #define SPM_API_PUBLIC + #define SPM_API_LOCAL + #endif +#endif + + + +extern "C" +{ + extern SPM_API_PUBLIC bool mkl_DotCsrDnsDns(SP_INT64* rows_start, SP_INT64* col_indx, + float* values, float* X, float* y, int rows, int cols, int X_columns); + +} + +#endif //MXNET_OPERATOR_SPARSE_MATRIX_INL_H_ \ No newline at end of file diff --git a/Makefile b/Makefile index 8ca708018b13..3a2fa8cac795 100644 --- a/Makefile +++ b/Makefile @@ -144,6 +144,12 @@ ifeq ($(USE_MKLDNN), 1) LDFLAGS += -L$(MKLDNNROOT)/lib -lmkldnn -Wl,-rpath,'$${ORIGIN}' endif +ifeq ($(USE_BLAS), mkl) + SPARSE_MATRIX_DIR = $(ROOTDIR)/3rdparty/sparse-matrix + CFLAGS += -I$(SPARSE_MATRIX_DIR) + LDFLAGS += -L$(SPARSE_MATRIX_DIR) -lsparse_matrix +endif + # setup opencv ifeq ($(USE_OPENCV), 1) CFLAGS += -DMXNET_USE_OPENCV=1 diff --git a/mkldnn.mk b/mkldnn.mk index be45ce5df5d4..57acf12388b9 100644 --- a/mkldnn.mk +++ b/mkldnn.mk @@ -50,10 +50,23 @@ $(MKLDNN_LIBFILE): cp $(MKLML_LIBFILE) $(MXNET_LIBDIR) cp $(MKLDNN_LIBFILE) $(MXNET_LIBDIR) +ifeq ($(USE_BLAS), mkl) +ifeq ($(USE_INTEL_PATH), NONE) + $(MAKE) -C $(SPARSE_MATRIX_DIR) +else + $(MAKE) -C $(SPARSE_MATRIX_DIR) USE_INTEL_PATH=$(USE_INTEL_PATH) +endif + cp $(SPARSE_MATRIX_DIR)/libsparse_matrix.so $(MXNET_LIBDIR) +endif + mkldnn_clean: $(RM) -r 3rdparty/mkldnn/build $(RM) -r $(MKLDNNROOT) +ifeq ($(USE_BLAS), mkl) + $(MAKE) -C $(SPARSE_MATRIX_DIR) clean +endif + ifeq ($(USE_MKLDNN), 1) mkldnn: mkldnn_build else diff --git a/src/operator/tensor/dot-inl.h b/src/operator/tensor/dot-inl.h index 163b4426cb2b..bcfc1b4a3692 100644 --- a/src/operator/tensor/dot-inl.h +++ b/src/operator/tensor/dot-inl.h @@ -38,7 +38,9 @@ #ifdef __CUDACC__ #include "./dot-inl.cuh" #endif // __CUDACC__ - +#if (MSHADOW_USE_MKL == 1) +#include "sparse_matrix.h" +#endif namespace mxnet { namespace op { @@ -775,6 +777,8 @@ inline void DotCsrDnsDnsImpl(const OpContext& ctx, } using nnvm::dim_t; + TShape lhs_shape = lhs.shape(); + TShape rhs_shape = rhs.shape_; const TBlob data_l = lhs.data(); const TBlob indptr_l = lhs.aux_data(csr::kIndPtr); @@ -782,6 +786,25 @@ inline void DotCsrDnsDnsImpl(const OpContext& ctx, const TBlob& data_r = rhs; const TBlob data_out = *ret; +#if (MSHADOW_USE_MKL == 1) + if (data_l.type_flag_ == mshadow::kFloat32 + && indptr_l.type_flag_ == mshadow::kInt64 + && col_idx_l.type_flag_ == mshadow::kInt64 + && !trans_lhs) { + bool ret = mkl_DotCsrDnsDns(static_cast(indptr_l.dptr_), + static_cast(col_idx_l.dptr_), + data_l.dptr(), + data_r.dptr(), + data_out.dptr(), + lhs_shape[0], + lhs_shape[1], + rhs_shape[1]); + if (ret) { + return; + } + } +#endif + MSHADOW_SGL_DBL_TYPE_SWITCH(data_l.type_flag_, DType, { // data type MSHADOW_IDX_TYPE_SWITCH(indptr_l.type_flag_, IType, { // indptr type MSHADOW_IDX_TYPE_SWITCH(col_idx_l.type_flag_, CType, { // col idx type From 5628528c3f628501014a6f472fade14ace4d3d4c Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Fri, 22 Mar 2019 10:04:52 +0800 Subject: [PATCH 02/10] fix build fail issue --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 3a2fa8cac795..e53d0a28d426 100644 --- a/Makefile +++ b/Makefile @@ -142,13 +142,12 @@ ifeq ($(USE_MKLDNN), 1) endif CFLAGS += -I$(MKLDNNROOT)/include LDFLAGS += -L$(MKLDNNROOT)/lib -lmkldnn -Wl,-rpath,'$${ORIGIN}' -endif - ifeq ($(USE_BLAS), mkl) SPARSE_MATRIX_DIR = $(ROOTDIR)/3rdparty/sparse-matrix CFLAGS += -I$(SPARSE_MATRIX_DIR) LDFLAGS += -L$(SPARSE_MATRIX_DIR) -lsparse_matrix endif +endif # setup opencv ifeq ($(USE_OPENCV), 1) From 6ca37b4ba38a1833a01b6555a8baad67bf68cb79 Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Fri, 22 Mar 2019 14:03:16 +0800 Subject: [PATCH 03/10] add 3rdparty/sparse matrix in Makefile --- Makefile | 29 +++++++++++++++++++++++------ mkldnn.mk | 13 ------------- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index e53d0a28d426..50235497fb58 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ ifeq ($(DEBUG), 1) else CFLAGS += -O3 -DNDEBUG=1 endif -CFLAGS += -I$(TPARTYDIR)/mshadow/ -I$(TPARTYDIR)/dmlc-core/include -fPIC -I$(NNVM_PATH)/include -I$(DLPACK_PATH)/include -I$(TPARTYDIR)/tvm/include -Iinclude $(MSHADOW_CFLAGS) +CFLAGS += -I$(TPARTYDIR)/mshadow/ -I$(TPARTYDIR)/dmlc-core/include -fPIC -I$(NNVM_PATH)/include -I$(DLPACK_PATH)/include -I$(TPARTYDIR)/tvm/include -Iinclude $(MSHADOW_CFLAGS) LDFLAGS = -pthread $(MSHADOW_LDFLAGS) $(DMLC_LDFLAGS) ifeq ($(ENABLE_TESTCOVERAGE), 1) @@ -142,13 +142,9 @@ ifeq ($(USE_MKLDNN), 1) endif CFLAGS += -I$(MKLDNNROOT)/include LDFLAGS += -L$(MKLDNNROOT)/lib -lmkldnn -Wl,-rpath,'$${ORIGIN}' -ifeq ($(USE_BLAS), mkl) - SPARSE_MATRIX_DIR = $(ROOTDIR)/3rdparty/sparse-matrix - CFLAGS += -I$(SPARSE_MATRIX_DIR) - LDFLAGS += -L$(SPARSE_MATRIX_DIR) -lsparse_matrix -endif endif + # setup opencv ifeq ($(USE_OPENCV), 1) CFLAGS += -DMXNET_USE_OPENCV=1 @@ -415,6 +411,14 @@ ifeq ($(USE_DIST_KVSTORE), 1) LDFLAGS += $(PS_LDFLAGS_A) endif +#sparse-matrix +ifeq ($(USE_BLAS), mkl) + SPARSE_MATRIX_DIR = $(ROOTDIR)/3rdparty/sparse-matrix + LIB_DEP += $(SPARSE_MATRIX_DIR)/libsparse_matrix.so + CFLAGS += -I$(SPARSE_MATRIX_DIR) + LDFLAGS += -L$(SPARSE_MATRIX_DIR) -lsparse_matrix +endif + .PHONY: clean all extra-packages test lint docs clean_all rcpplint rcppexport roxygen\ cython2 cython3 cython cyclean @@ -557,6 +561,17 @@ $(PS_PATH)/build/libps.a: PSLITE PSLITE: $(MAKE) CXX="$(CXX)" DEPS_PATH="$(DEPS_PATH)" -C $(PS_PATH) ps +ifeq ($(USE_BLAS), mkl) +$(SPARSE_MATRIX_DIR)/libsparse_matrix.so: SPARSE_MATRIX + +SPARSE_MATRIX: +ifeq ($(USE_INTEL_PATH), NONE) + $(MAKE) -C $(SPARSE_MATRIX_DIR) +else + $(MAKE) -C $(SPARSE_MATRIX_DIR) USE_INTEL_PATH=$(USE_INTEL_PATH) +endif +endif + $(DMLC_CORE)/libdmlc.a: DMLCCORE DMLCCORE: @@ -678,6 +693,7 @@ clean: rclean cyclean $(EXTRA_PACKAGES_CLEAN) (cd scala-package && mvn clean) || true cd $(DMLC_CORE); $(MAKE) clean; cd - cd $(PS_PATH); $(MAKE) clean; cd - + cd $(SPARSE_MATRIX_DIR); $(MAKE) clean; cd - cd $(NNVM_PATH); $(MAKE) clean; cd - cd $(AMALGAMATION_PATH); $(MAKE) clean; cd - $(RM) -r $(patsubst %, %/*.d, $(EXTRA_OPERATORS)) $(patsubst %, %/*/*.d, $(EXTRA_OPERATORS)) @@ -688,6 +704,7 @@ clean: rclean mkldnn_clean cyclean testclean $(EXTRA_PACKAGES_CLEAN) (cd scala-package && mvn clean) || true cd $(DMLC_CORE); $(MAKE) clean; cd - cd $(PS_PATH); $(MAKE) clean; cd - + cd $(SPARSE_MATRIX_DIR); $(MAKE) clean; cd - cd $(NNVM_PATH); $(MAKE) clean; cd - cd $(AMALGAMATION_PATH); $(MAKE) clean; cd - endif diff --git a/mkldnn.mk b/mkldnn.mk index 57acf12388b9..be45ce5df5d4 100644 --- a/mkldnn.mk +++ b/mkldnn.mk @@ -50,23 +50,10 @@ $(MKLDNN_LIBFILE): cp $(MKLML_LIBFILE) $(MXNET_LIBDIR) cp $(MKLDNN_LIBFILE) $(MXNET_LIBDIR) -ifeq ($(USE_BLAS), mkl) -ifeq ($(USE_INTEL_PATH), NONE) - $(MAKE) -C $(SPARSE_MATRIX_DIR) -else - $(MAKE) -C $(SPARSE_MATRIX_DIR) USE_INTEL_PATH=$(USE_INTEL_PATH) -endif - cp $(SPARSE_MATRIX_DIR)/libsparse_matrix.so $(MXNET_LIBDIR) -endif - mkldnn_clean: $(RM) -r 3rdparty/mkldnn/build $(RM) -r $(MKLDNNROOT) -ifeq ($(USE_BLAS), mkl) - $(MAKE) -C $(SPARSE_MATRIX_DIR) clean -endif - ifeq ($(USE_MKLDNN), 1) mkldnn: mkldnn_build else From be07f89e6cf37580a7c00d8957fbd50728d17306 Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Fri, 22 Mar 2019 14:13:48 +0800 Subject: [PATCH 04/10] add macro for variable --- src/operator/tensor/dot-inl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/operator/tensor/dot-inl.h b/src/operator/tensor/dot-inl.h index bcfc1b4a3692..8a1eda0350b0 100644 --- a/src/operator/tensor/dot-inl.h +++ b/src/operator/tensor/dot-inl.h @@ -777,9 +777,10 @@ inline void DotCsrDnsDnsImpl(const OpContext& ctx, } using nnvm::dim_t; +#if (MSHADOW_USE_MKL == 1) TShape lhs_shape = lhs.shape(); TShape rhs_shape = rhs.shape_; - +#endif const TBlob data_l = lhs.data(); const TBlob indptr_l = lhs.aux_data(csr::kIndPtr); const TBlob col_idx_l = lhs.aux_data(csr::kIdx); From 67960a4e646365162d4a54c6500476e8beedff85 Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Fri, 22 Mar 2019 16:19:13 +0800 Subject: [PATCH 05/10] fix lib not find error --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 50235497fb58..7a62b271ce35 100644 --- a/Makefile +++ b/Makefile @@ -570,6 +570,8 @@ ifeq ($(USE_INTEL_PATH), NONE) else $(MAKE) -C $(SPARSE_MATRIX_DIR) USE_INTEL_PATH=$(USE_INTEL_PATH) endif + mkdir -p $(ROOTDIR)/lib + cp $(SPARSE_MATRIX_DIR)/libsparse_matrix.so $(ROOTDIR)/lib/ endif $(DMLC_CORE)/libdmlc.a: DMLCCORE From d6e5e21db72edf975cbb451d0064f3bca83a95e7 Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Fri, 22 Mar 2019 23:20:19 +0800 Subject: [PATCH 06/10] fix gpu R test error --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 7a62b271ce35..fbe5f0d877eb 100644 --- a/Makefile +++ b/Makefile @@ -98,7 +98,7 @@ ifeq ($(DEBUG), 1) else CFLAGS += -O3 -DNDEBUG=1 endif -CFLAGS += -I$(TPARTYDIR)/mshadow/ -I$(TPARTYDIR)/dmlc-core/include -fPIC -I$(NNVM_PATH)/include -I$(DLPACK_PATH)/include -I$(TPARTYDIR)/tvm/include -Iinclude $(MSHADOW_CFLAGS) +CFLAGS += -I$(TPARTYDIR)/mshadow/ -I$(TPARTYDIR)/dmlc-core/include -fPIC -I$(NNVM_PATH)/include -I$(DLPACK_PATH)/include -I$(TPARTYDIR)/tvm/include -Iinclude $(MSHADOW_CFLAGS) LDFLAGS = -pthread $(MSHADOW_LDFLAGS) $(DMLC_LDFLAGS) ifeq ($(ENABLE_TESTCOVERAGE), 1) @@ -416,7 +416,7 @@ ifeq ($(USE_BLAS), mkl) SPARSE_MATRIX_DIR = $(ROOTDIR)/3rdparty/sparse-matrix LIB_DEP += $(SPARSE_MATRIX_DIR)/libsparse_matrix.so CFLAGS += -I$(SPARSE_MATRIX_DIR) - LDFLAGS += -L$(SPARSE_MATRIX_DIR) -lsparse_matrix + LDFLAGS += -L$(SPARSE_MATRIX_DIR) -lsparse_matrix -Wl,-rpath,'$${ORIGIN}' endif .PHONY: clean all extra-packages test lint docs clean_all rcpplint rcppexport roxygen\ @@ -556,6 +556,10 @@ ifeq ($(UNAME_S), Darwin) endif endif +ifeq ($(USE_BLAS), mkl) + install_name_tool -change '@rpath/libsparse_matrix.dylib' '@loader_path/libsparse_matrix.dylib' $@ +endif + $(PS_PATH)/build/libps.a: PSLITE PSLITE: @@ -650,6 +654,10 @@ rpkg: cp -rf lib/libmklml_intel.so R-package/inst/libs; \ fi + if [ -e "lib/libsparse_matrix.so" ]; then \ + cp -rf lib/libsparse_matrix.so R-package/inst/libs; \ + fi + mkdir -p R-package/inst/include cp -rl include/* R-package/inst/include Rscript -e "if(!require(devtools)){install.packages('devtools', repo = 'https://cloud.r-project.org/')}" From 7ed707df747f9f80f670730299f1b57597afaa43 Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Fri, 22 Mar 2019 23:28:55 +0800 Subject: [PATCH 07/10] fix Mac build error --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index fbe5f0d877eb..134803054f76 100644 --- a/Makefile +++ b/Makefile @@ -557,8 +557,10 @@ endif endif ifeq ($(USE_BLAS), mkl) +ifeq ($(UNAME_S), Darwin) install_name_tool -change '@rpath/libsparse_matrix.dylib' '@loader_path/libsparse_matrix.dylib' $@ endif +endif $(PS_PATH)/build/libps.a: PSLITE From eb9c8830c78a6a4cae4e20c9870a8b7d5250fe05 Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Wed, 27 Mar 2019 15:24:55 +0800 Subject: [PATCH 08/10] add lib/libsparse_matrix.so to CI --- ci/jenkins/Jenkins_steps.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/jenkins/Jenkins_steps.groovy b/ci/jenkins/Jenkins_steps.groovy index e34b25d6d355..5b9ad47f6afb 100644 --- a/ci/jenkins/Jenkins_steps.groovy +++ b/ci/jenkins/Jenkins_steps.groovy @@ -33,7 +33,7 @@ mx_cmake_lib = 'build/libmxnet.so, build/libmxnet.a, build/3rdparty/dmlc-core/li // mxnet cmake libraries, in cmake builds we do not produce a libnvvm static library by default. mx_cmake_lib_debug = 'build/libmxnet.so, build/libmxnet.a, build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests' mx_cmake_mkldnn_lib = 'build/libmxnet.so, build/libmxnet.a, build/3rdparty/dmlc-core/libdmlc.a, build/tests/mxnet_unit_tests, build/3rdparty/openmp/runtime/src/libomp.so, build/3rdparty/mkldnn/src/libmkldnn.so.0' -mx_mkldnn_lib = 'lib/libmxnet.so, lib/libmxnet.a, lib/libiomp5.so, lib/libmkldnn.so.0, lib/libmklml_intel.so, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a' +mx_mkldnn_lib = 'lib/libmxnet.so, lib/libmxnet.a, lib/libiomp5.so, lib/libmkldnn.so.0, lib/libmklml_intel.so, lib/libsparse_matrix.so, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a' mx_tensorrt_lib = 'build/libmxnet.so, lib/libnvonnxparser_runtime.so.0, lib/libnvonnxparser.so.0, lib/libonnx_proto.so, lib/libonnx.so' mx_lib_cpp_examples = 'lib/libmxnet.so, lib/libmxnet.a, 3rdparty/dmlc-core/libdmlc.a, 3rdparty/tvm/nnvm/lib/libnnvm.a, 3rdparty/ps-lite/build/libps.a, deps/lib/libprotobuf-lite.a, deps/lib/libzmq.a, build/cpp-package/example/*' mx_lib_cpp_examples_cpu = 'build/libmxnet.so, build/cpp-package/example/*' From 5fbd8a2c97acf4edf1580eab21f9f605bdbd99f2 Mon Sep 17 00:00:00 2001 From: rongzha1 Date: Tue, 9 Apr 2019 16:47:43 +0800 Subject: [PATCH 09/10] fix indentation --- 3rdparty/sparse-matrix/sparse_matrix.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/3rdparty/sparse-matrix/sparse_matrix.cc b/3rdparty/sparse-matrix/sparse_matrix.cc index f40229438627..fa362f0f8a18 100644 --- a/3rdparty/sparse-matrix/sparse_matrix.cc +++ b/3rdparty/sparse-matrix/sparse_matrix.cc @@ -15,28 +15,28 @@ bool mkl_DotCsrDnsDns(SP_INT64* rows_start, SP_INT64* col_indx, sparse_status_t status; sparse_matrix_t A = NULL; sparse_layout_t layout = SPARSE_LAYOUT_ROW_MAJOR; - float one, zero; + float one, zero; one = (float)1.0; zero = (float)0.0; MKL_INT* rows_end = rows_start + 1; status = mkl_sparse_s_create_csr(&A, indexing, rows, cols, rows_start, rows_end, col_indx, values); - if (status != SPARSE_STATUS_SUCCESS) - { - std::cout << "mkl_sparse_s_create_csr status :" << status << std::endl; - return false; - } + if (status != SPARSE_STATUS_SUCCESS) + { + std::cout << "mkl_sparse_s_create_csr status :" << status << std::endl; + return false; + } sparse_operation_t operation = SPARSE_OPERATION_NON_TRANSPOSE; struct matrix_descr descrA; descrA.type = SPARSE_MATRIX_TYPE_GENERAL; status = mkl_sparse_s_mm(operation, one, A, descrA, layout, X, X_columns, X_columns, zero, y, X_columns); - if (status != SPARSE_STATUS_SUCCESS) - { - std::cout << "mkl_sparse_s_create_csr status :" << status << std::endl; - return false; - } + if (status != SPARSE_STATUS_SUCCESS) + { + std::cout << "mkl_sparse_s_create_csr status :" << status << std::endl; + return false; + } mkl_sparse_destroy(A); From f0db59980d9baa4f79ea8e2f932b1ab182acef21 Mon Sep 17 00:00:00 2001 From: triplekings <76171568@qq.com> Date: Fri, 12 Apr 2019 16:26:06 +0800 Subject: [PATCH 10/10] retrigger CI