Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
e47c3f04
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看板
未验证
提交
e47c3f04
编写于
6月 15, 2021
作者:
W
Wilber
提交者:
GitHub
6月 15, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[XPU] Update cmake options for xpu. (#33450)
上级
ff825238
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
27 addition
and
26 deletion
+27
-26
cmake/external/lite.cmake
cmake/external/lite.cmake
+22
-8
cmake/external/xpu.cmake
cmake/external/xpu.cmake
+5
-6
python/setup.py.in
python/setup.py.in
+0
-12
未找到文件。
cmake/external/lite.cmake
浏览文件 @
e47c3f04
...
@@ -18,13 +18,21 @@ if(NOT LINUX)
...
@@ -18,13 +18,21 @@ if(NOT LINUX)
return
()
return
()
endif
()
endif
()
if
(
XPU_SDK_ROOT
)
if
(
LITE_WITH_XPU
)
set
(
LITE_WITH_XPU ON
)
include_directories
(
"
${
XPU_SDK_ROOT
}
/XTDK/include"
)
include_directories
(
"
${
XPU_SDK_ROOT
}
/XTCL/include"
)
add_definitions
(
-DLITE_SUBGRAPH_WITH_XPU
)
add_definitions
(
-DLITE_SUBGRAPH_WITH_XPU
)
LINK_DIRECTORIES
(
"
${
XPU_SDK_ROOT
}
/XTDK/shlib/"
)
IF
(
WITH_AARCH64
)
LINK_DIRECTORIES
(
"
${
XPU_SDK_ROOT
}
/XTDK/runtime/shlib/"
)
SET
(
XPU_SDK_ENV
"kylin_aarch64"
)
ELSEIF
(
WITH_SUNWAY
)
SET
(
XPU_SDK_ENV
"deepin_sw6_64"
)
ELSEIF
(
WITH_BDCENTOS
)
SET
(
XPU_SDK_ENV
"bdcentos_x86_64"
)
ELSEIF
(
WITH_UBUNTU
)
SET
(
XPU_SDK_ENV
"ubuntu_x86_64"
)
ELSEIF
(
WITH_CENTOS
)
SET
(
XPU_SDK_ENV
"centos7_x86_64"
)
ELSE
()
SET
(
XPU_SDK_ENV
"ubuntu_x86_64"
)
ENDIF
()
endif
()
endif
()
if
(
NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR
)
if
(
NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR
)
...
@@ -57,7 +65,8 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
...
@@ -57,7 +65,8 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
-DWITH_TESTING=OFF
-DWITH_TESTING=OFF
-DLITE_BUILD_EXTRA=ON
-DLITE_BUILD_EXTRA=ON
-DLITE_WITH_XPU=
${
LITE_WITH_XPU
}
-DLITE_WITH_XPU=
${
LITE_WITH_XPU
}
-DXPU_SDK_ROOT=
${
XPU_SDK_ROOT
}
-DXPU_SDK_URL=
${
XPU_BASE_URL
}
-DXPU_SDK_ENV=
${
XPU_SDK_ENV
}
-DLITE_WITH_CODE_META_INFO=OFF
-DLITE_WITH_CODE_META_INFO=OFF
-DLITE_WITH_ARM=ON
)
-DLITE_WITH_ARM=ON
)
ExternalProject_Add
(
ExternalProject_Add
(
...
@@ -99,7 +108,8 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
...
@@ -99,7 +108,8 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
-DLITE_WITH_STATIC_CUDA=OFF
-DLITE_WITH_STATIC_CUDA=OFF
-DCUDA_ARCH_NAME=
${
CUDA_ARCH_NAME
}
-DCUDA_ARCH_NAME=
${
CUDA_ARCH_NAME
}
-DLITE_WITH_XPU=
${
LITE_WITH_XPU
}
-DLITE_WITH_XPU=
${
LITE_WITH_XPU
}
-DXPU_SDK_ROOT=
${
XPU_SDK_ROOT
}
-DXPU_SDK_URL=
${
XPU_SDK_URL
}
-DXPU_SDK_ENV=
${
XPU_SDK_ENV
}
-DLITE_WITH_CODE_META_INFO=OFF
-DLITE_WITH_CODE_META_INFO=OFF
-DLITE_WITH_ARM=OFF
)
-DLITE_WITH_ARM=OFF
)
...
@@ -147,6 +157,10 @@ message(STATUS "Paddle-lite BINARY_DIR: ${LITE_BINARY_DIR}")
...
@@ -147,6 +157,10 @@ message(STATUS "Paddle-lite BINARY_DIR: ${LITE_BINARY_DIR}")
message
(
STATUS
"Paddle-lite SOURCE_DIR:
${
LITE_SOURCE_DIR
}
"
)
message
(
STATUS
"Paddle-lite SOURCE_DIR:
${
LITE_SOURCE_DIR
}
"
)
include_directories
(
${
LITE_SOURCE_DIR
}
)
include_directories
(
${
LITE_SOURCE_DIR
}
)
include_directories
(
${
LITE_BINARY_DIR
}
)
include_directories
(
${
LITE_BINARY_DIR
}
)
if
(
LITE_WITH_XPU
)
include_directories
(
${
LITE_BINARY_DIR
}
/third_party/install/xpu/xdnn/include/
)
include_directories
(
${
LITE_BINARY_DIR
}
/third_party/install/xpu/xre/include/
)
endif
()
function
(
external_lite_libs alias path
)
function
(
external_lite_libs alias path
)
add_library
(
${
alias
}
SHARED IMPORTED GLOBAL
)
add_library
(
${
alias
}
SHARED IMPORTED GLOBAL
)
...
...
cmake/external/xpu.cmake
浏览文件 @
e47c3f04
...
@@ -33,7 +33,10 @@ ELSE ()
...
@@ -33,7 +33,10 @@ ELSE ()
SET
(
XPU_XCCL_DIR_NAME
"xccl-bdcentos_x86_64"
)
SET
(
XPU_XCCL_DIR_NAME
"xccl-bdcentos_x86_64"
)
ENDIF
()
ENDIF
()
SET
(
XPU_BASE_URL
"https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev/20210527"
)
IF
(
NOT XPU_BASE_URL
)
SET
(
XPU_BASE_URL
"https://baidu-kunlun-product.cdn.bcebos.com/KL-SDK/klsdk-dev/20210527"
)
ENDIF
()
SET
(
XPU_XRE_URL
"
${
XPU_BASE_URL
}
/
${
XPU_XRE_DIR_NAME
}
.tar.gz"
CACHE STRING
""
FORCE
)
SET
(
XPU_XRE_URL
"
${
XPU_BASE_URL
}
/
${
XPU_XRE_DIR_NAME
}
.tar.gz"
CACHE STRING
""
FORCE
)
SET
(
XPU_XDNN_URL
"
${
XPU_BASE_URL
}
/
${
XPU_XDNN_DIR_NAME
}
.tar.gz"
CACHE STRING
""
FORCE
)
SET
(
XPU_XDNN_URL
"
${
XPU_BASE_URL
}
/
${
XPU_XDNN_DIR_NAME
}
.tar.gz"
CACHE STRING
""
FORCE
)
SET
(
XPU_XCCL_URL
"
${
XPU_BASE_URL
}
/
${
XPU_XCCL_DIR_NAME
}
.tar.gz"
CACHE STRING
""
FORCE
)
SET
(
XPU_XCCL_URL
"
${
XPU_BASE_URL
}
/
${
XPU_XCCL_DIR_NAME
}
.tar.gz"
CACHE STRING
""
FORCE
)
...
@@ -93,11 +96,7 @@ ELSE(WITH_XPU_BKCL)
...
@@ -93,11 +96,7 @@ ELSE(WITH_XPU_BKCL)
TARGET_LINK_LIBRARIES
(
xpulib
${
XPU_API_LIB
}
${
XPU_RT_LIB
}
)
TARGET_LINK_LIBRARIES
(
xpulib
${
XPU_API_LIB
}
${
XPU_RT_LIB
}
)
ENDIF
(
WITH_XPU_BKCL
)
ENDIF
(
WITH_XPU_BKCL
)
if
(
NOT XPU_SDK_ROOT
)
ADD_DEPENDENCIES
(
xpulib
${
XPU_PROJECT
}
)
ADD_DEPENDENCIES
(
xpulib
${
XPU_PROJECT
}
)
else
()
ADD_CUSTOM_TARGET
(
extern_xpu DEPENDS xpulib
)
endif
()
# Ensure that xpu/api.h can be included without dependency errors.
# Ensure that xpu/api.h can be included without dependency errors.
file
(
GENERATE OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/.xpu_headers_dummy.cc CONTENT
""
)
file
(
GENERATE OUTPUT
${
CMAKE_CURRENT_BINARY_DIR
}
/.xpu_headers_dummy.cc CONTENT
""
)
...
...
python/setup.py.in
浏览文件 @
e47c3f04
...
@@ -347,18 +347,6 @@ if '${WITH_XPU_BKCL}' == 'ON':
...
@@ -347,18 +347,6 @@ if '${WITH_XPU_BKCL}' == 'ON':
shutil.copy('${XPU_BKCL_LIB}', libs_path)
shutil.copy('${XPU_BKCL_LIB}', libs_path)
package_data['paddle.libs']+=['${XPU_BKCL_LIB_NAME}']
package_data['paddle.libs']+=['${XPU_BKCL_LIB_NAME}']
# Only for lite xpu inference.
if '${WITH_XPU}' == 'OFF' and '${XPU_SDK_ROOT}' != '':
xpu_api_lib = os.path.join('${XPU_SDK_ROOT}', 'XTDK/shlib/', 'libxpuapi.so')
xpu_rt_lib = os.path.join('${XPU_SDK_ROOT}', 'XTDK/runtime/shlib/', 'libxpurt.so')
if os.path.exists(xpu_api_lib):
shutil.copy(xpu_api_lib, libs_path)
package_data['paddle.libs']+=['libxpuapi.so']
if os.path.exists(xpu_rt_lib):
shutil.copy(xpu_rt_lib, libs_path)
package_data['paddle.libs']+=['libxpurt.so']
# remove unused paddle/libs/__init__.py
# remove unused paddle/libs/__init__.py
if os.path.isfile(libs_path+'/__init__.py'):
if os.path.isfile(libs_path+'/__init__.py'):
os.remove(libs_path+'/__init__.py')
os.remove(libs_path+'/__init__.py')
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录