Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
csdn_franckjun
Paddle
提交
27633216
P
Paddle
项目概览
csdn_franckjun
/
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
27633216
编写于
9月 21, 2018
作者:
N
nhzlx
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix comments
上级
0514882b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
18 addition
and
29 deletion
+18
-29
paddle/fluid/inference/analysis/analyzer_tester.cc
paddle/fluid/inference/analysis/analyzer_tester.cc
+4
-8
paddle/fluid/inference/analysis/data_flow_graph_to_fluid_pass.cc
...fluid/inference/analysis/data_flow_graph_to_fluid_pass.cc
+1
-0
paddle/fluid/inference/analysis/subgraph_splitter_tester.cc
paddle/fluid/inference/analysis/subgraph_splitter_tester.cc
+1
-2
paddle/fluid/inference/analysis/tensorrt_subgraph_pass_tester.cc
...fluid/inference/analysis/tensorrt_subgraph_pass_tester.cc
+4
-8
paddle/fluid/inference/api/api_tensorrt_subgraph_engine.cc
paddle/fluid/inference/api/api_tensorrt_subgraph_engine.cc
+6
-8
paddle/fluid/inference/api/paddle_inference_api.h
paddle/fluid/inference/api/paddle_inference_api.h
+1
-2
paddle/fluid/operators/tensorrt_engine_op.cc
paddle/fluid/operators/tensorrt_engine_op.cc
+1
-1
未找到文件。
paddle/fluid/inference/analysis/analyzer_tester.cc
浏览文件 @
27633216
...
...
@@ -37,14 +37,10 @@ TEST(Analyzer, analysis_without_tensorrt) {
TEST
(
Analyzer
,
analysis_with_tensorrt
)
{
FLAGS_IA_enable_tensorrt_subgraph_engine
=
true
;
Argument
argument
;
int
*
minimum_subgraph_size
=
new
int
(
0
);
int
*
max_batch_size
=
new
int
(
3
);
int
*
workspace_size
=
new
int
(
1
<<
20
);
std
::
string
*
precision_mode
=
new
std
::
string
(
"FP32"
);
argument
.
Set
<
int
>
(
"minimum_subgraph_size"
,
minimum_subgraph_size
);
argument
.
Set
<
int
>
(
"max_batch_size"
,
max_batch_size
);
argument
.
Set
<
int
>
(
"workspace_size"
,
workspace_size
);
argument
.
Set
<
std
::
string
>
(
"precision_mode"
,
precision_mode
);
argument
.
Set
<
int
>
(
"minimum_subgraph_size"
,
new
int
(
0
));
argument
.
Set
<
int
>
(
"max_batch_size"
,
new
int
(
3
));
argument
.
Set
<
int
>
(
"workspace_size"
,
new
int
(
1
<<
20
));
argument
.
Set
<
std
::
string
>
(
"precision_mode"
,
new
std
::
string
(
"FP32"
));
argument
.
fluid_model_dir
.
reset
(
new
std
::
string
(
FLAGS_inference_model_dir
));
Analyzer
analyser
;
analyser
.
Run
(
&
argument
);
...
...
paddle/fluid/inference/analysis/data_flow_graph_to_fluid_pass.cc
浏览文件 @
27633216
...
...
@@ -99,6 +99,7 @@ void DataFlowGraphToFluidPass::AddFluidOp(Node *node) {
void
CreateTrtEngineOp
(
Node
*
node
,
Argument
*
argument
,
framework
::
proto
::
BlockDesc
*
block
)
{
PADDLE_ENFORCE
(
argument
->
main_dfg
.
get
());
const
DataFlowGraph
&
graph
=
*
(
argument
->
main_dfg
);
static
int
counter
{
0
};
PADDLE_ENFORCE
(
node
->
IsFunctionBlock
());
...
...
paddle/fluid/inference/analysis/subgraph_splitter_tester.cc
浏览文件 @
27633216
...
...
@@ -67,8 +67,7 @@ TEST(SubGraphSplitter, Fuse) {
auto
desc
=
LoadProgramDesc
(
FLAGS_inference_model_dir
+
"/__model__"
);
auto
dfg
=
ProgramDescToDFG
(
desc
);
Argument
argument
;
int
*
minmum_subgraph_size
=
new
int
(
3
);
argument
.
Set
<
int
>
(
"minimum_subgraph_size"
,
minmum_subgraph_size
);
argument
.
Set
<
int
>
(
"minimum_subgraph_size"
,
new
int
(
3
));
size_t
count0
=
dfg
.
nodes
.
size
();
...
...
paddle/fluid/inference/analysis/tensorrt_subgraph_pass_tester.cc
浏览文件 @
27633216
...
...
@@ -36,14 +36,10 @@ TEST(TensorRTSubGraphPass, main) {
};
Argument
argument
(
FLAGS_inference_model_dir
);
int
*
minimum_subgraph_size
=
new
int
(
0
);
int
*
max_batch_size
=
new
int
(
3
);
int
*
workspace_size
=
new
int
(
1
<<
20
);
std
::
string
*
precision_mode
=
new
std
::
string
(
"FP32"
);
argument
.
Set
<
int
>
(
"minimum_subgraph_size"
,
minimum_subgraph_size
);
argument
.
Set
<
int
>
(
"max_batch_size"
,
max_batch_size
);
argument
.
Set
<
int
>
(
"workspace_size"
,
workspace_size
);
argument
.
Set
<
std
::
string
>
(
"precision_mode"
,
precision_mode
);
argument
.
Set
<
int
>
(
"minimum_subgraph_size"
,
new
int
(
0
));
argument
.
Set
<
int
>
(
"max_batch_size"
,
new
int
(
3
));
argument
.
Set
<
int
>
(
"workspace_size"
,
new
int
(
1
<<
20
));
argument
.
Set
<
std
::
string
>
(
"precision_mode"
,
new
std
::
string
(
"FP32"
));
DFG_GraphvizDrawPass
::
Config
config
{
FLAGS_dot_dir
,
"origin"
};
DFG_GraphvizDrawPass
::
Config
config1
{
FLAGS_dot_dir
,
"fusion"
};
...
...
paddle/fluid/inference/api/api_tensorrt_subgraph_engine.cc
浏览文件 @
27633216
...
...
@@ -90,14 +90,12 @@ class TensorRTSubgraphPredictor : public NativePaddlePredictor {
// Analyze inference_program
Argument
argument
;
int
*
minimum_subgraph_size
=
new
int
(
config_
.
minimum_subgraph_size
);
int
*
max_batch_size
=
new
int
(
config_
.
max_batch_size
);
int
*
workspace_size
=
new
int
(
config_
.
workspace_size
);
std
::
string
*
precision_mode
=
new
std
::
string
(
config_
.
precision_mode
);
argument
.
Set
<
int
>
(
"minimum_subgraph_size"
,
minimum_subgraph_size
);
argument
.
Set
<
int
>
(
"max_batch_size"
,
max_batch_size
);
argument
.
Set
<
int
>
(
"workspace_size"
,
workspace_size
);
argument
.
Set
<
std
::
string
>
(
"precision_mode"
,
precision_mode
);
argument
.
Set
<
int
>
(
"minimum_subgraph_size"
,
new
int
(
config_
.
minimum_subgraph_size
));
argument
.
Set
<
int
>
(
"max_batch_size"
,
new
int
(
config_
.
max_batch_size
));
argument
.
Set
<
int
>
(
"workspace_size"
,
new
int
(
config_
.
workspace_size
));
argument
.
Set
<
std
::
string
>
(
"precision_mode"
,
new
std
::
string
(
config_
.
precision_mode
));
if
(
!
config_
.
model_dir
.
empty
())
{
argument
.
fluid_model_dir
.
reset
(
new
std
::
string
(
config_
.
model_dir
));
...
...
paddle/fluid/inference/api/paddle_inference_api.h
浏览文件 @
27633216
...
...
@@ -153,8 +153,7 @@ struct TensorRTConfig : public NativeConfig {
// We transform the Ops that can be converted into TRT layer in the model,
// and aggregate these Ops into subgraphs for TRT execution.
// We set this variable to control the minimum number of nodes in the
// subgraph, 3 as
// default value.
// subgraph, 3 as default value.
int
minimum_subgraph_size
=
3
;
// Reserved configuration
// We just support "FP32" now, "FP16" and "INT8" will be supported.
...
...
paddle/fluid/operators/tensorrt_engine_op.cc
浏览文件 @
27633216
...
...
@@ -33,7 +33,7 @@ class TensorRTEngineOpMaker : public framework::OpProtoAndCheckerMaker {
AddAttr
<
std
::
string
>
(
"subgraph"
,
"the subgraph."
);
AddAttr
<
std
::
string
>
(
"engine_uniq_key"
,
"unique key for the TRT engine."
);
AddAttr
<
int
>
(
"max_batch_size"
,
"the maximum batch size."
);
AddAttr
<
int
>
(
"workspace_size"
,
"the
maximum batch
size."
);
AddAttr
<
int
>
(
"workspace_size"
,
"the
workspace
size."
);
AddComment
(
"TensorRT engine operator."
);
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录