Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
提交
3654d164
O
oneflow
项目概览
Oneflow-Inc
/
oneflow
上一次同步 2 年多
通知
13
Star
2733
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oneflow
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
3654d164
编写于
8月 19, 2018
作者:
J
Jinhui Yuan
提交者:
GitHub
8月 19, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix wrong ActNum of ctrl regst produced by AccCompActor (#1136)
上级
5be84c50
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
17 addition
and
7 deletion
+17
-7
oneflow/core/actor/accumulate_compute_actor.cpp
oneflow/core/actor/accumulate_compute_actor.cpp
+3
-1
oneflow/core/actor/accumulate_compute_actor.h
oneflow/core/actor/accumulate_compute_actor.h
+1
-1
oneflow/core/actor/actor.cpp
oneflow/core/actor/actor.cpp
+7
-2
oneflow/core/actor/actor.h
oneflow/core/actor/actor.h
+2
-1
oneflow/core/actor/input_wise_compute_actor.cpp
oneflow/core/actor/input_wise_compute_actor.cpp
+3
-1
oneflow/core/actor/input_wise_compute_actor.h
oneflow/core/actor/input_wise_compute_actor.h
+1
-1
未找到文件。
oneflow/core/actor/accumulate_compute_actor.cpp
浏览文件 @
3654d164
...
...
@@ -25,7 +25,9 @@ void AccumulateCompActor::Init(const TaskProto& task_proto, int32_t max_acc_cnt,
next_piece_id_
=
0
;
}
int64_t
AccumulateCompActor
::
ActNumForEachOutput
()
const
{
return
max_acc_cnt_
;
}
int64_t
AccumulateCompActor
::
ActNumForEachOutput
(
int64_t
regst_desc_id
)
const
{
return
regst_desc_id
==
GetSoleProducedDataRegstDescId
()
?
max_acc_cnt_
:
1
;
}
void
AccumulateCompActor
::
Act
()
{
Regst
*
in_regst
=
GetNaiveSoleCurReadable
();
...
...
oneflow/core/actor/accumulate_compute_actor.h
浏览文件 @
3654d164
...
...
@@ -13,7 +13,7 @@ class AccumulateCompActor : public CompActor {
protected:
void
Init
(
const
TaskProto
&
,
int32_t
max_acc_cnt
,
ColIdOrder
order
);
int64_t
ActNumForEachOutput
()
const
override
;
int64_t
ActNumForEachOutput
(
int64_t
regst_desc_id
)
const
override
;
private:
void
Act
()
override
;
...
...
oneflow/core/actor/actor.cpp
浏览文件 @
3654d164
...
...
@@ -417,6 +417,11 @@ Regst* Actor::GetSoleProducedRegst(int64_t regst_desc_id) {
return
it
->
second
.
front
().
get
();
}
int64_t
Actor
::
GetSoleProducedDataRegstDescId
()
const
{
CHECK_EQ
(
produced_data_regsts_
.
size
(),
1
);
return
produced_data_regsts_
.
begin
()
->
first
;
}
bool
Actor
::
IsReadReady
()
{
return
naive_readable_data_regst_
.
size
()
==
naive_readable_data_regst_cnt_
&&
IsCustomizedReadReady
();
...
...
@@ -443,7 +448,7 @@ int Actor::ProcessWriteableCtrlRegstMsg(const ActorMsg& msg) {
if
(
expected_act_id
>=
0
&&
CheckOutputActId
(
regst
->
regst_desc_id
()))
{
CHECK_EQ
(
regst
->
act_id
(),
expected_act_id
);
}
expected_act_id
=
regst
->
act_id
()
+
ActNumForEachOutput
();
expected_act_id
=
regst
->
act_id
()
+
ActNumForEachOutput
(
regst
->
regst_desc_id
()
);
writeable_it
->
second
.
push_back
(
regst
);
return
0
;
}
...
...
@@ -524,7 +529,7 @@ int Actor::TryUpdtStateAsProducedRegst(Regst* regst) {
if
(
expected_act_id
>=
0
&&
CheckOutputActId
(
regst
->
regst_desc_id
()))
{
CHECK_EQ
(
regst
->
act_id
(),
expected_act_id
);
}
expected_act_id
=
regst
->
act_id
()
+
ActNumForEachOutput
();
expected_act_id
=
regst
->
act_id
()
+
ActNumForEachOutput
(
regst
->
regst_desc_id
()
);
writeable_it
->
second
.
push_back
(
regst
);
return
0
;
}
...
...
oneflow/core/actor/actor.h
浏览文件 @
3654d164
...
...
@@ -85,7 +85,7 @@ class Actor {
virtual
bool
IsCustomizedReadAlwaysUnReadyFromNow
()
{
return
false
;
}
bool
IsWriteReady
();
virtual
void
AsyncReturnAllCustomizedReadableRegst
()
{}
virtual
int64_t
ActNumForEachOutput
()
const
{
return
1
;
}
virtual
int64_t
ActNumForEachOutput
(
int64_t
regst_desc_id
)
const
{
return
1
;
}
virtual
bool
CheckOutputActId
(
int64_t
regst_desc_id
)
const
{
return
true
;
// TODO(jiyuan): figure out the ActNumForEachOutput of the model regsts to MdSave
// area
...
...
@@ -117,6 +117,7 @@ class Actor {
Regst
*
GetNaiveSoleCurReadable
();
Regst
*
GetNaiveFirstCurReadable
();
Regst
*
GetSoleProducedRegst
(
int64_t
regst_desc_id
);
int64_t
GetSoleProducedDataRegstDescId
()
const
;
void
DecreaseActualWriteableProducedDataRegstDescNum
(
int64_t
amount
)
{
actual_writeable_produced_data_regst_desc_num_
-=
amount
;
...
...
oneflow/core/actor/input_wise_compute_actor.cpp
浏览文件 @
3654d164
...
...
@@ -29,7 +29,9 @@ void InputWiseCompActor::Init(const TaskProto& task_proto) {
OF_SET_MSG_HANDLER
(
&
InputWiseCompActor
::
HandlerNormal
);
}
int64_t
InputWiseCompActor
::
ActNumForEachOutput
()
const
{
return
regst_desc_id2in_bn_id_
.
size
();
}
int64_t
InputWiseCompActor
::
ActNumForEachOutput
(
int64_t
regst_desc_id
)
const
{
return
regst_desc_id2in_bn_id_
.
size
();
}
void
InputWiseCompActor
::
NormalProcessCustomizedReadableRegstMsg
(
const
ActorMsg
&
msg
)
{
Regst
*
regst
=
msg
.
regst
();
...
...
oneflow/core/actor/input_wise_compute_actor.h
浏览文件 @
3654d164
...
...
@@ -17,7 +17,7 @@ class InputWiseCompActor : public CompActor {
int64_t
processed_regst_desc_id_cnt
()
const
{
return
processed_regst_desc_id_cnt_
;
}
int64_t
RegstDescNum
()
const
{
return
readable_regsts_
.
size
();
}
int64_t
InBnId4RegstDescId
(
int64_t
id
)
const
{
return
regst_desc_id2in_bn_id_
.
at
(
id
);
}
int64_t
ActNumForEachOutput
()
const
override
;
int64_t
ActNumForEachOutput
(
int64_t
regst_desc_id
)
const
override
;
bool
EnableInplace
()
const
{
return
GetDeviceType
()
==
DeviceType
::
kGPU
&&
Global
<
JobDesc
>::
Get
()
->
enable_mem_sharing
();
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录