diff --git a/cmake/external/mklml.cmake b/cmake/external/mklml.cmake index d0af809f4bb80d6e15609d9756fd418bd4a669f9..4cf9b626d15472206f47cd604d0b5b87089c4476 100644 --- a/cmake/external/mklml.cmake +++ b/cmake/external/mklml.cmake @@ -21,14 +21,12 @@ SET(MKLML_INC_DIR ${MKLML_ROOT}/include) SET(MKLML_LIB_DIR ${MKLML_ROOT}/lib) SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}" "${MKLML_ROOT}/lib") -SET(TIME_VERSION "2019.0.1.20181227") IF(WIN32) - SET(MKLML_VER "mklml_win_${TIME_VERSION}" CACHE STRING "" FORCE) + SET(MKLML_VER "mklml_win_2019.0.5.20190502" CACHE STRING "" FORCE) SET(MKLML_URL "https://paddlepaddledeps.bj.bcebos.com/${MKLML_VER}.zip" CACHE STRING "" FORCE) SET(MKLML_LIB ${MKLML_LIB_DIR}/mklml.lib) SET(MKLML_IOMP_LIB ${MKLML_LIB_DIR}/libiomp5md.lib) SET(MKLML_SHARED_LIB ${MKLML_LIB_DIR}/mklml.dll) - SET(MKLML_SHARED_LIB_DEPS ${MKLML_LIB_DIR}/msvcr120.dll) SET(MKLML_SHARED_IOMP_LIB ${MKLML_LIB_DIR}/libiomp5md.dll) ELSE() #TODO(intel-huying): diff --git a/cmake/inference_lib.cmake b/cmake/inference_lib.cmake index a52d91741aff721d1fa342a0bcd8ec5e8dd9eff3..7ab74e3cf2c1d010b8955a0f6bceb4f59ab677f7 100644 --- a/cmake/inference_lib.cmake +++ b/cmake/inference_lib.cmake @@ -61,9 +61,9 @@ function(copy_part_of_thrid_party TARGET DST) if(WIN32) copy(${TARGET} SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_SHARED_LIB} - ${MKLML_SHARED_LIB_DEPS} ${MKLML_SHARED_IOMP_LIB} ${MKLML_INC_DIR} + ${MKLML_SHARED_IOMP_LIB} ${MKLML_INC_DIR} DSTS ${dst_dir}/lib ${dst_dir}/lib ${dst_dir}/lib - ${dst_dir}/lib ${dst_dir}/lib ${dst_dir}) + ${dst_dir}/lib ${dst_dir}) else() copy(${TARGET} SRCS ${MKLML_LIB} ${MKLML_IOMP_LIB} ${MKLML_INC_DIR} diff --git a/paddle/fluid/inference/api/analysis_predictor.cc b/paddle/fluid/inference/api/analysis_predictor.cc index 1bcbe6acf0257b21aa3ee4a94cc80404e91a7335..5220388a2771901f9d755492f5033a4f885fa1f1 100644 --- a/paddle/fluid/inference/api/analysis_predictor.cc +++ b/paddle/fluid/inference/api/analysis_predictor.cc @@ -323,13 +323,11 @@ bool AnalysisPredictor::Run(const std::vector &inputs, #ifdef PADDLE_WITH_MKLDNN if (config_.use_mkldnn_) MkldnnPostReset(); #endif -#if defined(PADDLE_WITH_MKLML) && defined(_LINUX) +#if defined(PADDLE_WITH_MKLML) // Frees unused memory allocated by the IntelĀ® MKL Memory Allocator to // avoid memory leak. See: // https://software.intel.com/en-us/mkl-developer-reference-c-mkl-free-buffers platform::dynload::MKL_Free_Buffers(); -// We don't support windows since MKL_Free_Buffers is not in -// mklml_win_2019.0.1.20181227.zip. We will upgrade mklml_win version later. #endif return true; } @@ -710,13 +708,11 @@ bool AnalysisPredictor::ZeroCopyRun() { // recover the cpu_math_library_num_threads to 1, in order to avoid thread // conflict when integrating it into deployment service. paddle::platform::SetNumThreads(1); -#if defined(PADDLE_WITH_MKLML) && defined(_LINUX) +#if defined(PADDLE_WITH_MKLML) // Frees unused memory allocated by the IntelĀ® MKL Memory Allocator to // avoid memory leak. See: // https://software.intel.com/en-us/mkl-developer-reference-c-mkl-free-buffers platform::dynload::MKL_Free_Buffers(); -// We don't support windows since MKL_Free_Buffers is not in -// mklml_win_2019.0.1.20181227.zip. We will upgrade mklml_win version later. #endif return true; } diff --git a/paddle/fluid/inference/api/demo_ci/CMakeLists.txt b/paddle/fluid/inference/api/demo_ci/CMakeLists.txt index 67519e3f4c557c3bfeb13ee53a6d379e860cc763..0eccba2f00d00a4ceedc38adc123b0368b820a77 100644 --- a/paddle/fluid/inference/api/demo_ci/CMakeLists.txt +++ b/paddle/fluid/inference/api/demo_ci/CMakeLists.txt @@ -165,7 +165,6 @@ if(WIN32) add_custom_command(TARGET ${DEMO_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${MATH_LIB_PATH}/lib/mklml.dll ${CMAKE_BINARY_DIR}/Release COMMAND ${CMAKE_COMMAND} -E copy ${MATH_LIB_PATH}/lib/libiomp5md.dll ${CMAKE_BINARY_DIR}/Release - COMMAND ${CMAKE_COMMAND} -E copy ${MATH_LIB_PATH}/lib/msvcr120.dll ${CMAKE_BINARY_DIR}/Release COMMAND ${CMAKE_COMMAND} -E copy ${MKLDNN_PATH}/lib/mkldnn.dll ${CMAKE_BINARY_DIR}/Release ) else() diff --git a/paddle/fluid/pybind/CMakeLists.txt b/paddle/fluid/pybind/CMakeLists.txt index 0fad32d160fd388d6bf150e61634bddbe7d967aa..70cd1b5d1af11ca63c84ee8c5a800e9eb12c5e42 100644 --- a/paddle/fluid/pybind/CMakeLists.txt +++ b/paddle/fluid/pybind/CMakeLists.txt @@ -69,7 +69,6 @@ if(WITH_PYTHON) if(${CBLAS_PROVIDER} STREQUAL MKLML) add_custom_command(TARGET op_function_generator POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${MKLML_SHARED_LIB} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE} - COMMAND ${CMAKE_COMMAND} -E copy ${MKLML_SHARED_LIB_DEPS} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE} COMMAND ${CMAKE_COMMAND} -E copy ${MKLML_SHARED_IOMP_LIB} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE} ) else(${CBLAS_PROVIDER} STREQUAL EXTERN_OPENBLAS) diff --git a/python/setup.py.in b/python/setup.py.in index 8432361403b63e5d1c14ecee16363ee8329604a6..4fc2c352a53285b08ea5fe223f647ac74b6ede14 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -251,10 +251,6 @@ if '${WITH_MKL}' == 'ON': shutil.copy('${MKLML_SHARED_LIB}', libs_path) shutil.copy('${MKLML_SHARED_IOMP_LIB}', libs_path) package_data['paddle.libs']+=[('libmklml_intel' if os.name != 'nt' else 'mklml') + ext_name, ('libiomp5' if os.name != 'nt' else 'libiomp5md') + ext_name] - # mklml has dependency to vs runtime library - if os.name == 'nt': - shutil.copy('${MKLML_SHARED_LIB_DEPS}', libs_path) - package_data['paddle.libs'] += ['msvcr120.dll'] else: if os.name == 'nt': # copy the openblas.dll