Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
c112b645
P
Paddle
项目概览
Crayon鑫
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c112b645
编写于
1月 04, 2020
作者:
A
Adam
提交者:
Tao Luo
1月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update MKL-DNN to 1.1 (#21754)
上级
7f4abaf2
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
18 addition
and
8 deletion
+18
-8
cmake/external/mkldnn.cmake
cmake/external/mkldnn.cmake
+11
-4
python/setup.py.in
python/setup.py.in
+7
-4
未找到文件。
cmake/external/mkldnn.cmake
浏览文件 @
c112b645
...
@@ -19,7 +19,14 @@ SET(MKLDNN_PREFIX_DIR ${THIRD_PARTY_PATH}/mkldnn)
...
@@ -19,7 +19,14 @@ SET(MKLDNN_PREFIX_DIR ${THIRD_PARTY_PATH}/mkldnn)
SET
(
MKLDNN_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/mkldnn
)
SET
(
MKLDNN_INSTALL_DIR
${
THIRD_PARTY_PATH
}
/install/mkldnn
)
SET
(
MKLDNN_INC_DIR
"
${
MKLDNN_INSTALL_DIR
}
/include"
CACHE PATH
"mkldnn include directory."
FORCE
)
SET
(
MKLDNN_INC_DIR
"
${
MKLDNN_INSTALL_DIR
}
/include"
CACHE PATH
"mkldnn include directory."
FORCE
)
SET
(
MKLDNN_REPOSITORY https://github.com/intel/mkl-dnn.git
)
SET
(
MKLDNN_REPOSITORY https://github.com/intel/mkl-dnn.git
)
SET
(
MKLDNN_TAG 518a316a8cd6deb82dc7866bc04bd0355a25c3a4
)
if
(
WIN32
)
# For Windows use 1.0 version of MKL-DNN
SET
(
MKLDNN_TAG 518a316a8cd6deb82dc7866bc04bd0355a25c3a4
)
else
(
WIN32
)
SET
(
MKLDNN_TAG 52c3052df8ec1d5b8b45cb6c350a952840eabd42
)
endif
(
WIN32
)
# Introduce variables:
# Introduce variables:
# * CMAKE_INSTALL_LIBDIR
# * CMAKE_INSTALL_LIBDIR
...
@@ -71,13 +78,13 @@ ExternalProject_Add(
...
@@ -71,13 +78,13 @@ ExternalProject_Add(
-DMKLROOT=
${
MKLML_ROOT
}
-DMKLROOT=
${
MKLML_ROOT
}
-DCMAKE_C_FLAGS=
${
MKLDNN_CFLAG
}
-DCMAKE_C_FLAGS=
${
MKLDNN_CFLAG
}
-DCMAKE_CXX_FLAGS=
${
MKLDNN_CXXFLAG
}
-DCMAKE_CXX_FLAGS=
${
MKLDNN_CXXFLAG
}
-D
MKLDNN_BUILD_TESTS=OFF -DMKLDNN
_BUILD_EXAMPLES=OFF
-D
DNNL_BUILD_TESTS=OFF -DDNNL
_BUILD_EXAMPLES=OFF
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
${
MKLDNN_INSTALL_DIR
}
CMAKE_CACHE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
${
MKLDNN_INSTALL_DIR
}
)
)
if
(
WIN32
)
if
(
WIN32
)
SET
(
MKLDNN_LIB
"
${
MKLDNN_INSTALL_DIR
}
/
${
LIBDIR
}
/mkldnn.lib"
CACHE FILEPATH
"mkldnn library."
FORCE
)
SET
(
MKLDNN_LIB
"
${
MKLDNN_INSTALL_DIR
}
/
${
LIBDIR
}
/mkldnn.lib"
CACHE FILEPATH
"mkldnn library."
FORCE
)
else
(
WIN32
)
else
(
WIN32
)
SET
(
MKLDNN_LIB
"
${
MKLDNN_INSTALL_DIR
}
/
${
LIBDIR
}
/lib
mkldnn
.so"
CACHE FILEPATH
"mkldnn library."
FORCE
)
SET
(
MKLDNN_LIB
"
${
MKLDNN_INSTALL_DIR
}
/
${
LIBDIR
}
/lib
dnnl
.so"
CACHE FILEPATH
"mkldnn library."
FORCE
)
endif
(
WIN32
)
endif
(
WIN32
)
ADD_LIBRARY
(
shared_mkldnn SHARED IMPORTED GLOBAL
)
ADD_LIBRARY
(
shared_mkldnn SHARED IMPORTED GLOBAL
)
...
@@ -100,7 +107,7 @@ if(WIN32)
...
@@ -100,7 +107,7 @@ if(WIN32)
SET
(
MKLDNN_SHARED_LIB
${
MKLDNN_INSTALL_DIR
}
/bin/mkldnn.dll
)
SET
(
MKLDNN_SHARED_LIB
${
MKLDNN_INSTALL_DIR
}
/bin/mkldnn.dll
)
else
(
WIN32
)
else
(
WIN32
)
SET
(
MKLDNN_SHARED_LIB
${
MKLDNN_INSTALL_DIR
}
/libmkldnn.so.0
)
SET
(
MKLDNN_SHARED_LIB
${
MKLDNN_INSTALL_DIR
}
/libmkldnn.so.0
)
SET
(
MKLDNN_SHARED_LIB_1
${
MKLDNN_INSTALL_DIR
}
/lib
mkldnn
.so.1
)
SET
(
MKLDNN_SHARED_LIB_1
${
MKLDNN_INSTALL_DIR
}
/lib
dnnl
.so.1
)
ADD_CUSTOM_COMMAND
(
TARGET
${
MKLDNN_PROJECT
}
POST_BUILD
ADD_CUSTOM_COMMAND
(
TARGET
${
MKLDNN_PROJECT
}
POST_BUILD
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
MKLDNN_LIB
}
${
MKLDNN_SHARED_LIB
}
)
COMMAND
${
CMAKE_COMMAND
}
-E copy
${
MKLDNN_LIB
}
${
MKLDNN_SHARED_LIB
}
)
ADD_CUSTOM_COMMAND
(
TARGET
${
MKLDNN_PROJECT
}
POST_BUILD
ADD_CUSTOM_COMMAND
(
TARGET
${
MKLDNN_PROJECT
}
POST_BUILD
...
...
python/setup.py.in
浏览文件 @
c112b645
...
@@ -203,16 +203,19 @@ if '${WITH_MKLDNN}' == 'ON':
...
@@ -203,16 +203,19 @@ if '${WITH_MKLDNN}' == 'ON':
# TODO(typhoonzero): use install_name_tool to patch mkl libs once
# TODO(typhoonzero): use install_name_tool to patch mkl libs once
# we can support mkl on mac.
# we can support mkl on mac.
#
#
# change rpath of lib
mkldnn
.so.1, add $ORIGIN/ to it.
# change rpath of lib
dnnl
.so.1, add $ORIGIN/ to it.
# The reason is that all thirdparty libraries in the same directory,
# The reason is that all thirdparty libraries in the same directory,
# thus, lib
mkldnn
.so.1 will find libmklml_intel.so and libiomp5.so.
# thus, lib
dnnl
.so.1 will find libmklml_intel.so and libiomp5.so.
command = "patchelf --set-rpath '$ORIGIN/' ${MKLDNN_SHARED_LIB}"
command = "patchelf --set-rpath '$ORIGIN/' ${MKLDNN_SHARED_LIB}"
if os.system(command) != 0:
if os.system(command) != 0:
raise Exception("patch libmkldnn.so failed, command: %s" % command)
raise Exception("patch libdnnl.so failed, command: %s" % command)
package_data['paddle.libs']+=['libmkldnn.so.0','libmkldnn.so.1' if os.name != 'nt' else ('mkldnn' + ext_name)]
shutil.copy('${MKLDNN_SHARED_LIB}', libs_path)
shutil.copy('${MKLDNN_SHARED_LIB}', libs_path)
if os.name != 'nt':
if os.name != 'nt':
shutil.copy('${MKLDNN_SHARED_LIB_1}', libs_path)
shutil.copy('${MKLDNN_SHARED_LIB_1}', libs_path)
package_data['paddle.libs']+=['libmkldnn.so.0', 'libdnnl.so.1']
else:
package_data['paddle.libs']+=['mkldnn.dll']
if '${WITH_NGRAPH}' == 'ON':
if '${WITH_NGRAPH}' == 'ON':
# only change rpath in Release mode,
# only change rpath in Release mode,
# since in Debug mode, nGraph lib may be too large to be changed?
# since in Debug mode, nGraph lib may be too large to be changed?
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录