Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
139808e9
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
139808e9
编写于
4月 15, 2020
作者:
H
hong19860320
提交者:
GitHub
4月 15, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[OPT] Add RK and MTK support for model optimize tool (#3410)
上级
2997b937
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
17 addition
and
7 deletion
+17
-7
lite/api/opt.cc
lite/api/opt.cc
+6
-6
lite/api/opt_base.cc
lite/api/opt_base.cc
+10
-1
lite/api/python/pybind/pybind.cc
lite/api/python/pybind/pybind.cc
+1
-0
未找到文件。
lite/api/opt.cc
浏览文件 @
139808e9
...
...
@@ -108,17 +108,17 @@ std::vector<Place> ParserValidPlaces() {
valid_places
.
emplace_back
(
Place
{
TARGET
(
kX86
),
PRECISION
(
kInt64
)});
}
else
if
(
target_repr
==
"npu"
)
{
valid_places
.
emplace_back
(
TARGET
(
kNPU
));
}
else
if
(
target_repr
==
"apu"
)
{
valid_places
.
emplace_back
(
Place
{
TARGET
(
kAPU
),
PRECISION
(
kInt8
),
DATALAYOUT
(
kNCHW
)});
}
else
if
(
target_repr
==
"xpu"
)
{
valid_places
.
emplace_back
(
TARGET
(
kXPU
));
}
else
if
(
target_repr
==
"mlu"
)
{
valid_places
.
emplace_back
(
TARGET
(
kMLU
));
}
else
if
(
target_repr
==
"rknpu"
)
{
valid_places
.
emplace_back
(
TARGET
(
kRKNPU
));
valid_places
.
emplace_back
(
TARGET
(
kRKNPU
),
PRECISION
(
kInt8
),
DATALAYOUT
(
kNCHW
));
}
else
if
(
target_repr
==
"mlu"
)
{
valid_places
.
emplace_back
(
TARGET
(
kMLU
));
}
else
if
(
target_repr
==
"apu"
)
{
valid_places
.
emplace_back
(
Place
{
TARGET
(
kAPU
),
PRECISION
(
kInt8
),
DATALAYOUT
(
kNCHW
)});
}
else
{
LOG
(
FATAL
)
<<
lite
::
string_format
(
"Wrong target '%s' found, please check the command flag "
...
...
@@ -194,9 +194,9 @@ void PrintOpsInfo(std::set<std::string> valid_ops = {}) {
"kOpenCL"
,
"kFPGA"
,
"kNPU"
,
"kAPU"
,
"kXPU"
,
"kRKNPU"
,
"kAPU"
,
"kAny"
,
"kUnk"
};
int
maximum_optype_length
=
0
;
...
...
lite/api/opt_base.cc
浏览文件 @
139808e9
...
...
@@ -63,6 +63,13 @@ void OptBase::SetValidPlaces(const std::string& valid_places) {
valid_places_
.
emplace_back
(
TARGET
(
kNPU
));
}
else
if
(
target_repr
==
"xpu"
)
{
valid_places_
.
emplace_back
(
TARGET
(
kXPU
));
}
else
if
(
target_repr
==
"rknpu"
)
{
valid_places_
.
emplace_back
(
TARGET
(
kRKNPU
));
valid_places_
.
emplace_back
(
TARGET
(
kRKNPU
),
PRECISION
(
kInt8
),
DATALAYOUT
(
kNCHW
));
}
else
if
(
target_repr
==
"apu"
)
{
valid_places_
.
emplace_back
(
Place
{
TARGET
(
kAPU
),
PRECISION
(
kInt8
),
DATALAYOUT
(
kNCHW
)});
}
else
{
LOG
(
FATAL
)
<<
lite
::
string_format
(
"Wrong target '%s' found, please check the command flag "
...
...
@@ -183,7 +190,7 @@ void OptBase::PrintHelpInfo() {
" `set_param_file(param_file_path)`
\n
"
" `set_model_type(protobuf|naive_buffer)`
\n
"
" `set_optimize_out(output_optimize_model_dir)`
\n
"
" `set_valid_places(arm|opencl|x86|npu|xpu)`
\n
"
" `set_valid_places(arm|opencl|x86|npu|xpu
|rknpu|apu
)`
\n
"
" `run_optimize(false|true)`
\n
"
" ` ----fasle&true refer to whether to record ops info for "
"tailoring lib, false by default`
\n
"
...
...
@@ -208,6 +215,8 @@ void OptBase::PrintOpsInfo(const std::set<std::string>& valid_ops) {
"kFPGA"
,
"kNPU"
,
"kXPU"
,
"kRKNPU"
,
"kAPU"
,
"kAny"
,
"kUnk"
};
// Get the lengh of the first column: maximum length of the op_type
...
...
lite/api/python/pybind/pybind.cc
浏览文件 @
139808e9
...
...
@@ -183,6 +183,7 @@ void BindLitePlace(py::module *m) {
.
value
(
"FPGA"
,
TargetType
::
kFPGA
)
.
value
(
"NPU"
,
TargetType
::
kNPU
)
.
value
(
"MLU"
,
TargetType
::
kMLU
)
.
value
(
"RKNPU"
,
TargetType
::
kRKNPU
)
.
value
(
"APU"
,
TargetType
::
kAPU
)
.
value
(
"Any"
,
TargetType
::
kAny
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录