Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
提交
4547bf9c
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,体验更适合开发者的 AI 搜索 >>
提交
4547bf9c
编写于
4月 19, 2017
作者:
W
willzhang4a58
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refine int64
上级
9343dc71
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
40 addition
and
38 deletion
+40
-38
oneflow/common/shape.proto
oneflow/common/shape.proto
+1
-1
oneflow/graph/comp_task_node.h
oneflow/graph/comp_task_node.h
+3
-3
oneflow/graph/model_update_task_graph.cpp
oneflow/graph/model_update_task_graph.cpp
+4
-4
oneflow/graph/model_update_task_graph.h
oneflow/graph/model_update_task_graph.h
+2
-2
oneflow/graph/register_desc.h
oneflow/graph/register_desc.h
+1
-1
oneflow/graph/register_desc.proto
oneflow/graph/register_desc.proto
+1
-1
oneflow/graph/stage_graph.cpp
oneflow/graph/stage_graph.cpp
+2
-2
oneflow/graph/stage_graph.h
oneflow/graph/stage_graph.h
+4
-4
oneflow/graph/task_graph.cpp
oneflow/graph/task_graph.cpp
+5
-5
oneflow/graph/task_node.cpp
oneflow/graph/task_node.cpp
+1
-1
oneflow/graph/task_node.h
oneflow/graph/task_node.h
+3
-3
oneflow/job/ofelf.proto
oneflow/job/ofelf.proto
+3
-1
oneflow/job/parallel_desc.h
oneflow/job/parallel_desc.h
+4
-4
oneflow/job/resource.proto
oneflow/job/resource.proto
+1
-1
oneflow/operator/op_conf.proto
oneflow/operator/op_conf.proto
+5
-5
未找到文件。
oneflow/common/shape.proto
浏览文件 @
4547bf9c
...
...
@@ -2,5 +2,5 @@ syntax = "proto3";
package
oneflow
;
message
ShapeProto
{
repeated
u
int64
shapes
=
1
;
repeated
int64
shapes
=
1
;
}
oneflow/graph/comp_task_node.h
浏览文件 @
4547bf9c
...
...
@@ -12,8 +12,8 @@ class CompTaskNode : public TaskNode {
CompTaskNode
()
=
default
;
virtual
~
CompTaskNode
()
=
default
;
int64_t
parallel_id
()
const
{
return
parallel_id_
;
}
void
set_parallel_id
(
int64_t
parallel_id
)
{
parallel_id_
=
parallel_id
;
}
u
int64_t
parallel_id
()
const
{
return
parallel_id_
;
}
void
set_parallel_id
(
u
int64_t
parallel_id
)
{
parallel_id_
=
parallel_id
;
}
bool
IsLossNode
()
const
{
TODO
();
}
...
...
@@ -52,7 +52,7 @@ class CompTaskNode : public TaskNode {
const
HashMap
<
ExecEdge
*
,
const
ExecEdge
*>&
bp_edge2fw_edge
);
void
BpSetModelDiffRegst
();
int64_t
parallel_id_
;
u
int64_t
parallel_id_
;
};
...
...
oneflow/graph/model_update_task_graph.cpp
浏览文件 @
4547bf9c
...
...
@@ -7,7 +7,7 @@ MdUpdtTaskGraph::MdUpdtTaskGraph(
const
ChainNode
*
data_chain
,
const
std
::
vector
<
CompTaskNode
*>&
sorted_bp_comptasks4data_chain
)
{
BuildTaskGraph
(
data_chain
);
HashMap
<
int64_t
,
CompTaskNode
*>
parallel_id2updt
;
HashMap
<
u
int64_t
,
CompTaskNode
*>
parallel_id2updt
;
InitFaker2MccoyAndParallelId2UpdtMap
(
sorted_bp_comptasks4data_chain
,
&
parallel_id2updt
);
BuildExecAndProducedRegsts
();
...
...
@@ -42,7 +42,7 @@ void MdUpdtTaskGraph::BuildTaskGraph(const ChainNode* data_chain) {
void
MdUpdtTaskGraph
::
InitFaker2MccoyAndParallelId2UpdtMap
(
const
std
::
vector
<
CompTaskNode
*>&
sorted_bp_comptasks4data_chain
,
HashMap
<
int64_t
,
CompTaskNode
*>*
parallel_id2updt
)
{
HashMap
<
u
int64_t
,
CompTaskNode
*>*
parallel_id2updt
)
{
std
::
vector
<
CompTaskNode
*>
comptasks4faker_chain
;
for
(
const
std
::
unique_ptr
<
TaskNode
>&
node
:
nodes
())
{
CompTaskNode
*
comp_node
=
dynamic_cast
<
CompTaskNode
*>
(
node
.
get
());
...
...
@@ -63,10 +63,10 @@ void MdUpdtTaskGraph::InitFaker2MccoyAndParallelId2UpdtMap(
void
MdUpdtTaskGraph
::
CompleteUpdateTaskAndFwTask
(
const
std
::
vector
<
CompTaskNode
*>&
sorted_bp_comptasks4data_chain
,
const
HashMap
<
int64_t
,
CompTaskNode
*>&
parallel_id2updt
)
{
const
HashMap
<
u
int64_t
,
CompTaskNode
*>&
parallel_id2updt
)
{
for
(
CompTaskNode
*
bp_task
:
sorted_bp_comptasks4data_chain
)
{
// useful vars
int64_t
parallel_id
=
bp_task
->
parallel_id
();
u
int64_t
parallel_id
=
bp_task
->
parallel_id
();
CompTaskNode
*
update_task
=
parallel_id2updt
.
at
(
parallel_id
);
TaskNode
*
fw_task
=
bp_task
->
GetFwNode
();
RegstDesc
*
model_diff_regst
=
bp_task
->
GetProducedRegstDesc
(
"model_diff"
);
...
...
oneflow/graph/model_update_task_graph.h
浏览文件 @
4547bf9c
...
...
@@ -23,10 +23,10 @@ class MdUpdtTaskGraph final : public TaskGraph {
void
BuildTaskGraph
(
const
ChainNode
*
data_chain
);
void
InitFaker2MccoyAndParallelId2UpdtMap
(
const
std
::
vector
<
CompTaskNode
*>&
sorted_bp_comptasks4data_chain
,
HashMap
<
int64_t
,
CompTaskNode
*>*
parallel_id2updt
);
HashMap
<
u
int64_t
,
CompTaskNode
*>*
parallel_id2updt
);
void
CompleteUpdateTaskAndFwTask
(
const
std
::
vector
<
CompTaskNode
*>&
sorted_bp_comptasks4data_chain
,
const
HashMap
<
int64_t
,
CompTaskNode
*>&
parallel_id2updt
);
const
HashMap
<
u
int64_t
,
CompTaskNode
*>&
parallel_id2updt
);
};
}
// namespace oneflow
...
...
oneflow/graph/register_desc.h
浏览文件 @
4547bf9c
...
...
@@ -30,7 +30,7 @@ class RegstDesc {
static
const
char
*
kAllLbn
;
private:
int64_t
regst_desc_id_
;
u
int64_t
regst_desc_id_
;
const
TaskNode
*
producer_
;
HashMap
<
std
::
string
,
std
::
unique_ptr
<
Shape
>>
lbn2shape_
;
...
...
oneflow/graph/register_desc.proto
浏览文件 @
4547bf9c
...
...
@@ -8,5 +8,5 @@ message RegstDescProto {
uint64
producer_task_id
=
2
;
repeated
uint64
subscriber_task_ids
=
3
;
map
<
string
,
ShapeProto
>
lbn2shape
=
4
;
u
int64
register_num
=
5
;
int64
register_num
=
5
;
}
oneflow/graph/stage_graph.cpp
浏览文件 @
4547bf9c
...
...
@@ -10,8 +10,8 @@ StageGraph::StageGraph(std::unique_ptr<const ChainGraph>&& chain_gph) {
for
(
const
std
::
unique_ptr
<
ChainNode
>&
cur_chain
:
chain_gph_
->
nodes
())
{
chain2stages
[
cur_chain
.
get
()]
=
{};
auto
parallel_desc
=
cur_chain
->
parallel_desc
();
int64_t
range_idx
=
0
;
for
(
int64_t
machine_id
:
parallel_desc
->
sorted_machine_ids
())
{
u
int64_t
range_idx
=
0
;
for
(
u
int64_t
machine_id
:
parallel_desc
->
sorted_machine_ids
())
{
StageNode
*
stage_node
=
NewFinalNode
();
stage_node
->
mut_machine_id
()
=
machine_id
;
stage_node
->
set_chain_node
(
cur_chain
.
get
());
...
...
oneflow/graph/stage_graph.h
浏览文件 @
4547bf9c
...
...
@@ -14,10 +14,10 @@ class StageNode final : public Node<StageNode, StageEdge> {
StageNode
()
=
default
;
~
StageNode
()
=
default
;
const
int64_t
&
machine_id
()
const
{
const
u
int64_t
&
machine_id
()
const
{
return
machine_id_
;
}
int64_t
&
mut_machine_id
()
{
u
int64_t
&
mut_machine_id
()
{
return
machine_id_
;
}
...
...
@@ -35,13 +35,13 @@ class StageNode final : public Node<StageNode, StageEdge> {
return
parallel_range_
;
}
const
std
::
vector
<
int64_t
>&
SortedDevicePhyIds
()
const
{
const
std
::
vector
<
u
int64_t
>&
SortedDevicePhyIds
()
const
{
return
chain_node_
->
parallel_desc
()
->
sorted_device_phy_ids
(
machine_id_
);
}
private:
const
ChainNode
*
chain_node_
;
int64_t
machine_id_
;
u
int64_t
machine_id_
;
Range
parallel_range_
;
};
...
...
oneflow/graph/task_graph.cpp
浏览文件 @
4547bf9c
...
...
@@ -73,9 +73,9 @@ void TaskGraph::Stage2DeviceCompTaskNodes(
TaskNodesInStage
*
task_nodes_in_stage
,
bool
is_first_stage
,
bool
is_last_stage
)
{
int64_t
parallel_idx
=
stage
->
parallel_range
().
begin
();
u
int64_t
parallel_idx
=
stage
->
parallel_range
().
begin
();
for
(
auto
device_phy_id
:
stage
->
SortedDevicePhyIds
())
{
int64_t
thread_local_id
=
u
int64_t
thread_local_id
=
IDMgr
::
Singleton
().
ThrdLocId4DevicePhyId
(
device_phy_id
);
// comp_task_node
DeviceCompTaskNode
*
comp_task_node
=
NewTaskNode
<
DeviceCompTaskNode
>
();
...
...
@@ -113,9 +113,9 @@ void TaskGraph::Stage2DeviceCompTaskNodes(
void
TaskGraph
::
Stage2HostCompTaskNodes
(
const
StageNode
*
stage
,
TaskNodesInStage
*
task_nodes_in_stage
)
{
int64_t
parallel_begin
=
stage
->
parallel_range
().
begin
();
int64_t
parallel_end
=
stage
->
parallel_range
().
end
();
int64_t
parallel_idx
=
parallel_begin
;
u
int64_t
parallel_begin
=
stage
->
parallel_range
().
begin
();
u
int64_t
parallel_end
=
stage
->
parallel_range
().
end
();
u
int64_t
parallel_idx
=
parallel_begin
;
while
(
parallel_idx
<
parallel_end
)
{
HostCompTaskNode
*
comp_task_node
=
NewTaskNode
<
HostCompTaskNode
>
();
comp_task_node
->
set_stage_node
(
stage
);
...
...
oneflow/graph/task_node.cpp
浏览文件 @
4547bf9c
...
...
@@ -20,7 +20,7 @@ void TaskNode::set_stage_node(const StageNode* new_stage_node) {
CHECK
(
IsFwNode
());
stage_node_
=
new_stage_node
;
}
int64_t
&
TaskNode
::
mut_thrd_loc_id
()
{
u
int64_t
&
TaskNode
::
mut_thrd_loc_id
()
{
CHECK
(
IsFwNode
());
return
thrd_loc_id_
;
}
...
...
oneflow/graph/task_node.h
浏览文件 @
4547bf9c
...
...
@@ -23,13 +23,13 @@ class TaskNode : public Node<TaskNode, TaskEdge> {
TaskNode
*
GetBpNode
()
const
;
const
ChainNode
*
chain_node
()
const
{
return
stage_node_
->
chain_node
();}
const
StageNode
*
stage_node
()
const
{
return
stage_node_
;
}
const
int64_t
&
thrd_loc_id
()
const
{
return
thrd_loc_id_
;
}
const
u
int64_t
&
thrd_loc_id
()
const
{
return
thrd_loc_id_
;
}
const
ExecGraph
&
exec_gph
()
const
{
return
exec_gph_
;
}
// Setters
void
SetFwNode
()
{
is_fw_node_
=
true
;
}
void
set_stage_node
(
const
StageNode
*
);
int64_t
&
mut_thrd_loc_id
();
u
int64_t
&
mut_thrd_loc_id
();
// return bp_node
std
::
unique_ptr
<
TaskNode
>
BuildAndConnectBpNode
();
...
...
@@ -59,7 +59,7 @@ class TaskNode : public Node<TaskNode, TaskEdge> {
private:
// In task_gph level
const
StageNode
*
stage_node_
;
int64_t
thrd_loc_id_
;
u
int64_t
thrd_loc_id_
;
bool
is_fw_node_
;
TaskNode
*
related_fw_or_bp_node_
;
// In task level
...
...
oneflow/job/ofelf.proto
浏览文件 @
4547bf9c
...
...
@@ -4,9 +4,11 @@ package oneflow;
import
"operator/operator.proto"
;
import
"graph/register_desc.proto"
;
import
"task/task.proto"
;
import
"job/id_manager.proto"
;
message
OfElf
{
repeated
TaskProto
tasks
=
1
;
repeated
RegstDescProto
regst_descs
=
2
;
repeated
OperatorProto
operators
=
4
;
repeated
OperatorProto
operators
=
3
;
IDMgrProto
id_mgr
=
4
;
}
oneflow/job/parallel_desc.h
浏览文件 @
4547bf9c
...
...
@@ -18,10 +18,10 @@ class ParallelDesc {
// Getters
const
ParallelPolicy
&
policy
()
const
{
return
policy_
;
}
const
DeviceType
&
device_type
()
const
{
return
device_type_
;
}
const
std
::
vector
<
int64_t
>&
sorted_machine_ids
()
const
{
const
std
::
vector
<
u
int64_t
>&
sorted_machine_ids
()
const
{
return
sorted_machine_ids_
;
}
const
std
::
vector
<
int64_t
>&
sorted_device_phy_ids
(
int64_t
machine_id
)
const
{
const
std
::
vector
<
u
int64_t
>&
sorted_device_phy_ids
(
int64_t
machine_id
)
const
{
// If this is used to describe the disk
// the return shouble be empty
return
machine_id2sorted_device_phy_ids_
.
at
(
machine_id
);
...
...
@@ -39,8 +39,8 @@ class ParallelDesc {
private:
ParallelPolicy
policy_
;
DeviceType
device_type_
;
std
::
vector
<
int64_t
>
sorted_machine_ids_
;
HashMap
<
int64_t
,
std
::
vector
<
int64_t
>>
machine_id2sorted_device_phy_ids_
;
std
::
vector
<
u
int64_t
>
sorted_machine_ids_
;
HashMap
<
uint64_t
,
std
::
vector
<
u
int64_t
>>
machine_id2sorted_device_phy_ids_
;
};
...
...
oneflow/job/resource.proto
浏览文件 @
4547bf9c
...
...
@@ -14,7 +14,7 @@ enum DeviceType {
message
Resource
{
repeated
Machine
machines
=
1
;
u
int64
device_num_per_machine
=
2
;
int64
device_num_per_machine
=
2
;
DeviceType
device_type
=
3
;
}
...
...
oneflow/operator/op_conf.proto
浏览文件 @
4547bf9c
...
...
@@ -47,16 +47,16 @@ message CopyOpConf {
}
message
CloneOpConf
{
u
int64
out_num
=
1
;
int64
out_num
=
1
;
string
lbn
=
2
;
}
message
BoxConcatConf
{
u
int64
axis
=
1
;
int64
axis
=
1
;
}
message
BoxSplitConf
{
u
int64
axis
=
1
;
int64
axis
=
1
;
}
message
BoxCloneConf
{
...
...
@@ -64,8 +64,8 @@ message BoxCloneConf {
message
BoxingOpConf
{
string
lbn
=
1
;
u
int64
in_num
=
2
;
u
int64
out_num
=
3
;
int64
in_num
=
2
;
int64
out_num
=
3
;
BoxConcatConf
concat_box
=
4
;
oneof
out_box
{
BoxSplitConf
split_box
=
5
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录