Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
一只大灰猫
PaddleRec
提交
3b612ee4
P
PaddleRec
项目概览
一只大灰猫
/
PaddleRec
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleRec
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
3b612ee4
编写于
4月 21, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
merge yaml two to one
上级
8b9b9cf9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
6 addition
and
8 deletion
+6
-8
fleetrec/core/trainers/cluster_trainer.py
fleetrec/core/trainers/cluster_trainer.py
+1
-1
fleetrec/core/trainers/transpiler_trainer.py
fleetrec/core/trainers/transpiler_trainer.py
+1
-1
fleetrec/core/utils/envs.py
fleetrec/core/utils/envs.py
+0
-1
fleetrec/run.py
fleetrec/run.py
+4
-5
未找到文件。
fleetrec/core/trainers/cluster_trainer.py
浏览文件 @
3b612ee4
...
...
@@ -43,7 +43,7 @@ class ClusterTrainer(TranspileTrainer):
self
.
regist_context_processor
(
'terminal_pass'
,
self
.
terminal
)
def
build_strategy
(
self
):
mode
=
envs
.
get_runtime_envion
(
"trainer.strategy"
)
mode
=
envs
.
get_runtime_envi
r
on
(
"trainer.strategy"
)
assert
mode
in
[
"async"
,
"geo"
,
"sync"
,
"half_async"
]
strategy
=
None
...
...
fleetrec/core/trainers/transpiler_trainer.py
浏览文件 @
3b612ee4
...
...
@@ -39,7 +39,7 @@ class TranspileTrainer(Trainer):
namespace
=
"train.reader"
inputs
=
self
.
model
.
get_inputs
()
threads
=
int
(
envs
.
get_runtime_envion
(
"trainer.threads"
))
threads
=
int
(
envs
.
get_runtime_envi
r
on
(
"trainer.threads"
))
batch_size
=
envs
.
get_global_env
(
"batch_size"
,
None
,
namespace
)
reader_class
=
envs
.
get_global_env
(
"class"
,
None
,
namespace
)
abs_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
...
...
fleetrec/core/utils/envs.py
浏览文件 @
3b612ee4
...
...
@@ -49,7 +49,6 @@ def set_runtime_environs(environs):
def
get_runtime_environ
(
key
):
return
os
.
getenv
(
key
,
None
)
def
get_trainer
():
train_mode
=
get_runtime_environ
(
"trainer.trainer"
)
return
train_mode
...
...
fleetrec/run.py
浏览文件 @
3b612ee4
...
...
@@ -58,7 +58,7 @@ def single_engine(args):
single_envs
[
"trainer.trainer"
]
=
"SingleTrainer"
single_envs
[
"trainer.threads"
]
=
"2"
single_envs
[
"trainer.engine"
]
=
"single"
set_runtime_envs
(
single_envs
,
args
.
engine_extras
)
set_runtime_envs
(
single_envs
,
args
.
model
)
trainer
=
TrainerFactory
.
create
(
args
.
model
)
return
trainer
...
...
@@ -80,7 +80,7 @@ def cluster_mpi_engine(args):
cluster_envs
=
{}
cluster_envs
[
"trainer.trainer"
]
=
"CtrCodingTrainer"
set_runtime_envs
(
cluster_envs
,
args
.
engine_extras
)
set_runtime_envs
(
cluster_envs
,
args
.
model
)
trainer
=
TrainerFactory
.
create
(
args
.
model
)
return
trainer
...
...
@@ -101,7 +101,7 @@ def local_cluster_engine(args):
cluster_envs
[
"trainer.engine"
]
=
"local_cluster"
cluster_envs
[
"CPU_NUM"
]
=
"2"
set_runtime_envs
(
cluster_envs
,
args
.
engine_extras
)
set_runtime_envs
(
cluster_envs
,
args
.
model
)
launch
=
LocalClusterEngine
(
cluster_envs
,
args
.
model
)
return
launch
...
...
@@ -122,7 +122,7 @@ def local_mpi_engine(args):
cluster_envs
[
"log_dir"
]
=
"logs"
cluster_envs
[
"trainer.engine"
]
=
"local_cluster"
set_runtime_envs
(
cluster_envs
,
args
.
engine_extras
)
set_runtime_envs
(
cluster_envs
,
args
.
model
)
launch
=
LocalMPIEngine
(
cluster_envs
,
args
.
model
)
return
launch
...
...
@@ -142,7 +142,6 @@ if __name__ == "__main__":
parser
=
argparse
.
ArgumentParser
(
description
=
'fleet-rec run'
)
parser
.
add_argument
(
"-m"
,
"--model"
,
type
=
str
)
parser
.
add_argument
(
"-e"
,
"--engine"
,
type
=
str
)
parser
.
add_argument
(
"-ex"
,
"--engine_extras"
,
default
=
None
,
type
=
str
)
args
=
parser
.
parse_args
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录