Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSlim
提交
d98c7738
P
PaddleSlim
项目概览
PaddlePaddle
/
PaddleSlim
1 年多 前同步成功
通知
51
Star
1434
Fork
344
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
16
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSlim
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
16
合并请求
16
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
d98c7738
编写于
5月 20, 2022
作者:
Z
zhouzj
提交者:
GitHub
5月 20, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[LatencyPredictor] add hardware (#1089)
* Add rk3288 predictor * fix some bugs for sparse conv2d.
上级
d01db560
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
9 addition
and
7 deletion
+9
-7
paddleslim/analysis/extract_features.py
paddleslim/analysis/extract_features.py
+1
-1
paddleslim/analysis/latency_predictor.py
paddleslim/analysis/latency_predictor.py
+1
-1
paddleslim/analysis/parse_ops.py
paddleslim/analysis/parse_ops.py
+7
-5
未找到文件。
paddleslim/analysis/extract_features.py
浏览文件 @
d98c7738
...
...
@@ -61,7 +61,7 @@ def get_features_from_paramkey(param_key, op_type, data_type):
if
quant_bits
not
in
param_key
:
return
None
weight
=
re
.
search
(
r
'weight=(\(\d*, \d*, \d*, \d*\))'
,
weight
=
re
.
search
(
r
'weight=(\(\d*,
-?
\d*, \d*, \d*\))'
,
param_key
).
group
().
split
(
'='
)[
-
1
].
strip
(
'('
')'
).
split
(
', '
)
...
...
paddleslim/analysis/latency_predictor.py
浏览文件 @
d98c7738
...
...
@@ -68,7 +68,7 @@ class TableLatencyPredictor(LatencyPredictor):
Args:
table_file(str): The path of file that records the device latency of operators.
"""
hardware_list
=
[
'SD625'
,
'SD710'
]
hardware_list
=
[
'SD625'
,
'SD710'
,
'RK3288'
]
def
__init__
(
self
,
table_file
=
'SD710'
):
self
.
table_file
=
table_file
...
...
paddleslim/analysis/parse_ops.py
浏览文件 @
d98c7738
...
...
@@ -24,7 +24,10 @@ def get_key_from_op(op):
if
op_type
==
'sparse_conv2d'
:
out_shape
=
op
.
all_outputs
()[
0
].
shape
()
in_shape
=
op
.
inputs
(
'Input'
)[
0
].
shape
()
weight_shape
=
(
out_shape
[
1
],
in_shape
[
1
],
1
,
1
)
if
in_shape
:
weight_shape
=
(
out_shape
[
1
],
in_shape
[
1
],
1
,
1
)
else
:
weight_shape
=
(
out_shape
[
1
],
-
1
,
1
,
1
)
NonZeroWeights
=
op
.
inputs
(
'NonZeroWeights'
)[
0
].
shape
()[
0
]
stride
=
op
.
attr
(
'strides'
)[
1
]
...
...
@@ -147,14 +150,13 @@ def get_key_from_op(op):
elif
op_type
==
'stack'
:
data
=
op
.
all_inputs
()
X
=
"
[
"
X
=
""
for
x
in
data
:
X
+=
f
"
{
x
.
shape
()
}
"
X
+=
"]"
axis
=
op
.
attr
(
'axis'
)
out_shape
=
op
.
all_outputs
()[
0
].
shape
()
param_key
=
f
'
{
op_type
}
X
=
{
X
}
axis=
{
axis
}
out=
{
out_shape
}
'
param_key
=
f
'
{
op_type
}
in
=
{
X
}
axis=
{
axis
}
out=
{
out_shape
}
'
elif
op_type
==
'exp'
:
in_shape
=
op
.
all_inputs
()[
-
1
].
shape
()
...
...
@@ -219,7 +221,7 @@ def get_key_from_op(op):
in_shape2
=
op
.
all_inputs
()[
1
].
shape
()
out_shape
=
op
.
all_outputs
()[
0
].
shape
()
param_key
=
f
'
{
op_type
}
in=
{
in_shape1
}
in
=
{
in_shape2
}
out=
{
out_shape
}
'
param_key
=
f
'
{
op_type
}
X=
{
in_shape1
}
Y
=
{
in_shape2
}
out=
{
out_shape
}
'
elif
op_type
in
[
'calib'
,
'floor'
]:
in_shape
=
op
.
all_inputs
()[
-
1
].
shape
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录