Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
06e9233f
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2298
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看板
未验证
提交
06e9233f
编写于
8月 15, 2023
作者:
Z
zhangbo9674
提交者:
GitHub
8月 15, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[IR] Refine code (#56089)
* refine code * refine code * refine code
上级
4788971d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
16 addition
and
62 deletion
+16
-62
paddle/fluid/framework/new_executor/interpreter_base_impl.h
paddle/fluid/framework/new_executor/interpreter_base_impl.h
+0
-11
paddle/fluid/framework/new_executor/new_ir_interpreter.cc
paddle/fluid/framework/new_executor/new_ir_interpreter.cc
+6
-17
paddle/fluid/framework/new_executor/new_ir_interpreter.h
paddle/fluid/framework/new_executor/new_ir_interpreter.h
+2
-9
paddle/fluid/framework/new_executor/program_interpreter.cc
paddle/fluid/framework/new_executor/program_interpreter.cc
+6
-17
paddle/fluid/framework/new_executor/program_interpreter.h
paddle/fluid/framework/new_executor/program_interpreter.h
+2
-8
未找到文件。
paddle/fluid/framework/new_executor/interpreter_base_impl.h
浏览文件 @
06e9233f
...
...
@@ -94,19 +94,8 @@ class InterpreterBaseImpl {
virtual
void
SetOutputHooks
(
const
std
::
vector
<
HookFunc
>&
hookfuncs
)
=
0
;
virtual
const
interpreter
::
DependencyBuilder
&
GetDependencyBuilder
()
const
=
0
;
virtual
std
::
shared_ptr
<
std
::
vector
<
size_t
>>
GetDependencyCount
()
const
=
0
;
virtual
const
interpreter
::
StreamAnalyzer
&
GetStreamAnalyzer
()
const
=
0
;
virtual
const
interpreter
::
NewIrDependencyBuilder
&
GetNewIrDependencyBuilder
()
const
=
0
;
virtual
const
interpreter
::
NewIrStreamAnalyzer
&
GetNewIrStreamAnalyzer
()
const
=
0
;
virtual
bool
IsSharedResultsBuild
()
const
=
0
;
};
...
...
paddle/fluid/framework/new_executor/new_ir_interpreter.cc
浏览文件 @
06e9233f
...
...
@@ -201,26 +201,20 @@ void NewIRInterpreter::ShareWorkQueueFrom(InterpreterBaseImpl* src) {
}
void
NewIRInterpreter
::
ShareBuildResultsFrom
(
const
InterpreterBaseImpl
&
src
)
{
if
(
is_shared_results_build_
||
!
src
.
IsSharedResultsBuild
())
{
const
NewIRInterpreter
&
impl
=
dynamic_cast
<
const
NewIRInterpreter
&>
(
src
);
if
(
is_shared_results_build_
||
!
impl
.
IsSharedResultsBuild
())
{
return
;
}
// share op dependency
ir_dependency_builder_
.
ShareDependencyFrom
(
src
.
GetNewIrDependencyBuilder
());
dependecy_count_
=
src
.
GetDependencyCount
();
ir_dependency_builder_
.
ShareDependencyFrom
(
impl
.
GetNewIrDependencyBuilder
());
dependecy_count_
=
impl
.
GetDependencyCount
();
// share event analysis
ir_stream_analyzer_
.
ShareEventInfoFrom
(
src
.
GetNewIrStreamAnalyzer
());
ir_stream_analyzer_
.
ShareEventInfoFrom
(
impl
.
GetNewIrStreamAnalyzer
());
is_shared_results_build_
=
true
;
VLOG
(
8
)
<<
"Share Build Results from InterpreterCore("
<<
&
src
VLOG
(
8
)
<<
"Share Build Results from InterpreterCore("
<<
&
impl
<<
") to InterpreterCore("
<<
this
<<
")"
;
}
// op dependences
const
interpreter
::
DependencyBuilder
&
NewIRInterpreter
::
GetDependencyBuilder
()
const
{
PADDLE_THROW
(
platform
::
errors
::
Unimplemented
(
"GetDependencyBuilder is not implemented in NewIRInterpreter."
));
}
const
interpreter
::
NewIrDependencyBuilder
&
NewIRInterpreter
::
GetNewIrDependencyBuilder
()
const
{
return
ir_dependency_builder_
;
...
...
@@ -231,11 +225,6 @@ std::shared_ptr<std::vector<size_t>> NewIRInterpreter::GetDependencyCount()
return
dependecy_count_
;
}
const
interpreter
::
StreamAnalyzer
&
NewIRInterpreter
::
GetStreamAnalyzer
()
const
{
PADDLE_THROW
(
platform
::
errors
::
Unimplemented
(
"GetStreamAnalyzer is not implemented in NewIRInterpreter."
));
}
const
interpreter
::
NewIrStreamAnalyzer
&
NewIRInterpreter
::
GetNewIrStreamAnalyzer
()
const
{
return
ir_stream_analyzer_
;
...
...
paddle/fluid/framework/new_executor/new_ir_interpreter.h
浏览文件 @
06e9233f
...
...
@@ -53,13 +53,8 @@ class NewIRInterpreter : public InterpreterBaseImpl {
void
ShareBuildResultsFrom
(
const
InterpreterBaseImpl
&
src
)
override
;
// op dependences
const
interpreter
::
DependencyBuilder
&
GetDependencyBuilder
()
const
override
;
std
::
shared_ptr
<
std
::
vector
<
size_t
>>
GetDependencyCount
()
const
override
;
const
interpreter
::
StreamAnalyzer
&
GetStreamAnalyzer
()
const
override
;
bool
IsSharedResultsBuild
()
const
override
;
void
SetCopyProgram
(
std
::
shared_ptr
<
ProgramDesc
>
prog
)
override
;
...
...
@@ -195,11 +190,9 @@ class NewIRInterpreter : public InterpreterBaseImpl {
void
SolvePersisableVarNames
();
const
interpreter
::
NewIrDependencyBuilder
&
GetNewIrDependencyBuilder
()
const
override
;
const
interpreter
::
NewIrDependencyBuilder
&
GetNewIrDependencyBuilder
()
const
;
const
interpreter
::
NewIrStreamAnalyzer
&
GetNewIrStreamAnalyzer
()
const
override
;
const
interpreter
::
NewIrStreamAnalyzer
&
GetNewIrStreamAnalyzer
()
const
;
InstructionSchedulingPriorityLess
ir_instruction_scheduling_priority_less
;
...
...
paddle/fluid/framework/new_executor/program_interpreter.cc
浏览文件 @
06e9233f
...
...
@@ -287,16 +287,17 @@ void ProgramInterpreter::ShareWorkQueueFrom(InterpreterBaseImpl* src) {
}
void
ProgramInterpreter
::
ShareBuildResultsFrom
(
const
InterpreterBaseImpl
&
src
)
{
if
(
is_shared_results_build_
||
!
src
.
IsSharedResultsBuild
())
{
const
ProgramInterpreter
&
impl
=
dynamic_cast
<
const
ProgramInterpreter
&>
(
src
);
if
(
is_shared_results_build_
||
!
impl
.
IsSharedResultsBuild
())
{
return
;
}
// share op dependency
dependency_builder_
.
ShareDependencyFrom
(
src
.
GetDependencyBuilder
());
dependecy_count_
=
src
.
GetDependencyCount
();
dependency_builder_
.
ShareDependencyFrom
(
impl
.
GetDependencyBuilder
());
dependecy_count_
=
impl
.
GetDependencyCount
();
// share event analysis
stream_analyzer_
.
ShareEventInfoFrom
(
src
.
GetStreamAnalyzer
());
stream_analyzer_
.
ShareEventInfoFrom
(
impl
.
GetStreamAnalyzer
());
is_shared_results_build_
=
true
;
VLOG
(
8
)
<<
"Share Build Results from InterpreterCore("
<<
&
src
VLOG
(
8
)
<<
"Share Build Results from InterpreterCore("
<<
&
impl
<<
") to InterpreterCore("
<<
this
<<
")"
;
}
...
...
@@ -343,18 +344,6 @@ const interpreter::StreamAnalyzer& ProgramInterpreter::GetStreamAnalyzer()
return
stream_analyzer_
;
}
const
interpreter
::
NewIrDependencyBuilder
&
ProgramInterpreter
::
GetNewIrDependencyBuilder
()
const
{
PADDLE_THROW
(
platform
::
errors
::
Unimplemented
(
"GetDependencyBuilder is not implemented in ProgramInterpreter."
));
}
const
interpreter
::
NewIrStreamAnalyzer
&
ProgramInterpreter
::
GetNewIrStreamAnalyzer
()
const
{
PADDLE_THROW
(
platform
::
errors
::
Unimplemented
(
"GetDependencyBuilder is not implemented in ProgramInterpreter."
));
}
bool
ProgramInterpreter
::
IsSharedResultsBuild
()
const
{
return
is_shared_results_build_
;
}
...
...
paddle/fluid/framework/new_executor/program_interpreter.h
浏览文件 @
06e9233f
...
...
@@ -53,17 +53,11 @@ class ProgramInterpreter : public InterpreterBaseImpl {
void
ShareBuildResultsFrom
(
const
InterpreterBaseImpl
&
src
)
override
;
// op dependences
const
interpreter
::
DependencyBuilder
&
GetDependencyBuilder
()
const
override
;
const
interpreter
::
DependencyBuilder
&
GetDependencyBuilder
()
const
;
std
::
shared_ptr
<
std
::
vector
<
size_t
>>
GetDependencyCount
()
const
override
;
const
interpreter
::
StreamAnalyzer
&
GetStreamAnalyzer
()
const
override
;
const
interpreter
::
NewIrDependencyBuilder
&
GetNewIrDependencyBuilder
()
const
override
;
const
interpreter
::
NewIrStreamAnalyzer
&
GetNewIrStreamAnalyzer
()
const
override
;
const
interpreter
::
StreamAnalyzer
&
GetStreamAnalyzer
()
const
;
bool
IsSharedResultsBuild
()
const
override
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录