Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
1e4e23a8
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1e4e23a8
编写于
8月 05, 2020
作者:
S
sandyhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clear code, test=develop
上级
d1d6c268
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
47 deletion
+0
-47
paddle/fluid/framework/section_worker.cc
paddle/fluid/framework/section_worker.cc
+0
-47
未找到文件。
paddle/fluid/framework/section_worker.cc
浏览文件 @
1e4e23a8
...
@@ -323,10 +323,6 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -323,10 +323,6 @@ void SectionWorker::TrainFilesWithProfiler() {
struct
timeval
micro_end
;
struct
timeval
micro_end
;
while
(
true
)
{
while
(
true
)
{
// Start a minibatch.
// Start a minibatch.
// int batch_size = 0;
//cudaEvent_t cu_start, cu_stop;
//cudaEventCreate(&cu_start);
//cudaEventCreate(&cu_stop);
batch_timer
.
Start
();
batch_timer
.
Start
();
for
(
int
i
=
0
;
i
<
num_microbatches_
;
++
i
)
{
for
(
int
i
=
0
;
i
<
num_microbatches_
;
++
i
)
{
try
{
try
{
...
@@ -349,18 +345,12 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -349,18 +345,12 @@ void SectionWorker::TrainFilesWithProfiler() {
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
<<
" for scope "
<<
i
;
<<
" for scope "
<<
i
;
timeline
.
Start
();
timeline
.
Start
();
//cudaEventRecord(cu_start);
op
->
Run
(
*
microbatch_scopes_
[
i
],
place_
);
op
->
Run
(
*
microbatch_scopes_
[
i
],
place_
);
if
(
gc
)
{
if
(
gc
)
{
DeleteUnusedTensors
(
*
microbatch_scopes_
[
i
],
op
.
get
(),
DeleteUnusedTensors
(
*
microbatch_scopes_
[
i
],
op
.
get
(),
unused_vars_
,
gc
.
get
());
unused_vars_
,
gc
.
get
());
}
}
cudaDeviceSynchronize
();
cudaDeviceSynchronize
();
//cudaEventRecord(cu_stop);
//cudaEventSynchronize(cu_stop);
//float cuda_time;
//cudaEventElapsedTime(&cuda_time, cu_start, cu_stop);
//VLOG(0) << "op: " << op->Type() << "; time: " << cuda_time;
timeline
.
Pause
();
timeline
.
Pause
();
gettimeofday
(
&
end
,
NULL
);
gettimeofday
(
&
end
,
NULL
);
auto
time
=
timeline
.
ElapsedUS
();
auto
time
=
timeline
.
ElapsedUS
();
...
@@ -407,8 +397,6 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -407,8 +397,6 @@ void SectionWorker::TrainFilesWithProfiler() {
<<
", mean_time: "
<<
op_total_time
[
i
]
/
op_count
[
i
];
<<
", mean_time: "
<<
op_total_time
[
i
]
/
op_count
[
i
];
}
}
VLOG
(
0
)
<<
"================================"
;
VLOG
(
0
)
<<
"================================"
;
//cudaEventDestroy(cu_start);
//cudaEventDestroy(cu_stop);
return
;
return
;
}
}
if
(
i
==
0
)
{
if
(
i
==
0
)
{
...
@@ -432,18 +420,12 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -432,18 +420,12 @@ void SectionWorker::TrainFilesWithProfiler() {
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
<<
" for scope "
<<
i
;
<<
" for scope "
<<
i
;
timeline
.
Start
();
timeline
.
Start
();
//cudaEventRecord(cu_start);
op
->
Run
(
*
microbatch_scopes_
[
i
],
place_
);
op
->
Run
(
*
microbatch_scopes_
[
i
],
place_
);
if
(
gc
)
{
if
(
gc
)
{
DeleteUnusedTensors
(
*
microbatch_scopes_
[
i
],
op
.
get
(),
DeleteUnusedTensors
(
*
microbatch_scopes_
[
i
],
op
.
get
(),
unused_vars_
,
gc
.
get
());
unused_vars_
,
gc
.
get
());
}
}
cudaDeviceSynchronize
();
cudaDeviceSynchronize
();
//cudaEventRecord(cu_stop);
//cudaEventSynchronize(cu_stop);
//float cuda_time;
//cudaEventElapsedTime(&cuda_time, cu_start, cu_stop);
//VLOG(0) << "op: " << op->Type() << "; time: " << cuda_time;
gettimeofday
(
&
end
,
NULL
);
gettimeofday
(
&
end
,
NULL
);
timeline
.
Pause
();
timeline
.
Pause
();
auto
time
=
timeline
.
ElapsedUS
();
auto
time
=
timeline
.
ElapsedUS
();
...
@@ -488,18 +470,12 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -488,18 +470,12 @@ void SectionWorker::TrainFilesWithProfiler() {
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
<<
" for minibatch scope"
;
<<
" for minibatch scope"
;
timeline
.
Start
();
timeline
.
Start
();
//cudaEventRecord(cu_start);
op
->
Run
(
*
microbatch_scopes_
[
0
],
place_
);
op
->
Run
(
*
microbatch_scopes_
[
0
],
place_
);
if
(
gc
)
{
if
(
gc
)
{
DeleteUnusedTensors
(
*
microbatch_scopes_
[
num_microbatches_
-
1
],
DeleteUnusedTensors
(
*
microbatch_scopes_
[
num_microbatches_
-
1
],
op
.
get
(),
unused_vars_
,
gc
.
get
());
op
.
get
(),
unused_vars_
,
gc
.
get
());
}
}
//cudaEventRecord(cu_stop);
//cudaEventSynchronize(cu_stop);
cudaDeviceSynchronize
();
cudaDeviceSynchronize
();
//float cuda_time;
//cudaEventElapsedTime(&cuda_time, cu_start, cu_stop);
//VLOG(0) << "op: " << op->Type() << "; time: " << cuda_time;
gettimeofday
(
&
end
,
NULL
);
gettimeofday
(
&
end
,
NULL
);
timeline
.
Pause
();
timeline
.
Pause
();
auto
time
=
timeline
.
ElapsedUS
();
auto
time
=
timeline
.
ElapsedUS
();
...
@@ -516,7 +492,6 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -516,7 +492,6 @@ void SectionWorker::TrainFilesWithProfiler() {
std
::
unique_lock
<
std
::
mutex
>
lk
(
cout_mutex
);
std
::
unique_lock
<
std
::
mutex
>
lk
(
cout_mutex
);
std
::
cout
<<
std
::
fixed
;
std
::
cout
<<
std
::
fixed
;
std
::
cout
.
precision
(
0
);
std
::
cout
.
precision
(
0
);
//std::cout << "::UPD:B[" << batch_id_ << "]:SEC[" << thread_id_
std
::
cout
<<
"::UPD:B["
<<
batch_id_
<<
"]:SEC["
<<
thread_id_
<<
"]:SCOPE["
<<
num_microbatches_
std
::
cout
<<
"::UPD:B["
<<
batch_id_
<<
"]:SEC["
<<
thread_id_
<<
"]:SCOPE["
<<
num_microbatches_
<<
"]:OP["
<<
op
->
Type
()
<<
"]:START["
<<
start
.
tv_sec
*
1e6
+
start
.
tv_usec
<<
"]:OP["
<<
op
->
Type
()
<<
"]:START["
<<
start
.
tv_sec
*
1e6
+
start
.
tv_usec
<<
"]:END["
<<
end
.
tv_sec
*
1e6
+
end
.
tv_usec
<<
"]"
<<
std
::
endl
;
<<
"]:END["
<<
end
.
tv_sec
*
1e6
+
end
.
tv_usec
<<
"]"
<<
std
::
endl
;
...
@@ -574,9 +549,6 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -574,9 +549,6 @@ void SectionWorker::TrainFilesWithProfiler() {
<<
", mean_time: "
<<
op_total_time
[
i
]
/
op_count
[
i
];
<<
", mean_time: "
<<
op_total_time
[
i
]
/
op_count
[
i
];
}
}
VLOG
(
0
)
<<
"================================"
;
VLOG
(
0
)
<<
"================================"
;
//threads_completed = false;
//cudaEventDestroy(cu_start);
//cudaEventDestroy(cu_stop);
return
;
return
;
}
}
lk
.
unlock
();
lk
.
unlock
();
...
@@ -603,18 +575,12 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -603,18 +575,12 @@ void SectionWorker::TrainFilesWithProfiler() {
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
<<
" for scope "
<<
i
;
<<
" for scope "
<<
i
;
timeline
.
Start
();
timeline
.
Start
();
//cudaEventRecord(cu_start);
op
->
Run
(
*
microbatch_scopes_
[
i
],
place_
);
op
->
Run
(
*
microbatch_scopes_
[
i
],
place_
);
if
(
gc
)
{
if
(
gc
)
{
DeleteUnusedTensors
(
*
microbatch_scopes_
[
i
],
op
.
get
(),
DeleteUnusedTensors
(
*
microbatch_scopes_
[
i
],
op
.
get
(),
unused_vars_
,
gc
.
get
());
unused_vars_
,
gc
.
get
());
}
}
//cudaEventRecord(cu_stop);
//cudaEventSynchronize(cu_stop);
cudaDeviceSynchronize
();
cudaDeviceSynchronize
();
//float cuda_time;
//cudaEventElapsedTime(&cuda_time, cu_start, cu_stop);
//VLOG(0) << "op: " << op->Type() << "; time: " << cuda_time;
gettimeofday
(
&
end
,
NULL
);
gettimeofday
(
&
end
,
NULL
);
timeline
.
Pause
();
timeline
.
Pause
();
auto
time
=
timeline
.
ElapsedUS
();
auto
time
=
timeline
.
ElapsedUS
();
...
@@ -662,18 +628,12 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -662,18 +628,12 @@ void SectionWorker::TrainFilesWithProfiler() {
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
<<
" for scope "
<<
i
;
<<
" for scope "
<<
i
;
timeline
.
Start
();
timeline
.
Start
();
//cudaEventRecord(cu_start);
op
->
Run
(
*
microbatch_scopes_
[
i
],
place_
);
op
->
Run
(
*
microbatch_scopes_
[
i
],
place_
);
if
(
gc
)
{
if
(
gc
)
{
DeleteUnusedTensors
(
*
microbatch_scopes_
[
i
],
op
.
get
(),
DeleteUnusedTensors
(
*
microbatch_scopes_
[
i
],
op
.
get
(),
unused_vars_
,
gc
.
get
());
unused_vars_
,
gc
.
get
());
}
}
//cudaEventRecord(cu_stop);
//cudaEventSynchronize(cu_stop);
cudaDeviceSynchronize
();
cudaDeviceSynchronize
();
//float cuda_time;
//cudaEventElapsedTime(&cuda_time, cu_start, cu_stop);
//VLOG(0) << "op: " << op->Type() << "; time: " << cuda_time;
gettimeofday
(
&
end
,
NULL
);
gettimeofday
(
&
end
,
NULL
);
timeline
.
Pause
();
timeline
.
Pause
();
auto
time
=
timeline
.
ElapsedUS
();
auto
time
=
timeline
.
ElapsedUS
();
...
@@ -718,18 +678,12 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -718,18 +678,12 @@ void SectionWorker::TrainFilesWithProfiler() {
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
VLOG
(
3
)
<<
"running an op "
<<
op
->
Type
()
<<
" for "
<<
thread_id_
<<
" for minibatch scope"
;
<<
" for minibatch scope"
;
timeline
.
Start
();
timeline
.
Start
();
//cudaEventRecord(cu_start);
op
->
Run
(
*
microbatch_scopes_
[
0
],
place_
);
op
->
Run
(
*
microbatch_scopes_
[
0
],
place_
);
if
(
gc
)
{
if
(
gc
)
{
DeleteUnusedTensors
(
*
microbatch_scopes_
[
num_microbatches_
-
1
],
DeleteUnusedTensors
(
*
microbatch_scopes_
[
num_microbatches_
-
1
],
op
.
get
(),
unused_vars_
,
gc
.
get
());
op
.
get
(),
unused_vars_
,
gc
.
get
());
}
}
//cudaEventRecord(cu_stop);
//cudaEventSynchronize(cu_stop);
cudaDeviceSynchronize
();
cudaDeviceSynchronize
();
//float cuda_time;
//cudaEventElapsedTime(&cuda_time, cu_start, cu_stop);
//VLOG(0) << "op: " << op->Type() << "; time: " << cuda_time;
gettimeofday
(
&
end
,
NULL
);
gettimeofday
(
&
end
,
NULL
);
timeline
.
Pause
();
timeline
.
Pause
();
auto
time
=
timeline
.
ElapsedUS
();
auto
time
=
timeline
.
ElapsedUS
();
...
@@ -746,7 +700,6 @@ void SectionWorker::TrainFilesWithProfiler() {
...
@@ -746,7 +700,6 @@ void SectionWorker::TrainFilesWithProfiler() {
std
::
unique_lock
<
std
::
mutex
>
lk
(
cout_mutex
);
std
::
unique_lock
<
std
::
mutex
>
lk
(
cout_mutex
);
std
::
cout
<<
std
::
fixed
;
std
::
cout
<<
std
::
fixed
;
std
::
cout
.
precision
(
0
);
std
::
cout
.
precision
(
0
);
//std::cout << "::UPD:B[" << local_batch_id_ << "]:SEC[" << thread_id_
std
::
cout
<<
"::UPD:B["
<<
batch_id_
<<
"]:SEC["
<<
thread_id_
<<
"]:SCOPE["
<<
num_microbatches_
std
::
cout
<<
"::UPD:B["
<<
batch_id_
<<
"]:SEC["
<<
thread_id_
<<
"]:SCOPE["
<<
num_microbatches_
<<
"]:OP["
<<
op
->
Type
()
<<
"]:START["
<<
start
.
tv_sec
*
1e6
+
start
.
tv_usec
<<
"]:OP["
<<
op
->
Type
()
<<
"]:START["
<<
start
.
tv_sec
*
1e6
+
start
.
tv_usec
<<
"]:END["
<<
end
.
tv_sec
*
1e6
+
end
.
tv_usec
<<
"]"
<<
std
::
endl
;
<<
"]:END["
<<
end
.
tv_sec
*
1e6
+
end
.
tv_usec
<<
"]"
<<
std
::
endl
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录