Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
0c44dd64
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
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看板
未验证
提交
0c44dd64
编写于
6月 25, 2022
作者:
L
Leo Chen
提交者:
GitHub
6月 25, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[new-exec] lazy creating work queue (#43551) (#43768)
* lazy creating work queue * fix dry_run
上级
9edbe4aa
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
34 addition
and
6 deletion
+34
-6
paddle/fluid/framework/new_executor/interpretercore.cc
paddle/fluid/framework/new_executor/interpretercore.cc
+34
-6
未找到文件。
paddle/fluid/framework/new_executor/interpretercore.cc
浏览文件 @
0c44dd64
...
...
@@ -61,8 +61,6 @@ InterpreterCore::InterpreterCore(const platform::Place& place,
stream_analyzer_
(
place
)
{
VLOG
(
4
)
<<
"InterpreterCore(): "
<<
this
<<
" on "
<<
place_
;
is_build_
=
false
;
async_work_queue_
.
reset
(
new
interpreter
::
AsyncWorkQueue
(
kHostNumThreads
,
kDeviceNumThreads
,
&
main_thread_blocker_
));
#if defined(PADDLE_WITH_CUDA) || defined(PADDLE_WITH_HIP)
if
(
IsInterpretercoreFastGCEnabled
())
{
...
...
@@ -125,6 +123,17 @@ paddle::framework::FetchList InterpreterCore::Run(
// add listener before run and is_build=true
global_scope_
->
ResetListener
();
// For the program that only run once, it is no need to
// create work_queue, so the async_work_queue_ is created
// until the second step run.
if
(
async_work_queue_
==
nullptr
)
{
async_work_queue_
=
std
::
make_unique
<
interpreter
::
AsyncWorkQueue
>
(
kHostNumThreads
,
kDeviceNumThreads
,
&
main_thread_blocker_
);
// prepare for the first time.
async_work_queue_
->
PrepareAtomicDeps
(
dependecy_count_
);
async_work_queue_
->
PrepareAtomicVarRef
(
global_scope_
->
VecMetaInfo
());
}
ExecuteInstructionList
(
vec_instruction_
);
}
...
...
@@ -172,6 +181,17 @@ paddle::framework::FetchList InterpreterCore::Run(
// add listener before run and is_build=true
global_scope_
->
ResetListener
();
// For the program that only run once, it is no need to
// create work_queue, so the async_work_queue_ is created
// until the second step run.
if
(
async_work_queue_
==
nullptr
)
{
async_work_queue_
=
std
::
make_unique
<
interpreter
::
AsyncWorkQueue
>
(
kHostNumThreads
,
kDeviceNumThreads
,
&
main_thread_blocker_
);
// prepare for the first time.
async_work_queue_
->
PrepareAtomicDeps
(
dependecy_count_
);
async_work_queue_
->
PrepareAtomicVarRef
(
global_scope_
->
VecMetaInfo
());
}
ExecuteInstructionList
(
vec_instruction_
);
}
...
...
@@ -341,10 +361,6 @@ void InterpreterCore::Convert(
if
(
FLAGS_new_executor_use_inplace
&&
!
inplaced
)
{
BuildInplace
();
}
// prepare for the first time.
async_work_queue_
->
PrepareAtomicDeps
(
dependecy_count_
);
async_work_queue_
->
PrepareAtomicVarRef
(
vec_meta_info
);
}
bool
InterpreterCore
::
BuildInplaceCheckVarIsOnlyInput
(
size_t
var_index
)
{
...
...
@@ -924,6 +940,18 @@ interpreter::CostInfo InterpreterCore::DryRun(
interpreter
::
CostInfo
cost_info
;
{
interpreter
::
ProfilerGuard
(
place_
,
&
cost_info
);
// For the program that only run once, it is no need to
// create work_queue, so the async_work_queue_ is created
// until the second step run.
if
(
async_work_queue_
==
nullptr
)
{
async_work_queue_
=
std
::
make_unique
<
interpreter
::
AsyncWorkQueue
>
(
kHostNumThreads
,
kDeviceNumThreads
,
&
main_thread_blocker_
);
// prepare for the first time.
async_work_queue_
->
PrepareAtomicDeps
(
dependecy_count_
);
async_work_queue_
->
PrepareAtomicVarRef
(
global_scope_
->
VecMetaInfo
());
}
ExecuteInstructionList
(
vec_instruction_
);
platform
::
DeviceContextPool
::
Instance
().
Get
(
place_
)
->
Wait
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录