Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Crayon鑫
Paddle
提交
9d2bd0ac
P
Paddle
项目概览
Crayon鑫
/
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看板
未验证
提交
9d2bd0ac
编写于
6月 03, 2020
作者:
1
123malin
提交者:
GitHub
6月 03, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
downpour_worker增加try_catch机制,打印program所有参数 (#24700)
* test=develop, add try_catch for debug
上级
b2ba830e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
49 addition
and
5 deletion
+49
-5
paddle/fluid/framework/device_worker.cc
paddle/fluid/framework/device_worker.cc
+3
-4
paddle/fluid/framework/device_worker.h
paddle/fluid/framework/device_worker.h
+2
-1
paddle/fluid/framework/downpour_worker.cc
paddle/fluid/framework/downpour_worker.cc
+43
-0
paddle/fluid/framework/hogwild_worker.cc
paddle/fluid/framework/hogwild_worker.cc
+1
-0
未找到文件。
paddle/fluid/framework/device_worker.cc
浏览文件 @
9d2bd0ac
...
...
@@ -25,7 +25,7 @@ void DeviceWorker::SetDataFeed(DataFeed* data_feed) {
}
template
<
typename
T
>
std
::
string
PrintLodTensorType
(
LoD
Tensor
*
tensor
,
int64_t
start
,
int64_t
end
)
{
std
::
string
PrintLodTensorType
(
Tensor
*
tensor
,
int64_t
start
,
int64_t
end
)
{
auto
count
=
tensor
->
numel
();
if
(
start
<
0
||
end
>
count
)
{
VLOG
(
3
)
<<
"access violation"
;
...
...
@@ -38,8 +38,7 @@ std::string PrintLodTensorType(LoDTensor* tensor, int64_t start, int64_t end) {
return
os
.
str
();
}
std
::
string
PrintLodTensorIntType
(
LoDTensor
*
tensor
,
int64_t
start
,
int64_t
end
)
{
std
::
string
PrintLodTensorIntType
(
Tensor
*
tensor
,
int64_t
start
,
int64_t
end
)
{
auto
count
=
tensor
->
numel
();
if
(
start
<
0
||
end
>
count
)
{
VLOG
(
3
)
<<
"access violation"
;
...
...
@@ -52,7 +51,7 @@ std::string PrintLodTensorIntType(LoDTensor* tensor, int64_t start,
return
os
.
str
();
}
std
::
string
PrintLodTensor
(
LoD
Tensor
*
tensor
,
int64_t
start
,
int64_t
end
)
{
std
::
string
PrintLodTensor
(
Tensor
*
tensor
,
int64_t
start
,
int64_t
end
)
{
std
::
string
out_val
;
if
(
tensor
->
type
()
==
proto
::
VarType
::
FP32
)
{
out_val
=
PrintLodTensorType
<
float
>
(
tensor
,
start
,
end
);
...
...
paddle/fluid/framework/device_worker.h
浏览文件 @
9d2bd0ac
...
...
@@ -45,7 +45,7 @@ limitations under the License. */
namespace
paddle
{
namespace
framework
{
std
::
string
PrintLodTensor
(
LoD
Tensor
*
tensor
,
int64_t
start
,
int64_t
end
);
std
::
string
PrintLodTensor
(
Tensor
*
tensor
,
int64_t
start
,
int64_t
end
);
std
::
pair
<
int64_t
,
int64_t
>
GetTensorBound
(
LoDTensor
*
tensor
,
int
index
);
bool
CheckValidOutput
(
LoDTensor
*
tensor
,
size_t
batch_size
);
...
...
@@ -171,6 +171,7 @@ class DeviceWorker {
bool
need_dump_field_
;
const
std
::
vector
<
std
::
string
>*
dump_param_
;
const
std
::
vector
<
std
::
string
>*
dump_fields_
;
std
::
vector
<
std
::
string
>
all_param_
;
int
dump_mode_
=
0
;
int
dump_interval_
=
10000
;
...
...
paddle/fluid/framework/downpour_worker.cc
浏览文件 @
9d2bd0ac
...
...
@@ -771,7 +771,50 @@ void DownpourWorker::TrainFiles() {
}
}
if
(
!
need_skip
)
{
#ifdef PADDLE_WITH_PSLIB
try
{
op
->
Run
(
*
thread_scope_
,
place_
);
}
catch
(
std
::
exception
&
e
)
{
fprintf
(
stderr
,
"error message: %s
\n
"
,
e
.
what
());
auto
&
ins_id_vec
=
device_reader_
->
GetInsIdVec
();
size_t
batch_size
=
device_reader_
->
GetCurBatchSize
();
std
::
string
s
=
""
;
for
(
auto
&
ins_id
:
ins_id_vec
)
{
if
(
s
!=
""
)
s
+=
","
;
s
+=
ins_id
;
}
fprintf
(
stderr
,
"batch_size: %zu, ins_ids_vec: %s
\n
"
,
batch_size
,
s
.
c_str
());
s
=
""
;
for
(
auto
&
param
:
all_param_
)
{
Variable
*
var
=
thread_scope_
->
FindVar
(
param
);
if
(
var
==
nullptr
)
{
continue
;
}
Tensor
*
tensor
=
nullptr
;
int64_t
len
=
0
;
if
(
var
->
IsType
<
framework
::
LoDTensor
>
())
{
tensor
=
var
->
GetMutable
<
LoDTensor
>
();
len
=
tensor
->
numel
();
}
else
if
(
var
->
IsType
<
SelectedRows
>
())
{
auto
selected_rows
=
var
->
GetMutable
<
SelectedRows
>
();
tensor
=
selected_rows
->
mutable_value
();
len
=
tensor
->
numel
();
}
if
(
!
tensor
->
IsInitialized
())
{
continue
;
}
s
+=
param
+
":"
+
std
::
to_string
(
len
)
+
":"
;
s
+=
PrintLodTensor
(
tensor
,
0
,
len
);
fprintf
(
stderr
,
"%s
\n
"
,
s
.
c_str
());
fflush
(
stderr
);
s
=
""
;
}
throw
e
;
}
#else
op
->
Run
(
*
thread_scope_
,
place_
);
#endif
}
}
...
...
paddle/fluid/framework/hogwild_worker.cc
浏览文件 @
9d2bd0ac
...
...
@@ -58,6 +58,7 @@ void HogwildWorker::CreateThreadScope(const ProgramDesc &program) {
thread_scope_
=
&
root_scope_
->
NewScope
();
for
(
auto
&
var
:
block
.
AllVars
())
{
all_param_
.
push_back
(
var
->
Name
());
if
(
var
->
Persistable
())
{
auto
*
ptr
=
root_scope_
->
Var
(
var
->
Name
());
InitializeVariable
(
ptr
,
var
->
GetType
());
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录