Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
PaddleRec
提交
d14987ed
P
PaddleRec
项目概览
BaiXuePrincess
/
PaddleRec
与 Fork 源项目一致
Fork自
PaddlePaddle / PaddleRec
通知
1
Star
0
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看板
提交
d14987ed
编写于
4月 09, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update to fleet_rec
上级
7408da55
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
27 addition
and
30 deletion
+27
-30
examples/ctr-dnn_train_cluster.yaml
examples/ctr-dnn_train_cluster.yaml
+3
-3
examples/ctr-dnn_train_single.yaml
examples/ctr-dnn_train_single.yaml
+3
-3
examples/train.py
examples/train.py
+1
-1
models/ctr_dnn/model.py
models/ctr_dnn/model.py
+1
-1
trainer/cluster_trainer.py
trainer/cluster_trainer.py
+4
-7
trainer/ctr_trainer.py
trainer/ctr_trainer.py
+5
-5
trainer/factory.py
trainer/factory.py
+8
-8
trainer/local_engine.py
trainer/local_engine.py
+1
-1
utils/envs.py
utils/envs.py
+1
-1
未找到文件。
examples/ctr-dnn_train_cluster.yaml
浏览文件 @
d14987ed
...
@@ -41,11 +41,11 @@ train:
...
@@ -41,11 +41,11 @@ train:
reader
:
reader
:
mode
:
"
dataset"
mode
:
"
dataset"
batch_size
:
2
batch_size
:
2
pipe_command
:
"
python
/paddle/
eleps
/models/ctr_dnn/dataset.py"
pipe_command
:
"
python
/paddle/
fleet_rec
/models/ctr_dnn/dataset.py"
train_data_path
:
"
/paddle/
eleps
/models/ctr_dnn/data/train"
train_data_path
:
"
/paddle/
fleet_rec
/models/ctr_dnn/data/train"
model
:
model
:
models
:
"
eleps
.models.ctr_dnn.model"
models
:
"
fleet_rec
.models.ctr_dnn.model"
hyper_parameters
:
hyper_parameters
:
sparse_inputs_slots
:
27
sparse_inputs_slots
:
27
sparse_feature_number
:
1000001
sparse_feature_number
:
1000001
...
...
examples/ctr-dnn_train_single.yaml
浏览文件 @
d14987ed
...
@@ -35,11 +35,11 @@ train:
...
@@ -35,11 +35,11 @@ train:
reader
:
reader
:
mode
:
"
dataset"
mode
:
"
dataset"
batch_size
:
2
batch_size
:
2
pipe_command
:
"
python
/paddle/
eleps
/models/ctr_dnn/dataset.py"
pipe_command
:
"
python
/paddle/
fleet_rec
/models/ctr_dnn/dataset.py"
train_data_path
:
"
/paddle/
eleps
/models/ctr_dnn/data/train"
train_data_path
:
"
/paddle/
fleet_rec
/models/ctr_dnn/data/train"
model
:
model
:
models
:
"
eleps
.models.ctr_dnn.model"
models
:
"
fleet_rec
.models.ctr_dnn.model"
hyper_parameters
:
hyper_parameters
:
sparse_inputs_slots
:
27
sparse_inputs_slots
:
27
sparse_feature_number
:
1000001
sparse_feature_number
:
1000001
...
...
examples/train.py
浏览文件 @
d14987ed
...
@@ -26,7 +26,7 @@
...
@@ -26,7 +26,7 @@
import
os
import
os
from
eleps
.trainer.factory
import
TrainerFactory
from
fleet_rec
.trainer.factory
import
TrainerFactory
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
models/ctr_dnn/model.py
浏览文件 @
d14987ed
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
import
math
import
math
import
paddle.fluid
as
fluid
import
paddle.fluid
as
fluid
from
eleps
.utils
import
envs
from
fleet_rec
.utils
import
envs
class
Train
(
object
):
class
Train
(
object
):
...
...
trainer/cluster_trainer.py
浏览文件 @
d14987ed
...
@@ -17,23 +17,20 @@ Training use fluid with one node only.
...
@@ -17,23 +17,20 @@ Training use fluid with one node only.
"""
"""
from
__future__
import
print_function
from
__future__
import
print_function
import
os
import
logging
import
logging
import
paddle.fluid
as
fluid
from
.trainer
import
Trainer
from
..utils
import
envs
import
paddle.fluid
as
fluid
from
paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler
import
fleet
from
paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler
import
fleet
from
paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy
import
StrategyFactory
from
paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy
import
StrategyFactory
from
paddle.fluid.incubate.fleet.base.role_maker
import
PaddleCloudRoleMaker
from
paddle.fluid.incubate.fleet.base.role_maker
import
PaddleCloudRoleMaker
from
..utils
import
envs
from
.transpiler_trainer
import
TranspileTrainer
logging
.
basicConfig
(
format
=
"%(asctime)s - %(levelname)s - %(message)s"
)
logging
.
basicConfig
(
format
=
"%(asctime)s - %(levelname)s - %(message)s"
)
logger
=
logging
.
getLogger
(
"fluid"
)
logger
=
logging
.
getLogger
(
"fluid"
)
logger
.
setLevel
(
logging
.
INFO
)
logger
.
setLevel
(
logging
.
INFO
)
from
.transpiler_trainer
import
TranspileTrainer
class
ClusterTrainerWithDataloader
(
TranspileTrainer
):
class
ClusterTrainerWithDataloader
(
TranspileTrainer
):
pass
pass
...
...
trainer/ctr_trainer.py
浏览文件 @
d14987ed
...
@@ -23,11 +23,11 @@ import paddle.fluid as fluid
...
@@ -23,11 +23,11 @@ import paddle.fluid as fluid
from
paddle.fluid.incubate.fleet.parameter_server.pslib
import
fleet
from
paddle.fluid.incubate.fleet.parameter_server.pslib
import
fleet
from
paddle.fluid.incubate.fleet.base.role_maker
import
GeneralRoleMaker
from
paddle.fluid.incubate.fleet.base.role_maker
import
GeneralRoleMaker
from
eleps
.utils
import
fs
as
fs
from
fleet_rec
.utils
import
fs
as
fs
from
eleps
.utils
import
util
as
util
from
fleet_rec
.utils
import
util
as
util
from
eleps
.metrics.auc_metrics
import
AUCMetric
from
fleet_rec
.metrics.auc_metrics
import
AUCMetric
from
eleps
.models
import
base
as
model_basic
from
fleet_rec
.models
import
base
as
model_basic
from
eleps
.reader
import
dataset
from
fleet_rec
.reader
import
dataset
from
.trainer
import
Trainer
from
.trainer
import
Trainer
...
...
trainer/factory.py
浏览文件 @
d14987ed
...
@@ -29,16 +29,16 @@ import sys
...
@@ -29,16 +29,16 @@ import sys
import
yaml
import
yaml
from
eleps
.trainer.single_trainer
import
SingleTrainerWithDataloader
from
fleet_rec
.trainer.single_trainer
import
SingleTrainerWithDataloader
from
eleps
.trainer.single_trainer
import
SingleTrainerWithDataset
from
fleet_rec
.trainer.single_trainer
import
SingleTrainerWithDataset
from
eleps
.trainer.cluster_trainer
import
ClusterTrainerWithDataloader
from
fleet_rec
.trainer.cluster_trainer
import
ClusterTrainerWithDataloader
from
eleps
.trainer.cluster_trainer
import
ClusterTrainerWithDataset
from
fleet_rec
.trainer.cluster_trainer
import
ClusterTrainerWithDataset
from
eleps
.trainer.local_engine
import
Launch
from
fleet_rec
.trainer.local_engine
import
Launch
from
eleps
.trainer.ctr_trainer
import
CtrPaddleTrainer
from
fleet_rec
.trainer.ctr_trainer
import
CtrPaddleTrainer
from
eleps
.utils
import
envs
from
fleet_rec
.utils
import
envs
def
str2bool
(
v
):
def
str2bool
(
v
):
...
@@ -103,7 +103,7 @@ class TrainerFactory(object):
...
@@ -103,7 +103,7 @@ class TrainerFactory(object):
with
open
(
config
,
'r'
)
as
rb
:
with
open
(
config
,
'r'
)
as
rb
:
_config
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
_config
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
else
:
else
:
raise
ValueError
(
"
eleps
's config only support yaml"
)
raise
ValueError
(
"
fleet_rec
's config only support yaml"
)
envs
.
set_global_envs
(
_config
)
envs
.
set_global_envs
(
_config
)
mode
=
envs
.
get_global_env
(
"train.trainer"
)
mode
=
envs
.
get_global_env
(
"train.trainer"
)
...
...
trainer/local_engine.py
浏览文件 @
d14987ed
...
@@ -38,7 +38,7 @@ def start_procs(args, yaml):
...
@@ -38,7 +38,7 @@ def start_procs(args, yaml):
user_endpoints_ips
=
[
x
.
split
(
":"
)[
0
]
for
x
in
user_endpoints
.
split
(
","
)]
user_endpoints_ips
=
[
x
.
split
(
":"
)[
0
]
for
x
in
user_endpoints
.
split
(
","
)]
user_endpoints_port
=
[
x
.
split
(
":"
)[
1
]
for
x
in
user_endpoints
.
split
(
","
)]
user_endpoints_port
=
[
x
.
split
(
":"
)[
1
]
for
x
in
user_endpoints
.
split
(
","
)]
factory
=
"
eleps
.trainer.factory"
factory
=
"
fleet_rec
.trainer.factory"
cmd
=
[
sys
.
executable
,
"-u"
,
"-m"
,
factory
,
yaml
]
cmd
=
[
sys
.
executable
,
"-u"
,
"-m"
,
factory
,
yaml
]
for
i
in
range
(
server_num
):
for
i
in
range
(
server_num
):
...
...
utils/envs.py
浏览文件 @
d14987ed
...
@@ -70,7 +70,7 @@ def pretty_print_envs(envs, header=None):
...
@@ -70,7 +70,7 @@ def pretty_print_envs(envs, header=None):
if
header
:
if
header
:
draws
+=
h_format
.
format
(
header
[
0
],
header
[
1
])
draws
+=
h_format
.
format
(
header
[
0
],
header
[
1
])
else
:
else
:
draws
+=
h_format
.
format
(
"
Eleps
Global Envs"
,
"Value"
)
draws
+=
h_format
.
format
(
"
fleet_rec
Global Envs"
,
"Value"
)
draws
+=
line
+
"
\n
"
draws
+=
line
+
"
\n
"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录