Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
N
NiuTrans.Tensor
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
8
Issues
8
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
NiuTrans
NiuTrans.Tensor
Commits
c2a40cf0
Commit
c2a40cf0
authored
Mar 23, 2021
by
xiaotong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename AddJobBroadcastSingle as AddJobBroadcast
parent
7950bd3c
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
10 行增加
和
10 行删除
+10
-10
source/train/XLeader.cpp
+1
-1
source/train/XWorkerBroadcast.cpp
+6
-6
source/train/XWorkerBroadcast.h
+3
-3
没有找到文件。
source/train/XLeader.cpp
查看文件 @
c2a40cf0
...
@@ -558,7 +558,7 @@ void XLeader::RunUpdate(XConfig * config, XOptimizer * optimizer, const int * ac
...
@@ -558,7 +558,7 @@ void XLeader::RunUpdate(XConfig * config, XOptimizer * optimizer, const int * ac
updater
->
AddJobEnqueueFinished
(
jobQueue
);
updater
->
AddJobEnqueueFinished
(
jobQueue
);
/* broadcast the new parameter to other models*/
/* broadcast the new parameter to other models*/
broadcaster
->
AddJobBroadcast
Single
(
jobQueue
,
&
serverModel
,
&
membersAll
,
j
);
broadcaster
->
AddJobBroadcast
(
jobQueue
,
&
serverModel
,
&
membersAll
,
j
);
broadcaster
->
AddJobEnqueueFinished
(
jobQueue
);
broadcaster
->
AddJobEnqueueFinished
(
jobQueue
);
}
}
}
}
...
...
source/train/XWorkerBroadcast.cpp
查看文件 @
c2a40cf0
...
@@ -55,7 +55,7 @@ broadcast data for a parameter
...
@@ -55,7 +55,7 @@ broadcast data for a parameter
>> targetList - the target places that we recieve the data
>> targetList - the target places that we recieve the data
>> pid - the parameter index
>> pid - the parameter index
*/
*/
void
XWorkerBroadcast
::
BroadcastData
Single
(
XModel
*
source
,
XList
*
targetList
,
int
pid
)
void
XWorkerBroadcast
::
BroadcastData
(
XModel
*
source
,
XList
*
targetList
,
int
pid
)
{
{
CheckNTErrors
(
source
->
params
[
pid
].
flag
==
PARAM_STATE_UPDATED
,
CheckNTErrors
(
source
->
params
[
pid
].
flag
==
PARAM_STATE_UPDATED
,
"The parameter is not ready for broadcasting"
);
"The parameter is not ready for broadcasting"
);
...
@@ -75,7 +75,7 @@ void XWorkerBroadcast::BroadcastDataSingle(XModel * source, XList * targetList,
...
@@ -75,7 +75,7 @@ void XWorkerBroadcast::BroadcastDataSingle(XModel * source, XList * targetList,
wrapper of BroadcastDataSingle
wrapper of BroadcastDataSingle
>> args - the list of arguments
>> args - the list of arguments
*/
*/
void
XWorkerBroadcast
::
Broadcast
Single
(
XList
*
args
)
void
XWorkerBroadcast
::
Broadcast
(
XList
*
args
)
{
{
int
paramCount
=
0
;
int
paramCount
=
0
;
...
@@ -93,7 +93,7 @@ void XWorkerBroadcast::BroadcastSingle(XList * args)
...
@@ -93,7 +93,7 @@ void XWorkerBroadcast::BroadcastSingle(XList * args)
/* parameter index */
/* parameter index */
int
p
=
args
->
GetInt
(
paramCount
++
);
int
p
=
args
->
GetInt
(
paramCount
++
);
broadcaster
->
BroadcastData
Single
(
source
,
&
target
,
p
);
broadcaster
->
BroadcastData
(
source
,
&
target
,
p
);
}
}
/*
/*
...
@@ -118,7 +118,7 @@ add a new job of broadcasting data (for a parameter)
...
@@ -118,7 +118,7 @@ add a new job of broadcasting data (for a parameter)
>> targetList - the target places that we recieve the data
>> targetList - the target places that we recieve the data
>> pid - the parameter index
>> pid - the parameter index
*/
*/
bool
XWorkerBroadcast
::
AddJobBroadcast
Single
(
XQueue
*
jobQueue
,
XModel
*
source
,
XList
*
targetList
,
int
pid
)
bool
XWorkerBroadcast
::
AddJobBroadcast
(
XQueue
*
jobQueue
,
XModel
*
source
,
XList
*
targetList
,
int
pid
)
{
{
CheckNTErrors
(
source
!=
NULL
,
"no input source tensor!"
);
CheckNTErrors
(
source
!=
NULL
,
"no input source tensor!"
);
CheckNTErrors
(
targetList
!=
NULL
,
"no input target tensor list!"
);
CheckNTErrors
(
targetList
!=
NULL
,
"no input target tensor list!"
);
...
@@ -134,9 +134,9 @@ bool XWorkerBroadcast::AddJobBroadcastSingle(XQueue * jobQueue, XModel * source,
...
@@ -134,9 +134,9 @@ bool XWorkerBroadcast::AddJobBroadcastSingle(XQueue * jobQueue, XModel * source,
XQueue
&
queueRun
=
jobQueue
!=
NULL
?
*
jobQueue
:
queue
;
XQueue
&
queueRun
=
jobQueue
!=
NULL
?
*
jobQueue
:
queue
;
if
(
isInstantRun
)
if
(
isInstantRun
)
XWorkerBroadcast
::
Broadcast
Single
(
&
args
);
XWorkerBroadcast
::
Broadcast
(
&
args
);
else
else
queueRun
.
EnqueueJob
((
void
*
)(
char
*
)
XWorkerBroadcast
::
Broadcast
Single
,
&
args
);
queueRun
.
EnqueueJob
((
void
*
)(
char
*
)
XWorkerBroadcast
::
Broadcast
,
&
args
);
return
true
;
return
true
;
}
}
...
...
source/train/XWorkerBroadcast.h
查看文件 @
c2a40cf0
...
@@ -61,17 +61,17 @@ public:
...
@@ -61,17 +61,17 @@ public:
void
SetBroadcastMode
(
DATA_BROADCAST_TYPE
myMode
);
void
SetBroadcastMode
(
DATA_BROADCAST_TYPE
myMode
);
/* broadcast data for a parameter */
/* broadcast data for a parameter */
void
BroadcastData
Single
(
XModel
*
source
,
XList
*
targetList
,
int
pid
);
void
BroadcastData
(
XModel
*
source
,
XList
*
targetList
,
int
pid
);
/* wrapper of BroadcastDataSingle */
/* wrapper of BroadcastDataSingle */
static
static
void
Broadcast
Single
(
XList
*
args
);
void
Broadcast
(
XList
*
args
);
/* P2P data broadcasting */
/* P2P data broadcasting */
void
BroadcastP2P
(
XTensor
*
source
,
XTensor
*
target
);
void
BroadcastP2P
(
XTensor
*
source
,
XTensor
*
target
);
/* add a new job of broadcasting data (for a parameter) */
/* add a new job of broadcasting data (for a parameter) */
bool
AddJobBroadcast
Single
(
XQueue
*
jobQueue
,
XModel
*
source
,
XList
*
targetList
,
int
pid
);
bool
AddJobBroadcast
(
XQueue
*
jobQueue
,
XModel
*
source
,
XList
*
targetList
,
int
pid
);
};
};
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论