Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
e887d719
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
e887d719
编写于
1月 31, 2019
作者:
Y
Yan Chunwei
提交者:
GitHub
1月 31, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ir debug config (#15571)
上级
897789b1
变更
6
显示空白变更内容
内联
并排
Showing
6 changed file
with
16 addition
and
8 deletion
+16
-8
paddle/fluid/inference/analysis/ir_pass_manager.cc
paddle/fluid/inference/analysis/ir_pass_manager.cc
+3
-3
paddle/fluid/inference/api/analysis_config.cc
paddle/fluid/inference/api/analysis_config.cc
+5
-0
paddle/fluid/inference/api/analysis_predictor_tester.cc
paddle/fluid/inference/api/analysis_predictor_tester.cc
+1
-1
paddle/fluid/inference/api/paddle_analysis_config.h
paddle/fluid/inference/api/paddle_analysis_config.h
+5
-2
paddle/fluid/inference/tests/api/analyzer_seq_pool1_tester.cc
...le/fluid/inference/tests/api/analyzer_seq_pool1_tester.cc
+1
-1
paddle/fluid/inference/tests/api/analyzer_text_classification_tester.cc
...nference/tests/api/analyzer_text_classification_tester.cc
+1
-1
未找到文件。
paddle/fluid/inference/analysis/ir_pass_manager.cc
浏览文件 @
e887d719
...
@@ -83,7 +83,6 @@ void IRPassManager::CreatePasses(Argument *argument,
...
@@ -83,7 +83,6 @@ void IRPassManager::CreatePasses(Argument *argument,
new
std
::
string
(
GetOrCreateModelOptCacheDir
(
model_opt_cache_dir
)));
new
std
::
string
(
GetOrCreateModelOptCacheDir
(
model_opt_cache_dir
)));
}
}
// graph_ = pass->Apply(std::move(graph_));
pre_pass
=
pass_name
;
pre_pass
=
pass_name
;
passes_
.
emplace_back
(
std
::
move
(
pass
));
passes_
.
emplace_back
(
std
::
move
(
pass
));
...
@@ -97,8 +96,9 @@ std::unique_ptr<Graph> IRPassManager::Apply(std::unique_ptr<Graph> graph) {
...
@@ -97,8 +96,9 @@ std::unique_ptr<Graph> IRPassManager::Apply(std::unique_ptr<Graph> graph) {
PADDLE_ENFORCE
(
graph
.
get
());
PADDLE_ENFORCE
(
graph
.
get
());
// Apply all the passes
// Apply all the passes
for
(
const
auto
&
pass
:
passes_
)
{
for
(
const
auto
&
pass
:
passes_
)
{
if
(
pass
->
Type
()
==
"graph_viz_pass"
)
continue
;
if
(
pass
->
Type
()
!=
"graph_viz_pass"
)
{
PrettyLogEndl
(
Style
::
H2
(),
"--- Running IR pass [%s]"
,
pass
->
Type
());
PrettyLogEndl
(
Style
::
H2
(),
"--- Running IR pass [%s]"
,
pass
->
Type
());
}
graph
=
pass
->
Apply
(
std
::
move
(
graph
));
graph
=
pass
->
Apply
(
std
::
move
(
graph
));
}
}
return
std
::
move
(
graph
);
return
std
::
move
(
graph
);
...
...
paddle/fluid/inference/api/analysis_config.cc
浏览文件 @
e887d719
...
@@ -318,4 +318,9 @@ NativeConfig AnalysisConfig::ToNativeConfig() const {
...
@@ -318,4 +318,9 @@ NativeConfig AnalysisConfig::ToNativeConfig() const {
return
config
;
return
config
;
}
}
void
AnalysisConfig
::
SwitchIrDebug
(
int
x
)
{
ir_debug_
=
x
;
Update
();
}
}
// namespace paddle
}
// namespace paddle
paddle/fluid/inference/api/analysis_predictor_tester.cc
浏览文件 @
e887d719
...
@@ -196,7 +196,7 @@ TEST(AnalysisPredictor, memory_optim) {
...
@@ -196,7 +196,7 @@ TEST(AnalysisPredictor, memory_optim) {
AnalysisConfig
config
(
FLAGS_dirname
);
AnalysisConfig
config
(
FLAGS_dirname
);
config
.
DisableGpu
();
config
.
DisableGpu
();
config
.
EnableMemoryOptim
(
true
);
config
.
EnableMemoryOptim
(
true
);
config
.
pass_builder
()
->
TurnOn
Debug
();
config
.
SwitchIr
Debug
();
auto
native_predictor
=
auto
native_predictor
=
CreatePaddlePredictor
<
NativeConfig
>
(
config
.
ToNativeConfig
());
CreatePaddlePredictor
<
NativeConfig
>
(
config
.
ToNativeConfig
());
...
...
paddle/fluid/inference/api/paddle_analysis_config.h
浏览文件 @
e887d719
...
@@ -140,9 +140,12 @@ struct AnalysisConfig {
...
@@ -140,9 +140,12 @@ struct AnalysisConfig {
*/
*/
bool
tensorrt_engine_enabled
()
const
{
return
use_tensorrt_
;
}
bool
tensorrt_engine_enabled
()
const
{
return
use_tensorrt_
;
}
/** Control whther to debug IR graph analysis phase.
/** \brief Control whether to debug IR graph analysis phase.
*
* This will generate DOT files for visualizing the computation graph after
* each analysis pass applied.
*/
*/
void
SwitchIrDebug
(
int
x
=
true
)
{
ir_debug_
=
x
;
}
void
SwitchIrDebug
(
int
x
=
true
)
;
/** Turn on MKLDNN.
/** Turn on MKLDNN.
*/
*/
...
...
paddle/fluid/inference/tests/api/analyzer_seq_pool1_tester.cc
浏览文件 @
e887d719
...
@@ -142,7 +142,7 @@ void SetConfig(AnalysisConfig *cfg, bool use_mkldnn = false) {
...
@@ -142,7 +142,7 @@ void SetConfig(AnalysisConfig *cfg, bool use_mkldnn = false) {
cfg
->
SetModel
(
FLAGS_infer_model
+
"/model"
,
FLAGS_infer_model
+
"/params"
);
cfg
->
SetModel
(
FLAGS_infer_model
+
"/model"
,
FLAGS_infer_model
+
"/params"
);
cfg
->
DisableGpu
();
cfg
->
DisableGpu
();
cfg
->
SwitchSpecifyInputNames
();
cfg
->
SwitchSpecifyInputNames
();
cfg
->
pass_builder
()
->
TurnOn
Debug
();
cfg
->
SwitchIr
Debug
();
cfg
->
SetCpuMathLibraryNumThreads
(
FLAGS_paddle_num_threads
);
cfg
->
SetCpuMathLibraryNumThreads
(
FLAGS_paddle_num_threads
);
if
(
use_mkldnn
)
{
if
(
use_mkldnn
)
{
cfg
->
EnableMKLDNN
();
cfg
->
EnableMKLDNN
();
...
...
paddle/fluid/inference/tests/api/analyzer_text_classification_tester.cc
浏览文件 @
e887d719
...
@@ -69,7 +69,7 @@ void SetInput(std::vector<std::vector<PaddleTensor>> *inputs) {
...
@@ -69,7 +69,7 @@ void SetInput(std::vector<std::vector<PaddleTensor>> *inputs) {
TEST
(
Analyzer_Text_Classification
,
profile
)
{
TEST
(
Analyzer_Text_Classification
,
profile
)
{
AnalysisConfig
cfg
;
AnalysisConfig
cfg
;
SetConfig
(
&
cfg
);
SetConfig
(
&
cfg
);
cfg
.
pass_builder
()
->
TurnOn
Debug
();
cfg
.
SwitchIr
Debug
();
std
::
vector
<
PaddleTensor
>
outputs
;
std
::
vector
<
PaddleTensor
>
outputs
;
std
::
vector
<
std
::
vector
<
PaddleTensor
>>
input_slots_all
;
std
::
vector
<
std
::
vector
<
PaddleTensor
>>
input_slots_all
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录