Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
提交
c7a2b1d7
O
oneflow
项目概览
Oneflow-Inc
/
oneflow
上一次同步 接近 3 年
通知
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,发现更多精彩内容 >>
提交
c7a2b1d7
编写于
1月 08, 2018
作者:
W
willzhang4a58
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
nonrecurrent->normal
上级
0833ce24
变更
11
显示空白变更内容
内联
并排
Showing
11 changed file
with
56 addition
and
37 deletion
+56
-37
oneflow/core/actor/backward_compute_actor.cpp
oneflow/core/actor/backward_compute_actor.cpp
+1
-1
oneflow/core/actor/forward_compute_actor.cpp
oneflow/core/actor/forward_compute_actor.cpp
+1
-1
oneflow/core/comm_network/rdma/connection.h
oneflow/core/comm_network/rdma/connection.h
+3
-3
oneflow/core/graph/chain_node.cpp
oneflow/core/graph/chain_node.cpp
+4
-4
oneflow/core/graph/normal_backward_compute_task_node.cpp
oneflow/core/graph/normal_backward_compute_task_node.cpp
+5
-6
oneflow/core/graph/normal_backward_compute_task_node.h
oneflow/core/graph/normal_backward_compute_task_node.h
+8
-10
oneflow/core/graph/normal_forward_compute_task_node.cpp
oneflow/core/graph/normal_forward_compute_task_node.cpp
+4
-4
oneflow/core/graph/normal_forward_compute_task_node.h
oneflow/core/graph/normal_forward_compute_task_node.h
+24
-0
oneflow/core/graph/task_node.cpp
oneflow/core/graph/task_node.cpp
+2
-4
oneflow/core/job/compiler.cpp
oneflow/core/job/compiler.cpp
+2
-2
oneflow/core/job/task.proto
oneflow/core/job/task.proto
+2
-2
未找到文件。
oneflow/core/actor/backward_compute_actor.cpp
浏览文件 @
c7a2b1d7
...
...
@@ -124,6 +124,6 @@ void BackwardCompActor::Act() {
}
}
REGISTER_ACTOR
(
TaskType
::
kNo
nRecurrent
Backward
,
BackwardCompActor
);
REGISTER_ACTOR
(
TaskType
::
kNo
rmal
Backward
,
BackwardCompActor
);
}
// namespace oneflow
oneflow/core/actor/forward_compute_actor.cpp
浏览文件 @
c7a2b1d7
...
...
@@ -150,7 +150,7 @@ void ForwardCompActor::TryAsyncReturnModelTmpRegst() {
}
}
REGISTER_ACTOR
(
TaskType
::
kNo
nRecurrent
Forward
,
ForwardCompActor
);
REGISTER_ACTOR
(
TaskType
::
kNo
rmal
Forward
,
ForwardCompActor
);
REGISTER_ACTOR
(
TaskType
::
kLoss
,
ForwardCompActor
);
}
// namespace oneflow
oneflow/core/comm_network/rdma/connection.h
浏览文件 @
c7a2b1d7
#ifndef ONEFLOW_CORE_COMM_NETWORK_RDMA_CONNECTION_H
#define ONEFLOW_CORE_COMM_NETWORK_RDMA_CONNECTION_H
#ifndef ONEFLOW_CORE_COMM_NETWORK_RDMA_CONNECTION_H
_
#define ONEFLOW_CORE_COMM_NETWORK_RDMA_CONNECTION_H
_
#ifdef WITH_RDMA
...
...
@@ -49,4 +49,4 @@ class Connection {
#endif // WITH_RDMA
#endif // ONEFLOW_CORE_COMM_NETWORK_RDMA_CONNECTION_H
#endif // ONEFLOW_CORE_COMM_NETWORK_RDMA_CONNECTION_H
_
oneflow/core/graph/chain_node.cpp
浏览文件 @
c7a2b1d7
#include "oneflow/core/graph/chain_node.h"
#include "oneflow/core/graph/recurrent_backward_compute_task_node.h"
#include "oneflow/core/graph/no
nrecurrent
_backward_compute_task_node.h"
#include "oneflow/core/graph/no
rmal
_backward_compute_task_node.h"
#include "oneflow/core/graph/recurrent_forward_compute_task_node.h"
#include "oneflow/core/graph/no
nrecurrent
_forward_compute_task_node.h"
#include "oneflow/core/graph/no
rmal
_forward_compute_task_node.h"
#include "oneflow/core/graph/loss_accumulate_compute_task_node.h"
#include "oneflow/core/graph/loss_compute_task_node.h"
#include "oneflow/core/graph/loss_print_compute_task_node.h"
...
...
@@ -230,7 +230,7 @@ CompTaskNode* ForwardChainNode::NewCompTaskNode() const {
if
(
HasSoleRecurrentOp
())
{
return
new
RecurrentForwardCompTaskNode
;
}
else
{
return
new
No
nRecurrent
ForwardCompTaskNode
;
return
new
No
rmal
ForwardCompTaskNode
;
}
}
...
...
@@ -290,7 +290,7 @@ CompTaskNode* BackwardChainNode::NewCompTaskNode() const {
if
(
HasSoleRecurrentOp
())
{
return
new
RecurrentBackwardCompTaskNode
;
}
else
{
return
new
No
nRecurrent
BackwardCompTaskNode
;
return
new
No
rmal
BackwardCompTaskNode
;
}
}
...
...
oneflow/core/graph/no
nrecurrent
_backward_compute_task_node.cpp
→
oneflow/core/graph/no
rmal
_backward_compute_task_node.cpp
浏览文件 @
c7a2b1d7
#include "oneflow/core/graph/no
nrecurrent
_backward_compute_task_node.h"
#include "oneflow/core/graph/no
rmal
_backward_compute_task_node.h"
#include "oneflow/core/graph/chain_node.h"
namespace
oneflow
{
void
NonRecurrentBackwardCompTaskNode
::
VirtualBuildExecGphAndBindOutDiffRegst
()
{
void
NormalBackwardCompTaskNode
::
VirtualBuildExecGphAndBindOutDiffRegst
()
{
HashMap
<
std
::
string
,
std
::
pair
<
ExecNode
*
,
std
::
string
>>
lbn2producer
;
for
(
std
::
shared_ptr
<
const
Operator
>
op
:
chain_node
()
->
op_vec
())
{
ExecNode
*
cur_node
=
mut_exec_gph
().
NewNode
();
...
...
@@ -34,7 +33,7 @@ void NonRecurrentBackwardCompTaskNode::
});
}
void
No
nRecurrent
BackwardCompTaskNode
::
VirtualBuildActivationDiffRegst
()
{
void
No
rmal
BackwardCompTaskNode
::
VirtualBuildActivationDiffRegst
()
{
std
::
shared_ptr
<
RegstDesc
>
activation_regst
=
GetConsumedRegst
(
"activation"
);
auto
activation_diff_regst
=
GetProducedRegst
(
"activation_diff"
);
mut_exec_gph
().
ForEachEdge
([
&
](
ExecEdge
*
edge
)
{
...
...
@@ -57,7 +56,7 @@ void NonRecurrentBackwardCompTaskNode::VirtualBuildActivationDiffRegst() {
});
}
void
No
nRecurrent
BackwardCompTaskNode
::
VirtualBuildInDiffRegst
()
{
void
No
rmal
BackwardCompTaskNode
::
VirtualBuildInDiffRegst
()
{
std
::
shared_ptr
<
RegstDesc
>
in_diff_regst
=
GetProducedRegst
(
"in_diff"
);
std
::
shared_ptr
<
RegstDesc
>
in_regst
=
GetConsumedRegst
(
"in"
);
mut_exec_gph
().
ForEachNode
([
&
](
ExecNode
*
cur_node
)
{
...
...
@@ -77,7 +76,7 @@ void NonRecurrentBackwardCompTaskNode::VirtualBuildInDiffRegst() {
});
}
void
No
nRecurrent
BackwardCompTaskNode
::
VirtualConsumeInRegst
()
{
void
No
rmal
BackwardCompTaskNode
::
VirtualConsumeInRegst
()
{
TaskNode
*
fw_node
=
GetRelatedFwTaskNode
();
for
(
TaskEdge
*
edge
:
fw_node
->
in_edges
())
{
TaskNode
*
pred_fw_node
=
edge
->
src_node
();
...
...
oneflow/core/graph/no
nrecurrent
_backward_compute_task_node.h
→
oneflow/core/graph/no
rmal
_backward_compute_task_node.h
浏览文件 @
c7a2b1d7
#ifndef ONEFLOW_CORE_GRAPH_NO
NRECURRENT
_BACKWARD_COMPUTE_TASK_NODE_H_
#define ONEFLOW_CORE_GRAPH_NO
NRECURRENT
_BACKWARD_COMPUTE_TASK_NODE_H_
#ifndef ONEFLOW_CORE_GRAPH_NO
RMAL
_BACKWARD_COMPUTE_TASK_NODE_H_
#define ONEFLOW_CORE_GRAPH_NO
RMAL
_BACKWARD_COMPUTE_TASK_NODE_H_
#include "oneflow/core/graph/backward_compute_task_node.h"
namespace
oneflow
{
class
No
nRecurrent
BackwardCompTaskNode
final
:
public
BackwardCompTaskNode
{
class
No
rmal
BackwardCompTaskNode
final
:
public
BackwardCompTaskNode
{
public:
OF_DISALLOW_COPY_AND_MOVE
(
No
nRecurrent
BackwardCompTaskNode
);
No
nRecurrent
BackwardCompTaskNode
()
=
default
;
~
No
nRecurrent
BackwardCompTaskNode
()
=
default
;
OF_DISALLOW_COPY_AND_MOVE
(
No
rmal
BackwardCompTaskNode
);
No
rmal
BackwardCompTaskNode
()
=
default
;
~
No
rmal
BackwardCompTaskNode
()
=
default
;
TaskType
GetTaskType
()
const
override
{
return
TaskType
::
kNonRecurrentBackward
;
}
TaskType
GetTaskType
()
const
override
{
return
TaskType
::
kNormalBackward
;
}
private:
void
VirtualBuildExecGphAndBindOutDiffRegst
()
override
;
...
...
@@ -38,4 +36,4 @@ class NonRecurrentBackwardCompTaskNode final : public BackwardCompTaskNode {
}
// namespace oneflow
#endif // ONEFLOW_CORE_GRAPH_NO
NRECURRENT
_BACKWARD_COMPUTE_TASK_NODE_H_
#endif // ONEFLOW_CORE_GRAPH_NO
RMAL
_BACKWARD_COMPUTE_TASK_NODE_H_
oneflow/core/graph/no
nrecurrent
_forward_compute_task_node.cpp
→
oneflow/core/graph/no
rmal
_forward_compute_task_node.cpp
浏览文件 @
c7a2b1d7
#include "oneflow/core/graph/forward_compute_task_node.h"
#include "oneflow/core/graph/no
nrecurrent
_forward_compute_task_node.h"
#include "oneflow/core/graph/no
rmal
_forward_compute_task_node.h"
#include "oneflow/core/graph/chain_node.h"
namespace
oneflow
{
void
No
nRecurrent
ForwardCompTaskNode
::
VirtualConsumeInRegst
(
TaskEdge
*
edge
)
{
void
No
rmal
ForwardCompTaskNode
::
VirtualConsumeInRegst
(
TaskEdge
*
edge
)
{
ConsumeRegst
(
"in"
,
edge
->
GetSoleRegst
());
}
void
No
nRecurrent
ForwardCompTaskNode
::
BuildExecGphStructAndBindInRegst
()
{
void
No
rmal
ForwardCompTaskNode
::
BuildExecGphStructAndBindInRegst
()
{
HashMap
<
std
::
string
,
std
::
pair
<
ExecNode
*
,
std
::
string
>>
lbn2producer
;
for
(
std
::
shared_ptr
<
const
Operator
>
op
:
chain_node
()
->
op_vec
())
{
ExecNode
*
cur_node
=
mut_exec_gph
().
NewNode
();
...
...
@@ -36,7 +36,7 @@ void NonRecurrentForwardCompTaskNode::BuildExecGphStructAndBindInRegst() {
});
}
bool
No
nRecurrent
ForwardCompTaskNode
::
IsReadyForBuild
()
{
bool
No
rmal
ForwardCompTaskNode
::
IsReadyForBuild
()
{
return
GetConsumedRegst
(
"in"
)
->
IsLocked
();
}
...
...
oneflow/core/graph/no
nrecurrent
_forward_compute_task_node.h
→
oneflow/core/graph/no
rmal
_forward_compute_task_node.h
浏览文件 @
c7a2b1d7
#ifndef ONEFLOW_CORE_GRAPH_NO
NRECURRENT
_FORWARD_COMPUTE_TASK_NODE_H_
#define ONEFLOW_CORE_GRAPH_NO
NRECURRENT
_FORWARD_COMPUTE_TASK_NODE_H_
#ifndef ONEFLOW_CORE_GRAPH_NO
RMAL
_FORWARD_COMPUTE_TASK_NODE_H_
#define ONEFLOW_CORE_GRAPH_NO
RMAL
_FORWARD_COMPUTE_TASK_NODE_H_
#include "oneflow/core/graph/forward_compute_task_node.h"
namespace
oneflow
{
class
No
nRecurrent
ForwardCompTaskNode
final
:
public
ForwardCompTaskNode
{
class
No
rmal
ForwardCompTaskNode
final
:
public
ForwardCompTaskNode
{
public:
OF_DISALLOW_COPY_AND_MOVE
(
No
nRecurrent
ForwardCompTaskNode
);
No
nRecurrent
ForwardCompTaskNode
()
=
default
;
~
No
nRecurrent
ForwardCompTaskNode
()
=
default
;
OF_DISALLOW_COPY_AND_MOVE
(
No
rmal
ForwardCompTaskNode
);
No
rmal
ForwardCompTaskNode
()
=
default
;
~
No
rmal
ForwardCompTaskNode
()
=
default
;
TaskType
GetTaskType
()
const
override
{
return
TaskType
::
kNonRecurrentForward
;
}
TaskType
GetTaskType
()
const
override
{
return
TaskType
::
kNormalForward
;
}
bool
IsReadyForBuild
()
override
;
private:
...
...
@@ -23,4 +21,4 @@ class NonRecurrentForwardCompTaskNode final : public ForwardCompTaskNode {
}
// namespace oneflow
#endif // ONEFLOW_CORE_GRAPH_NO
NRECURRENT
_FORWARD_COMPUTE_TASK_NODE_H_
#endif // ONEFLOW_CORE_GRAPH_NO
RMAL
_FORWARD_COMPUTE_TASK_NODE_H_
oneflow/core/graph/task_node.cpp
浏览文件 @
c7a2b1d7
...
...
@@ -3,13 +3,11 @@
namespace
oneflow
{
bool
IsForwardTaskType
(
TaskType
tt
)
{
return
tt
==
TaskType
::
kNonRecurrentForward
||
tt
==
TaskType
::
kRecurrentForward
;
return
tt
==
TaskType
::
kNormalForward
||
tt
==
TaskType
::
kRecurrentForward
;
}
bool
IsBackwardTaskType
(
TaskType
tt
)
{
return
tt
==
TaskType
::
kNonRecurrentBackward
||
tt
==
TaskType
::
kRecurrentBackward
;
return
tt
==
TaskType
::
kNormalBackward
||
tt
==
TaskType
::
kRecurrentBackward
;
}
TaskNode
::
TaskNode
()
:
machine_id_
(
-
1
),
thrd_id_
(
-
1
),
task_id_
(
-
1
)
{}
...
...
oneflow/core/job/compiler.cpp
浏览文件 @
c7a2b1d7
...
...
@@ -6,9 +6,9 @@ namespace {
std
::
map
<
TaskType
,
std
::
string
>
task_type2color
=
{
{
kInvalid
,
"0"
},
{
kNo
nRecurrent
Forward
,
"2"
},
{
kNo
rmal
Forward
,
"2"
},
{
kRecurrentForward
,
"2"
},
{
kNo
nRecurrent
Backward
,
"3"
},
{
kNo
rmal
Backward
,
"3"
},
{
kRecurrentBackward
,
"3"
},
{
kSource
,
"1"
},
{
kLoss
,
"4"
},
...
...
oneflow/core/job/task.proto
浏览文件 @
c7a2b1d7
...
...
@@ -7,9 +7,9 @@ import "oneflow/core/job/placement.proto";
enum
TaskType
{
kInvalid
=
0
;
kNo
nRecurrent
Forward
=
1
;
kNo
rmal
Forward
=
1
;
kRecurrentForward
=
2
;
kNo
nRecurrent
Backward
=
3
;
kNo
rmal
Backward
=
3
;
kRecurrentBackward
=
4
;
kSource
=
5
;
kLoss
=
6
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录