Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a3f9d6a3
P
Paddle
项目概览
机器未来
/
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看板
提交
a3f9d6a3
编写于
8月 05, 2018
作者:
Q
qiaolongfei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
optimize profiler
上级
0964de11
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
7 addition
and
27 deletion
+7
-27
paddle/fluid/CMakeLists.txt
paddle/fluid/CMakeLists.txt
+1
-1
paddle/fluid/framework/operator.cc
paddle/fluid/framework/operator.cc
+6
-3
paddle/fluid/operators/feed_op.cc
paddle/fluid/operators/feed_op.cc
+0
-1
paddle/fluid/operators/fetch_barrier_op.cc
paddle/fluid/operators/fetch_barrier_op.cc
+0
-6
paddle/fluid/operators/fetch_op.cc
paddle/fluid/operators/fetch_op.cc
+0
-3
paddle/fluid/operators/load_op.cc
paddle/fluid/operators/load_op.cc
+0
-3
paddle/fluid/operators/recv_op.cc
paddle/fluid/operators/recv_op.cc
+0
-2
paddle/fluid/operators/send_barrier_op.cc
paddle/fluid/operators/send_barrier_op.cc
+0
-5
paddle/fluid/operators/send_op.cc
paddle/fluid/operators/send_op.cc
+0
-3
未找到文件。
paddle/fluid/CMakeLists.txt
浏览文件 @
a3f9d6a3
...
@@ -6,4 +6,4 @@ add_subdirectory(pybind)
...
@@ -6,4 +6,4 @@ add_subdirectory(pybind)
add_subdirectory
(
string
)
add_subdirectory
(
string
)
add_subdirectory
(
recordio
)
add_subdirectory
(
recordio
)
# NOTE: please add subdirectory inference at last.
# NOTE: please add subdirectory inference at last.
add_subdirectory
(
inference
)
#
add_subdirectory(inference)
paddle/fluid/framework/operator.cc
浏览文件 @
a3f9d6a3
...
@@ -136,6 +136,12 @@ void OperatorBase::Run(const Scope& scope, const platform::Place& place) {
...
@@ -136,6 +136,12 @@ void OperatorBase::Run(const Scope& scope, const platform::Place& place) {
platform
::
SetDeviceId
(
dev_id
);
platform
::
SetDeviceId
(
dev_id
);
#endif
#endif
}
}
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
*
dev_ctx
=
pool
.
Get
(
place
);
// For profiling, don't move out of this function because that will result
// in the failure of multi-GPU profiling.
platform
::
RecordEvent
record_event
(
Type
(),
dev_ctx
);
RunImpl
(
scope
,
place
);
RunImpl
(
scope
,
place
);
VLOG
(
10
)
<<
"+ "
<<
DebugStringEx
(
&
scope
);
VLOG
(
10
)
<<
"+ "
<<
DebugStringEx
(
&
scope
);
}
}
...
@@ -639,9 +645,6 @@ void OperatorWithKernel::RunImpl(const Scope& scope,
...
@@ -639,9 +645,6 @@ void OperatorWithKernel::RunImpl(const Scope& scope,
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
*
dev_ctx
=
pool
.
Get
(
place
);
auto
*
dev_ctx
=
pool
.
Get
(
place
);
// For profiling, don't move out of this function because that will result
// in the failure of multi-GPU profiling.
platform
::
RecordEvent
record_event
(
Type
(),
dev_ctx
);
// check if op[type] has kernel registered.
// check if op[type] has kernel registered.
auto
&
all_op_kernels
=
AllOpKernels
();
auto
&
all_op_kernels
=
AllOpKernels
();
auto
kernels_iter
=
all_op_kernels
.
find
(
type_
);
auto
kernels_iter
=
all_op_kernels
.
find
(
type_
);
...
...
paddle/fluid/operators/feed_op.cc
浏览文件 @
a3f9d6a3
...
@@ -31,7 +31,6 @@ class FeedOp : public framework::OperatorBase {
...
@@ -31,7 +31,6 @@ class FeedOp : public framework::OperatorBase {
const
platform
::
Place
&
place
)
const
override
{
const
platform
::
Place
&
place
)
const
override
{
// get device context from pool
// get device context from pool
auto
*
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
auto
*
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
platform
::
RecordEvent
record_event
(
Type
(),
dev_ctx
);
auto
feed_var_name
=
Input
(
"X"
);
auto
feed_var_name
=
Input
(
"X"
);
auto
*
feed_var
=
scope
.
FindVar
(
feed_var_name
);
auto
*
feed_var
=
scope
.
FindVar
(
feed_var_name
);
...
...
paddle/fluid/operators/fetch_barrier_op.cc
浏览文件 @
a3f9d6a3
...
@@ -36,12 +36,6 @@ class FetchBarrierOp : public framework::OperatorBase {
...
@@ -36,12 +36,6 @@ class FetchBarrierOp : public framework::OperatorBase {
void
RunImpl
(
const
framework
::
Scope
&
scope
,
void
RunImpl
(
const
framework
::
Scope
&
scope
,
const
platform
::
Place
&
place
)
const
override
{
const
platform
::
Place
&
place
)
const
override
{
std
::
vector
<
std
::
string
>
eps
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"endpoints"
);
std
::
vector
<
std
::
string
>
eps
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"endpoints"
);
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
&
ctx
=
*
pool
.
Get
(
place
);
// For profiling
platform
::
RecordEvent
record_event
(
Type
(),
&
ctx
);
distributed
::
RPCClient
*
rpc_client
=
distributed
::
RPCClient
*
rpc_client
=
distributed
::
RPCClient
::
GetInstance
<
RPCCLIENT_T
>
();
distributed
::
RPCClient
::
GetInstance
<
RPCCLIENT_T
>
();
...
...
paddle/fluid/operators/fetch_op.cc
浏览文件 @
a3f9d6a3
...
@@ -30,9 +30,6 @@ class FetchOp : public framework::OperatorBase {
...
@@ -30,9 +30,6 @@ class FetchOp : public framework::OperatorBase {
private:
private:
void
RunImpl
(
const
framework
::
Scope
&
scope
,
void
RunImpl
(
const
framework
::
Scope
&
scope
,
const
platform
::
Place
&
place
)
const
override
{
const
platform
::
Place
&
place
)
const
override
{
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
platform
::
RecordEvent
record_event
(
Type
(),
pool
.
Get
(
place
));
auto
fetch_var_name
=
Input
(
"X"
);
auto
fetch_var_name
=
Input
(
"X"
);
auto
*
fetch_var
=
scope
.
FindVar
(
fetch_var_name
);
auto
*
fetch_var
=
scope
.
FindVar
(
fetch_var_name
);
PADDLE_ENFORCE
(
fetch_var
!=
nullptr
,
PADDLE_ENFORCE
(
fetch_var
!=
nullptr
,
...
...
paddle/fluid/operators/load_op.cc
浏览文件 @
a3f9d6a3
...
@@ -31,9 +31,6 @@ class LoadOp : public framework::OperatorBase {
...
@@ -31,9 +31,6 @@ class LoadOp : public framework::OperatorBase {
private:
private:
void
RunImpl
(
const
framework
::
Scope
&
scope
,
void
RunImpl
(
const
framework
::
Scope
&
scope
,
const
platform
::
Place
&
place
)
const
override
{
const
platform
::
Place
&
place
)
const
override
{
auto
*
dev_ctx
=
platform
::
DeviceContextPool
::
Instance
().
Get
(
place
);
platform
::
RecordEvent
record_event
(
Type
(),
dev_ctx
);
// FIXME(yuyang18): We save variable to local file now, but we should change
// FIXME(yuyang18): We save variable to local file now, but we should change
// it to save an output stream.
// it to save an output stream.
auto
filename
=
Attr
<
std
::
string
>
(
"file_path"
);
auto
filename
=
Attr
<
std
::
string
>
(
"file_path"
);
...
...
paddle/fluid/operators/recv_op.cc
浏览文件 @
a3f9d6a3
...
@@ -40,8 +40,6 @@ class RecvOp : public framework::OperatorBase {
...
@@ -40,8 +40,6 @@ class RecvOp : public framework::OperatorBase {
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
&
ctx
=
*
pool
.
Get
(
place
);
auto
&
ctx
=
*
pool
.
Get
(
place
);
// For profiling
platform
::
RecordEvent
record_event
(
Type
(),
&
ctx
);
distributed
::
RPCClient
*
rpc_client
=
distributed
::
RPCClient
*
rpc_client
=
distributed
::
RPCClient
::
GetInstance
<
RPCCLIENT_T
>
();
distributed
::
RPCClient
::
GetInstance
<
RPCCLIENT_T
>
();
...
...
paddle/fluid/operators/send_barrier_op.cc
浏览文件 @
a3f9d6a3
...
@@ -39,11 +39,6 @@ class SendBarrierOp : public framework::OperatorBase {
...
@@ -39,11 +39,6 @@ class SendBarrierOp : public framework::OperatorBase {
std
::
vector
<
std
::
string
>
eps
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"endpoints"
);
std
::
vector
<
std
::
string
>
eps
=
Attr
<
std
::
vector
<
std
::
string
>>
(
"endpoints"
);
bool
sync_mode
=
Attr
<
bool
>
(
"sync_mode"
);
bool
sync_mode
=
Attr
<
bool
>
(
"sync_mode"
);
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
&
ctx
=
*
pool
.
Get
(
place
);
// For profiling
platform
::
RecordEvent
record_event
(
Type
(),
&
ctx
);
distributed
::
RPCClient
*
rpc_client
=
distributed
::
RPCClient
*
rpc_client
=
distributed
::
RPCClient
::
GetInstance
<
RPCCLIENT_T
>
();
distributed
::
RPCClient
::
GetInstance
<
RPCCLIENT_T
>
();
...
...
paddle/fluid/operators/send_op.cc
浏览文件 @
a3f9d6a3
...
@@ -42,9 +42,6 @@ class SendOp : public framework::OperatorBase {
...
@@ -42,9 +42,6 @@ class SendOp : public framework::OperatorBase {
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
platform
::
DeviceContextPool
&
pool
=
platform
::
DeviceContextPool
::
Instance
();
auto
&
ctx
=
*
pool
.
Get
(
place
);
auto
&
ctx
=
*
pool
.
Get
(
place
);
// For profiling
platform
::
RecordEvent
record_event
(
Type
(),
&
ctx
);
distributed
::
RPCClient
*
rpc_client
=
distributed
::
RPCClient
*
rpc_client
=
distributed
::
RPCClient
::
GetInstance
<
RPCCLIENT_T
>
();
distributed
::
RPCClient
::
GetInstance
<
RPCCLIENT_T
>
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录