Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
SummerGao.
Paddle
提交
ffbf7135
P
Paddle
项目概览
SummerGao.
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ffbf7135
编写于
2月 24, 2021
作者:
Z
Zhou Wei
提交者:
GitHub
2月 24, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify custom op dependent from paddle_framework to paddle_custom_op (#31195)
上级
0f1fde51
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
25 addition
and
14 deletion
+25
-14
paddle/fluid/framework/CMakeLists.txt
paddle/fluid/framework/CMakeLists.txt
+5
-4
paddle/scripts/paddle_build.bat
paddle/scripts/paddle_build.bat
+13
-5
python/paddle/utils/cpp_extension/extension_utils.py
python/paddle/utils/cpp_extension/extension_utils.py
+1
-1
python/setup.py.in
python/setup.py.in
+6
-4
未找到文件。
paddle/fluid/framework/CMakeLists.txt
浏览文件 @
ffbf7135
...
...
@@ -328,9 +328,10 @@ cc_test(custom_tensor_test SRCS custom_tensor_test.cc DEPS custom_tensor glog)
set
(
FLUID_FRAMEWORK_MODULES proto_desc memory lod_tensor executor data_feed_proto layer dynamic_loader custom_operator
)
cc_library
(
paddle_framework DEPS
${
FLUID_FRAMEWORK_MODULES
}
)
# Old custom op extension mechanism related, will be removed in 2.1.0
cc_library
(
paddle_framework_shared
SHARED SRCS executor.cc operator.cc custom_operator.cc ../extension/src/tensor.cc
../extension/src/op_meta_info.cc
SHARED SRCS executor.cc operator.cc
${
CMAKE_CURRENT_SOURCE_DIR
}
/c/c_api.cc
${
CMAKE_SOURCE_DIR
}
/paddle/fluid/imperative/layer.cc
DEPS
${
FLUID_FRAMEWORK_MODULES
}
)
...
...
@@ -382,9 +383,9 @@ if (LINUX)
endif
()
if
(
WIN32
)
set
(
PADDLE_CUSTOM_OP_
SHARED
_LIB
set
(
PADDLE_CUSTOM_OP_
IMPORT
_LIB
${
PADDLE_BINARY_DIR
}
/paddle/fluid/framework/
${
CMAKE_BUILD_TYPE
}
/paddle_custom_op.lib
CACHE INTERNAL
"Paddle custom op lib"
)
CACHE INTERNAL
"Paddle custom op
import
lib"
)
set
(
PADDLE_CUSTOM_OP_SHARED_LIB
${
PADDLE_BINARY_DIR
}
/paddle/fluid/framework/
${
CMAKE_BUILD_TYPE
}
/paddle_custom_op.dll
CACHE INTERNAL
"Paddle custom op dll"
)
...
...
paddle/scripts/paddle_build.bat
浏览文件 @
ffbf7135
...
...
@@ -28,6 +28,7 @@ if not exist %cache_dir%\tools (
)
taskkill
/f /im
op_function_generator
.exe
wmic
process
where
name
=
"op_function_generator.exe"
call
terminate
taskkill
/f /im
python
.exe
2
>
NUL
rem ------initialize common variable------
if
not
defined
GENERATOR
set
GENERATOR
=
"Visual Studio 14 2015 Win64"
...
...
@@ -55,6 +56,7 @@ rem -------set cache build directory-----------
rmdir
build
\python
/s/q
rmdir
build
\paddle_install_dir
/s/q
rmdir
build
\paddle_inference_install_dir
/s/q
rmdir
build
\paddle_inference_c_install_dir
/s/q
del
build
\CMakeCache.txt
:
set
CI_SKIP_CPP_TEST
if
only
*
.py
changed
...
...
@@ -77,7 +79,10 @@ setlocal enabledelayedexpansion
git
show
-ref --verify --quiet
refs
/heads/last
_pr
if
%ERRORLEVEL%
EQU
0
(
git
diff
HEAD
last_pr
--stat --name-only
git
diff
HEAD
last_pr
--stat --name-only
|
findstr
"cmake/[a-zA-Z]*\.cmake CMakeLists.txt"
git
diff
HEAD
last_pr
--stat --name-only
|
findstr
"setup.py.in"
if
%ERRORLEVEL%
EQU
0
(
rmdir
build
/s/q
)
git
branch
-D
last_pr
git
branch
last_pr
)
else
(
...
...
@@ -246,11 +251,15 @@ set /p day_before=< %cache_dir%\day.txt
if
%day_now%
NEQ
%day_before%
(
echo
%day_now%
>
%cache_dir%
\day.txt
type
%cache_dir%
\day.txt
if
%day_now%
EQU
2
5
(
if
%day_now%
EQU
2
1
(
rmdir
%cache_dir%
\third_party_GPU/
/s/q
rmdir
%cache_dir%
\third_party/
/s/q
)
if
%day_now%
EQU
10
(
if
%day_now%
EQU
11
(
rmdir
%cache_dir%
\third_party_GPU/
/s/q
rmdir
%cache_dir%
\third_party/
/s/q
)
if
%day_now%
EQU
01
(
rmdir
%cache_dir%
\third_party_GPU/
/s/q
rmdir
%cache_dir%
\third_party/
/s/q
)
...
...
@@ -604,8 +613,7 @@ python -c "import shutil;shutil.make_archive('paddle_inference', 'zip', root_dir
set
/p
libsize
=<
lib_size
.txt
for
/F
%%i
in
(
"
%libsize%
"
)
do
(
set
/a
libsize_m
=
%%i
/1024
echo
"Windows Paddle_Inference Size:
!libsize_m!
M"
echo
ipipe_log_param_Windows_Paddle_Inference_Size
:
!libsize_m!
M
echo
"Windows Paddle_Inference ZIP Size:
!libsize_m!
M"
)
goto
:eof
...
...
python/paddle/utils/cpp_extension/extension_utils.py
浏览文件 @
ffbf7135
...
...
@@ -44,7 +44,7 @@ MSVC_COMPILE_FLAGS = [
'/DBOOST_HAS_STATIC_ASSERT'
,
'/DNDEBUG'
,
'/DPADDLE_USE_DSO'
]
MSVC_LINK_FLAGS
=
[
'/MACHINE:X64'
,
'paddle_
framework
.lib'
]
MSVC_LINK_FLAGS
=
[
'/MACHINE:X64'
,
'paddle_
custom_op
.lib'
]
COMMON_NVCC_FLAGS
=
[
'-DPADDLE_WITH_CUDA'
,
'-DEIGEN_USE_GPU'
,
'-O3'
]
...
...
python/setup.py.in
浏览文件 @
ffbf7135
...
...
@@ -335,21 +335,23 @@ if '${WITH_XPU_BKCL}' == 'ON':
shutil.copy('${XPU_BKCL_LIB}', libs_path)
package_data['paddle.libs']+=['${XPU_BKCL_LIB_NAME}']
### Old custom op extension mechanism related, will be removed in 2.1.0 ###
# copy libpaddle_framework.so to libs on linux
if sys.platform.startswith('linux'):
shutil.copy('${FLUID_FRAMEWORK_SHARED_LIB}', libs_path)
package_data['paddle.libs'] += ['libpaddle_framework.so']
### New custom op extension mechanism related ###
# copy libpaddle_custom_op.so to libs on linux
if sys.platform.startswith('linux'):
shutil.copy('${PADDLE_CUSTOM_OP_SHARED_LIB}', libs_path)
package_data['paddle.libs'] += ['libpaddle_custom_op.so']
# copy paddle_
framework.lib/paddle_framework.dll to libs on w
indows
# copy paddle_
custom_op.lib/paddle_custom_op.dll to libs on W
indows
if os.name == 'nt':
shutil.copy('${
FLUID_FRAMEWORK
_IMPORT_LIB}', libs_path)
shutil.copy('${
FLUID_FRAMEWORK
_SHARED_LIB}', libs_path)
package_data['paddle.libs'] += ['paddle_
framework.lib', 'paddle_framework
.dll']
shutil.copy('${
PADDLE_CUSTOM_OP
_IMPORT_LIB}', libs_path)
shutil.copy('${
PADDLE_CUSTOM_OP
_SHARED_LIB}', libs_path)
package_data['paddle.libs'] += ['paddle_
custom_op.lib', 'paddle_custom_op
.dll']
# remove unused paddle/libs/__init__.py
if os.path.isfile(libs_path+'/__init__.py'):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录