Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Oneflow-Inc
oneflow
提交
0a775cbc
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 搜索 >>
提交
0a775cbc
编写于
12月 12, 2017
作者:
W
willzhang4a58
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug: parallel_ctx init
Former-commit-id:
76cc22d3
上级
3ca374c8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
8 deletion
+5
-8
oneflow/core/actor/actor.cpp
oneflow/core/actor/actor.cpp
+3
-0
oneflow/core/actor/actor.h
oneflow/core/actor/actor.h
+2
-1
oneflow/core/actor/compute_actor.h
oneflow/core/actor/compute_actor.h
+0
-7
未找到文件。
oneflow/core/actor/actor.cpp
浏览文件 @
0a775cbc
...
@@ -4,6 +4,9 @@ namespace oneflow {
...
@@ -4,6 +4,9 @@ namespace oneflow {
void
Actor
::
Init
(
const
TaskProto
&
task_proto
,
const
ThreadCtx
&
thread_ctx
)
{
void
Actor
::
Init
(
const
TaskProto
&
task_proto
,
const
ThreadCtx
&
thread_ctx
)
{
actor_id_
=
task_proto
.
task_id
();
actor_id_
=
task_proto
.
task_id
();
if
(
task_proto
.
has_parallel_ctx
())
{
parallel_ctx_
.
reset
(
new
ParallelContext
(
task_proto
.
parallel_ctx
()));
}
for
(
const
ExecNodeProto
&
node
:
task_proto
.
exec_sequence
().
exec_node
())
{
for
(
const
ExecNodeProto
&
node
:
task_proto
.
exec_sequence
().
exec_node
())
{
ExecKernel
ek
;
ExecKernel
ek
;
ek
.
kernel
=
ek
.
kernel
=
...
...
oneflow/core/actor/actor.h
浏览文件 @
0a775cbc
...
@@ -36,7 +36,7 @@ class Actor {
...
@@ -36,7 +36,7 @@ class Actor {
// Util
// Util
Actor
()
=
default
;
Actor
()
=
default
;
virtual
const
ParallelContext
*
parallel_ctx
()
const
{
return
nullptr
;
}
const
ParallelContext
*
parallel_ctx
()
const
{
return
parallel_ctx_
.
get
()
;
}
DeviceType
GetDeviceType
()
const
;
DeviceType
GetDeviceType
()
const
;
virtual
void
VirtualActorInit
(
const
TaskProto
&
)
{}
virtual
void
VirtualActorInit
(
const
TaskProto
&
)
{}
int64_t
RegstDescId4Name
(
const
std
::
string
&
name
)
const
;
int64_t
RegstDescId4Name
(
const
std
::
string
&
name
)
const
;
...
@@ -90,6 +90,7 @@ class Actor {
...
@@ -90,6 +90,7 @@ class Actor {
private:
private:
int64_t
actor_id_
;
int64_t
actor_id_
;
std
::
unique_ptr
<
ParallelContext
>
parallel_ctx_
;
std
::
vector
<
ExecKernel
>
exec_kernel_vec_
;
std
::
vector
<
ExecKernel
>
exec_kernel_vec_
;
HashMap
<
int64_t
,
std
::
vector
<
std
::
unique_ptr
<
Regst
>>>
produced_regsts_
;
HashMap
<
int64_t
,
std
::
vector
<
std
::
unique_ptr
<
Regst
>>>
produced_regsts_
;
HashMap
<
std
::
string
,
int64_t
>
name2regst_desc_id_
;
HashMap
<
std
::
string
,
int64_t
>
name2regst_desc_id_
;
...
...
oneflow/core/actor/compute_actor.h
浏览文件 @
0a775cbc
...
@@ -15,17 +15,10 @@ class CompActor : public Actor {
...
@@ -15,17 +15,10 @@ class CompActor : public Actor {
virtual
void
VirtualCompActorInit
(
const
TaskProto
&
task_proto
)
{}
virtual
void
VirtualCompActorInit
(
const
TaskProto
&
task_proto
)
{}
const
ParallelContext
*
parallel_ctx
()
const
override
{
return
&
parallel_ctx_
;
}
private:
private:
void
VirtualActorInit
(
const
TaskProto
&
task_proto
)
override
{
void
VirtualActorInit
(
const
TaskProto
&
task_proto
)
override
{
parallel_ctx_
=
task_proto
.
parallel_ctx
();
VirtualCompActorInit
(
task_proto
);
VirtualCompActorInit
(
task_proto
);
}
}
ParallelContext
parallel_ctx_
;
};
};
inline
int64_t
GetLastPieceIdForModelVersionId
(
int64_t
model_version_id
)
{
inline
int64_t
GetLastPieceIdForModelVersionId
(
int64_t
model_version_id
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录