Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
70029395
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
70029395
编写于
9月 08, 2020
作者:
Z
ZPaC
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
1.Fix error when pserver finishes training.
2.Optimize worker and server log. 3.Try Catch ps-lite exceptions.
上级
fc5a7bc9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
12 addition
and
1 deletion
+12
-1
mindspore/ccsrc/frontend/parallel/ps/parameter_server.h
mindspore/ccsrc/frontend/parallel/ps/parameter_server.h
+4
-0
mindspore/ccsrc/frontend/parallel/ps/worker.h
mindspore/ccsrc/frontend/parallel/ps/worker.h
+5
-1
model_zoo/official/recommend/wide_and_deep/src/callbacks.py
model_zoo/official/recommend/wide_and_deep/src/callbacks.py
+3
-0
未找到文件。
mindspore/ccsrc/frontend/parallel/ps/parameter_server.h
浏览文件 @
70029395
...
...
@@ -736,7 +736,9 @@ void ParameterServer<T>::SyncEmbeddingTables() {
template
<
typename
T
>
void
ParameterServer
<
T
>::
Run
(
const
FuncGraphPtr
&
func_graph
)
{
MS_LOG
(
INFO
)
<<
"PServer starts connecting to scheduler and workers..."
;
::
ps
::
Start
(
0
);
MS_LOG
(
INFO
)
<<
"PServer connected successfully."
;
if
(
!::
ps
::
IsServer
())
{
std
::
cout
<<
"This is not ther Server"
<<
std
::
endl
;
return
;
...
...
@@ -744,7 +746,9 @@ void ParameterServer<T>::Run(const FuncGraphPtr &func_graph) {
Init
(
func_graph
);
PSContext
::
instance
()
->
SetPSRankId
(
rank_id_
);
thread_
->
join
();
MS_LOG
(
INFO
)
<<
"PServer finished updating models, starts finalizing..."
;
::
ps
::
Finalize
(
0
,
true
);
MS_LOG
(
INFO
)
<<
"PServer finalized successfully."
;
}
}
// namespace ps
}
// namespace parallel
...
...
mindspore/ccsrc/frontend/parallel/ps/worker.h
浏览文件 @
70029395
...
...
@@ -86,7 +86,9 @@ void Worker<T>::Run() {
MS_LOG
(
INFO
)
<<
"'Worker is already running."
;
return
;
}
MS_LOG
(
INFO
)
<<
"Worker starts connecting to scheduler and server..."
;
::
ps
::
Start
(
0
);
MS_LOG
(
INFO
)
<<
"Worker connected successfully."
;
if
(
!::
ps
::
IsWorker
())
{
MS_LOG
(
EXCEPTION
)
<<
"The role is not worker."
;
}
...
...
@@ -176,9 +178,11 @@ void Worker<T>::DoPSEmbeddingLookup(const ::ps::SArray<::ps::Key> &keys, const :
template
<
typename
T
>
void
Worker
<
T
>::
Finalize
()
{
if
(
running_
)
{
MS_LOG
(
INFO
)
<<
"Worker starts finalizing..."
;
kv_worker_
->
Finalize
();
kv_worker_
.
reset
();
running_
=
false
;
MS_LOG
(
INFO
)
<<
"Worker finalized successfully."
;
}
}
...
...
@@ -315,7 +319,7 @@ void Worker<T>::InitPSParamAndOptim(const std::string ¶m_name, tensor::Tenso
size_t
param_key
=
GetParamKey
(
param_name
);
if
(
param_key
==
kInvalidKey
)
{
MS_LOG
(
INFO
)
<<
"Parameter "
<<
param_name
<<
" has no key assigned."
;
MS_LOG
(
DEBUG
)
<<
"Parameter "
<<
param_name
<<
" has no key assigned."
;
return
;
}
bool
init_in_server
=
false
;
...
...
model_zoo/official/recommend/wide_and_deep/src/callbacks.py
浏览文件 @
70029395
...
...
@@ -36,6 +36,7 @@ class LossCallBack(Callback):
Note:
If per_print_times is 0, do NOT print loss.
If this process is MS_PSERVER role, do not run callbacks.
Args:
per_print_times (int): Print loss every times. Default: 1.
...
...
@@ -50,6 +51,8 @@ class LossCallBack(Callback):
def
step_end
(
self
,
run_context
):
"""Monitor the loss in training."""
cb_params
=
run_context
.
original_args
()
if
cb_params
.
net_outputs
is
None
:
return
wide_loss
,
deep_loss
=
cb_params
.
net_outputs
[
0
].
asnumpy
(),
cb_params
.
net_outputs
[
1
].
asnumpy
()
cur_step_in_epoch
=
(
cb_params
.
cur_step_num
-
1
)
%
cb_params
.
batch_num
+
1
cur_num
=
cb_params
.
cur_step_num
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录