Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
521bba9c
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
521bba9c
编写于
3月 15, 2023
作者:
J
JingZhuangzhuang
提交者:
GitHub
3月 15, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify cmake rules temporarily (#51644)
上级
fc2ccbb8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
30 addition
and
10 deletion
+30
-10
paddle/fluid/inference/CMakeLists.txt
paddle/fluid/inference/CMakeLists.txt
+2
-0
paddle/fluid/platform/device/gpu/CMakeLists.txt
paddle/fluid/platform/device/gpu/CMakeLists.txt
+7
-1
tools/get_op_list.py
tools/get_op_list.py
+21
-9
未找到文件。
paddle/fluid/inference/CMakeLists.txt
浏览文件 @
521bba9c
...
...
@@ -109,6 +109,8 @@ set(SHARED_INFERENCE_SRCS
${
PADDLE_CUSTOM_OP_SRCS
}
)
# shared inference library deps
list
(
REMOVE_ITEM fluid_modules standalone_executor
interpretercore_garbage_collector
)
set
(
SHARED_INFERENCE_DEPS
${
fluid_modules
}
phi analysis_predictor
${
utils_modules
}
)
...
...
paddle/fluid/platform/device/gpu/CMakeLists.txt
浏览文件 @
521bba9c
...
...
@@ -3,7 +3,13 @@ if(WITH_GPU)
nv_library
(
gpu_info
SRCS gpu_info.cc
DEPS phi_backends gflags glog enforce monitor dynload_cuda
)
DEPS phi_backends
gflags
glog
enforce
monitor
dynload_cuda
malloc
)
nv_test
(
cuda_helper_test SRCS cuda_helper_test.cu
)
nv_test
(
...
...
tools/get_op_list.py
浏览文件 @
521bba9c
...
...
@@ -30,15 +30,20 @@ def parse_args():
'--model_dir'
,
type
=
str
,
default
=
""
,
help
=
'Directory of the inference models.'
,
help
=
'Directory of the inference models that named with pdmodel.'
,
)
parser
.
add_argument
(
'--op_list'
,
type
=
str
,
default
=
""
,
help
=
'List of ops like "conv2d;pool2d;relu".'
,
)
return
parser
.
parse_args
()
def
get_model_ops
(
model_file
):
def
get_model_ops
(
model_file
,
ops_set
):
model_bytes
=
paddle
.
static
.
load_from_file
(
model_file
)
pg
=
paddle
.
static
.
deserialize_program
(
model_bytes
)
ops_set
=
set
()
for
i
in
range
(
0
,
pg
.
desc
.
num_blocks
()):
block
=
pg
.
desc
.
block
(
i
)
...
...
@@ -47,12 +52,12 @@ def get_model_ops(model_file):
for
j
in
range
(
0
,
size
):
ops_set
.
add
(
block
.
op
(
j
).
type
())
return
ops_set
def
get_model_phi_kernels
(
ops_set
):
phi_set
=
set
()
for
op
in
ops_set
:
print
(
op
)
print
(
_get_phi_kernel_name
(
op
))
phi_set
.
add
(
_get_phi_kernel_name
(
op
))
return
phi_set
...
...
@@ -60,10 +65,17 @@ def get_model_phi_kernels(ops_set):
if
__name__
==
'__main__'
:
args
=
parse_args
()
for
root
,
dirs
,
files
in
os
.
walk
(
args
.
model_dir
,
topdown
=
True
):
for
name
in
files
:
if
re
.
match
(
r
'.*pdmodel'
,
name
):
ops_set
=
get_model_ops
(
os
.
path
.
join
(
root
,
name
))
ops_set
=
set
()
if
args
.
op_list
!=
""
:
op_list
=
args
.
op_list
.
split
(
";"
)
for
op
in
op_list
:
ops_set
.
add
(
op
)
if
args
.
model_dir
!=
""
:
for
root
,
dirs
,
files
in
os
.
walk
(
args
.
model_dir
,
topdown
=
True
):
for
name
in
files
:
if
re
.
match
(
r
'.*pdmodel'
,
name
):
get_model_ops
(
os
.
path
.
join
(
root
,
name
),
ops_set
)
phi_set
=
get_model_phi_kernels
(
ops_set
)
ops
=
";"
.
join
(
ops_set
)
kernels
=
";"
.
join
(
phi_set
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录