Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
9af87085
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看板
提交
9af87085
编写于
3月 27, 2018
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use heap variables
上级
22276329
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
6 deletion
+16
-6
paddle/fluid/framework/details/op_handle_base.h
paddle/fluid/framework/details/op_handle_base.h
+9
-1
paddle/fluid/framework/details/threaded_ssa_graph_executor.cc
...le/fluid/framework/details/threaded_ssa_graph_executor.cc
+4
-5
python/paddle/fluid/tests/unittests/test_parallel_executor.py
...on/paddle/fluid/tests/unittests/test_parallel_executor.py
+3
-0
未找到文件。
paddle/fluid/framework/details/op_handle_base.h
浏览文件 @
9af87085
...
@@ -16,11 +16,17 @@
...
@@ -16,11 +16,17 @@
#include "paddle/fluid/framework/details/var_handle.h"
#include "paddle/fluid/framework/details/var_handle.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/device_context.h"
#include "paddle/fluid/platform/macros.h"
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
namespace
details
{
namespace
details
{
struct
OpHandleBase
{
class
OpHandleBase
{
private:
DISABLE_COPY_AND_ASSIGN
(
OpHandleBase
);
public:
std
::
vector
<
VarHandleBase
*>
inputs_
;
std
::
vector
<
VarHandleBase
*>
inputs_
;
std
::
vector
<
VarHandleBase
*>
outputs_
;
std
::
vector
<
VarHandleBase
*>
outputs_
;
std
::
unordered_map
<
platform
::
Place
,
platform
::
DeviceContext
*
,
std
::
unordered_map
<
platform
::
Place
,
platform
::
DeviceContext
*
,
...
@@ -31,6 +37,8 @@ struct OpHandleBase {
...
@@ -31,6 +37,8 @@ struct OpHandleBase {
std
::
unordered_map
<
int
,
cudaEvent_t
>
events_
;
std
::
unordered_map
<
int
,
cudaEvent_t
>
events_
;
#endif
#endif
OpHandleBase
()
{}
std
::
string
DebugString
()
const
;
std
::
string
DebugString
()
const
;
virtual
std
::
string
Name
()
const
=
0
;
virtual
std
::
string
Name
()
const
=
0
;
...
...
paddle/fluid/framework/details/threaded_ssa_graph_executor.cc
浏览文件 @
9af87085
...
@@ -67,7 +67,7 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
...
@@ -67,7 +67,7 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
}
}
// Step 2. Insert FetchOps
// Step 2. Insert FetchOps
std
::
vector
<
FetchOpHandle
>
fetch_ops
;
std
::
vector
<
std
::
unique_ptr
<
FetchOpHandle
>
>
fetch_ops
;
std
::
vector
<
DummyVarHandle
>
dummy_vars
;
std
::
vector
<
DummyVarHandle
>
dummy_vars
;
FeedFetchList
fetch_data
(
fetch_tensors
.
size
());
FeedFetchList
fetch_data
(
fetch_tensors
.
size
());
...
@@ -84,9 +84,9 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
...
@@ -84,9 +84,9 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
for
(
size_t
i
=
0
;
i
<
fetch_tensors
.
size
();
++
i
)
{
for
(
size_t
i
=
0
;
i
<
fetch_tensors
.
size
();
++
i
)
{
auto
&
var_name
=
fetch_tensors
[
i
];
auto
&
var_name
=
fetch_tensors
[
i
];
auto
&
vars
=
fetched_vars
[
var_name
]
;
auto
&
vars
=
fetched_vars
.
at
(
var_name
)
;
fetch_ops
.
emplace_back
(
&
fetch_data
,
i
,
&
local_scopes_
);
auto
*
op
=
new
FetchOpHandle
(
&
fetch_data
,
i
,
&
local_scopes_
);
details
::
FetchOpHandle
*
op
=
&
fetch_ops
.
back
(
);
fetch_ops
.
emplace_back
(
op
);
// FIXME: Use new device context
// FIXME: Use new device context
for
(
auto
&
p
:
places_
)
{
for
(
auto
&
p
:
places_
)
{
...
@@ -138,7 +138,6 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
...
@@ -138,7 +138,6 @@ FeedFetchList ThreadedSSAGraphExecutor::Run(
for
(
auto
&
op
:
pending_ops
)
{
for
(
auto
&
op
:
pending_ops
)
{
VLOG
(
10
)
<<
op
.
first
->
DebugString
();
VLOG
(
10
)
<<
op
.
first
->
DebugString
();
}
}
// keep waiting the ready variables
// keep waiting the ready variables
continue
;
continue
;
}
}
...
...
python/paddle/fluid/tests/unittests/test_parallel_executor.py
浏览文件 @
9af87085
...
@@ -231,6 +231,9 @@ class TestMNIST(TestParallelExecutorBase):
...
@@ -231,6 +231,9 @@ class TestMNIST(TestParallelExecutorBase):
class
TestResnet
(
TestParallelExecutorBase
):
class
TestResnet
(
TestParallelExecutorBase
):
@
classmethod
@
classmethod
def
setUpClass
(
cls
):
def
setUpClass
(
cls
):
import
os
if
os
.
path
.
exists
(
'./flowers.recordio'
):
return
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
with
fluid
.
program_guard
(
fluid
.
Program
(),
fluid
.
Program
()):
reader
=
paddle
.
batch
(
flowers
.
train
(),
batch_size
=
4
)
reader
=
paddle
.
batch
(
flowers
.
train
(),
batch_size
=
4
)
feeder
=
fluid
.
DataFeeder
(
feeder
=
fluid
.
DataFeeder
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录