Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleRec
提交
06a44f67
P
PaddleRec
项目概览
PaddlePaddle
/
PaddleRec
通知
68
Star
12
Fork
5
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
27
列表
看板
标记
里程碑
合并请求
10
Wiki
1
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleRec
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
27
Issue
27
列表
看板
标记
里程碑
合并请求
10
合并请求
10
Pages
分析
分析
仓库分析
DevOps
Wiki
1
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
06a44f67
编写于
5月 13, 2020
作者:
T
tangwei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add cluster run, rename fleet-rec to paddle-rec
上级
1c8486fc
变更
110
隐藏空白更改
内联
并排
Showing
110 changed file
with
203 addition
and
209 deletion
+203
-209
.gitignore
.gitignore
+1
-1
__init__.py
__init__.py
+0
-0
core/__init__.py
core/__init__.py
+0
-0
core/engine/__init__.py
core/engine/__init__.py
+0
-0
core/engine/cluster/__init__.py
core/engine/cluster/__init__.py
+0
-0
core/engine/cluster/cluster.py
core/engine/cluster/cluster.py
+3
-3
core/engine/cluster/master.sh
core/engine/cluster/master.sh
+0
-0
core/engine/engine.py
core/engine/engine.py
+0
-0
core/engine/local_cluster.py
core/engine/local_cluster.py
+3
-3
core/engine/local_mpi.py
core/engine/local_mpi.py
+2
-2
core/factory.py
core/factory.py
+2
-2
core/layer.py
core/layer.py
+0
-0
core/metric.py
core/metric.py
+0
-0
core/metrics/__init__.py
core/metrics/__init__.py
+0
-0
core/metrics/auc_metrics.py
core/metrics/auc_metrics.py
+1
-1
core/model.py
core/model.py
+1
-1
core/modules/__init__.py
core/modules/__init__.py
+0
-0
core/modules/coding/__init__.py
core/modules/coding/__init__.py
+0
-0
core/modules/coding/layers.py
core/modules/coding/layers.py
+0
-0
core/modules/modul/__init__.py
core/modules/modul/__init__.py
+0
-0
core/modules/modul/build.py
core/modules/modul/build.py
+2
-2
core/modules/modul/layers.py
core/modules/modul/layers.py
+1
-1
core/reader.py
core/reader.py
+1
-1
core/trainer.py
core/trainer.py
+1
-1
core/trainers/__init__.py
core/trainers/__init__.py
+0
-0
core/trainers/cluster_trainer.py
core/trainers/cluster_trainer.py
+2
-2
core/trainers/ctr_coding_trainer.py
core/trainers/ctr_coding_trainer.py
+2
-2
core/trainers/ctr_modul_trainer.py
core/trainers/ctr_modul_trainer.py
+6
-6
core/trainers/single_trainer.py
core/trainers/single_trainer.py
+2
-2
core/trainers/tdm_cluster_trainer.py
core/trainers/tdm_cluster_trainer.py
+2
-2
core/trainers/tdm_single_trainer.py
core/trainers/tdm_single_trainer.py
+3
-3
core/trainers/transpiler_trainer.py
core/trainers/transpiler_trainer.py
+4
-4
core/utils/__init__.py
core/utils/__init__.py
+0
-0
core/utils/dataloader_instance.py
core/utils/dataloader_instance.py
+4
-4
core/utils/dataset.py
core/utils/dataset.py
+2
-2
core/utils/dataset_instance.py
core/utils/dataset_instance.py
+1
-1
core/utils/envs.py
core/utils/envs.py
+3
-3
core/utils/fs.py
core/utils/fs.py
+0
-0
core/utils/table.py
core/utils/table.py
+0
-0
core/utils/util.py
core/utils/util.py
+1
-1
fleet_rec/check.py
fleet_rec/check.py
+0
-8
models/contentunderstanding/tagspace/config.yaml
models/contentunderstanding/tagspace/config.yaml
+1
-1
models/contentunderstanding/tagspace/model.py
models/contentunderstanding/tagspace/model.py
+2
-2
models/contentunderstanding/tagspace/reader.py
models/contentunderstanding/tagspace/reader.py
+2
-2
models/contentunderstanding/text_classification/config.yaml
models/contentunderstanding/text_classification/config.yaml
+1
-1
models/contentunderstanding/text_classification/model.py
models/contentunderstanding/text_classification/model.py
+2
-2
models/contentunderstanding/text_classification/reader.py
models/contentunderstanding/text_classification/reader.py
+2
-2
models/match/dssm/config.yaml
models/match/dssm/config.yaml
+1
-1
models/match/dssm/model.py
models/match/dssm/model.py
+2
-2
models/match/dssm/synthetic_evaluate_reader.py
models/match/dssm/synthetic_evaluate_reader.py
+2
-2
models/match/dssm/synthetic_reader.py
models/match/dssm/synthetic_reader.py
+2
-2
models/match/multiview-simnet/config.yaml
models/match/multiview-simnet/config.yaml
+2
-2
models/match/multiview-simnet/evaluate_reader.py
models/match/multiview-simnet/evaluate_reader.py
+2
-2
models/match/multiview-simnet/model.py
models/match/multiview-simnet/model.py
+2
-2
models/match/multiview-simnet/reader.py
models/match/multiview-simnet/reader.py
+2
-2
models/multitask/esmm/config.yaml
models/multitask/esmm/config.yaml
+1
-1
models/multitask/esmm/esmm_reader.py
models/multitask/esmm/esmm_reader.py
+2
-2
models/multitask/esmm/model.py
models/multitask/esmm/model.py
+2
-2
models/multitask/mmoe/census_reader.py
models/multitask/mmoe/census_reader.py
+2
-2
models/multitask/mmoe/config.yaml
models/multitask/mmoe/config.yaml
+1
-1
models/multitask/mmoe/model.py
models/multitask/mmoe/model.py
+2
-2
models/multitask/share-bottom/census_reader.py
models/multitask/share-bottom/census_reader.py
+2
-2
models/multitask/share-bottom/config.yaml
models/multitask/share-bottom/config.yaml
+1
-1
models/multitask/share-bottom/model.py
models/multitask/share-bottom/model.py
+2
-2
models/rank/criteo_reader.py
models/rank/criteo_reader.py
+2
-2
models/rank/dcn/config.yaml
models/rank/dcn/config.yaml
+1
-1
models/rank/dcn/criteo_reader.py
models/rank/dcn/criteo_reader.py
+2
-2
models/rank/dcn/data/download.py
models/rank/dcn/data/download.py
+1
-1
models/rank/dcn/model.py
models/rank/dcn/model.py
+2
-2
models/rank/deepfm/config.yaml
models/rank/deepfm/config.yaml
+1
-1
models/rank/deepfm/criteo_reader.py
models/rank/deepfm/criteo_reader.py
+2
-2
models/rank/deepfm/data/download_preprocess.py
models/rank/deepfm/data/download_preprocess.py
+1
-1
models/rank/deepfm/model.py
models/rank/deepfm/model.py
+2
-2
models/rank/din/config.yaml
models/rank/din/config.yaml
+1
-1
models/rank/din/model.py
models/rank/din/model.py
+2
-2
models/rank/din/reader.py
models/rank/din/reader.py
+2
-2
models/rank/dnn/backend.yaml
models/rank/dnn/backend.yaml
+2
-2
models/rank/dnn/config.yaml
models/rank/dnn/config.yaml
+1
-1
models/rank/dnn/model.py
models/rank/dnn/model.py
+2
-2
models/rank/dnn/worker.sh
models/rank/dnn/worker.sh
+2
-2
models/rank/wide_deep/config.yaml
models/rank/wide_deep/config.yaml
+1
-1
models/rank/wide_deep/model.py
models/rank/wide_deep/model.py
+2
-2
models/rank/wide_deep/reader.py
models/rank/wide_deep/reader.py
+2
-2
models/rank/xdeepfm/config.yaml
models/rank/xdeepfm/config.yaml
+1
-1
models/rank/xdeepfm/criteo_reader.py
models/rank/xdeepfm/criteo_reader.py
+2
-2
models/rank/xdeepfm/data/download.py
models/rank/xdeepfm/data/download.py
+1
-1
models/rank/xdeepfm/model.py
models/rank/xdeepfm/model.py
+2
-2
models/recall/gnn/config.yaml
models/recall/gnn/config.yaml
+2
-2
models/recall/gnn/evaluate_reader.py
models/recall/gnn/evaluate_reader.py
+2
-2
models/recall/gnn/model.py
models/recall/gnn/model.py
+2
-2
models/recall/gnn/reader.py
models/recall/gnn/reader.py
+2
-2
models/recall/gru4rec/config.yaml
models/recall/gru4rec/config.yaml
+1
-1
models/recall/gru4rec/model.py
models/recall/gru4rec/model.py
+2
-2
models/recall/gru4rec/rsc15_reader.py
models/recall/gru4rec/rsc15_reader.py
+2
-2
models/recall/readme.md
models/recall/readme.md
+1
-1
models/recall/ssr/config.yaml
models/recall/ssr/config.yaml
+1
-1
models/recall/ssr/model.py
models/recall/ssr/model.py
+2
-2
models/recall/ssr/ssr_reader.py
models/recall/ssr/ssr_reader.py
+2
-2
models/recall/tdm/config.yaml
models/recall/tdm/config.yaml
+2
-2
models/recall/tdm/model.py
models/recall/tdm/model.py
+2
-2
models/recall/tdm/tdm_evaluate_reader.py
models/recall/tdm/tdm_evaluate_reader.py
+1
-1
models/recall/tdm/tdm_reader.py
models/recall/tdm/tdm_reader.py
+1
-1
models/recall/word2vec/config.yaml
models/recall/word2vec/config.yaml
+2
-2
models/recall/word2vec/model.py
models/recall/word2vec/model.py
+2
-2
models/recall/word2vec/w2v_evaluate_reader.py
models/recall/word2vec/w2v_evaluate_reader.py
+2
-2
models/recall/word2vec/w2v_reader.py
models/recall/word2vec/w2v_reader.py
+2
-2
readme.md
readme.md
+14
-14
run.py
run.py
+11
-11
setup.py
setup.py
+18
-16
tests/__init__.py
tests/__init__.py
+0
-0
未找到文件。
.gitignore
浏览文件 @
06a44f67
...
...
@@ -3,6 +3,6 @@ output
.idea/
build/
dist/
fleet
rec.egg-info/
paddle
rec.egg-info/
*~
*.pyc
fleet_rec/
__init__.py
→
__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/__init__.py
→
core/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/engine/__init__.py
→
core/engine/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/engine/cluster/__init__.py
→
core/engine/cluster/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/engine/cluster/cluster.py
→
core/engine/cluster/cluster.py
浏览文件 @
06a44f67
...
...
@@ -20,9 +20,9 @@ import sys
import
os
import
copy
from
fleet
rec.core.engine.engine
import
Engine
from
fleet
rec.core.factory
import
TrainerFactory
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.engine.engine
import
Engine
from
paddle
rec.core.factory
import
TrainerFactory
from
paddle
rec.core.utils
import
envs
class
ClusterEngine
(
Engine
):
...
...
fleet_rec/
core/engine/cluster/master.sh
→
core/engine/cluster/master.sh
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/engine/engine.py
→
core/engine/engine.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/engine/local_cluster.py
→
core/engine/local_cluster.py
浏览文件 @
06a44f67
...
...
@@ -19,8 +19,8 @@ import sys
import
os
import
copy
from
fleet
rec.core.engine.engine
import
Engine
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.engine.engine
import
Engine
from
paddle
rec.core.utils
import
envs
class
LocalClusterEngine
(
Engine
):
def
start_procs
(
self
):
...
...
@@ -47,7 +47,7 @@ class LocalClusterEngine(Engine):
user_endpoints_ips
=
[
x
.
split
(
":"
)[
0
]
for
x
in
user_endpoints
.
split
(
","
)]
user_endpoints_port
=
[
x
.
split
(
":"
)[
1
]
for
x
in
user_endpoints
.
split
(
","
)]
factory
=
"
fleet
rec.core.factory"
factory
=
"
paddle
rec.core.factory"
cmd
=
[
sys
.
executable
,
"-u"
,
"-m"
,
factory
,
self
.
trainer
]
for
i
in
range
(
server_num
):
...
...
fleet_rec/
core/engine/local_mpi.py
→
core/engine/local_mpi.py
浏览文件 @
06a44f67
...
...
@@ -19,7 +19,7 @@ import sys
import
os
import
copy
from
fleet
rec.core.engine.engine
import
Engine
from
paddle
rec.core.engine.engine
import
Engine
class
LocalMPIEngine
(
Engine
):
...
...
@@ -33,7 +33,7 @@ class LocalMPIEngine(Engine):
procs
=
[]
log_fns
=
[]
factory
=
"
fleet
rec.core.factory"
factory
=
"
paddle
rec.core.factory"
cmd
=
"mpirun -npernode 2 -timestamp-output -tag-output"
.
split
(
" "
)
cmd
.
extend
([
sys
.
executable
,
"-u"
,
"-m"
,
factory
,
self
.
trainer
])
...
...
fleet_rec/
core/factory.py
→
core/factory.py
浏览文件 @
06a44f67
...
...
@@ -17,7 +17,7 @@ import sys
import
yaml
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.utils
import
envs
trainer_abs
=
os
.
path
.
join
(
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
)),
"trainers"
)
...
...
@@ -71,7 +71,7 @@ class TrainerFactory(object):
with
open
(
config
,
'r'
)
as
rb
:
_config
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
else
:
raise
ValueError
(
"
fleet
rec's config only support yaml"
)
raise
ValueError
(
"
paddle
rec's config only support yaml"
)
envs
.
set_global_envs
(
_config
)
envs
.
update_workspace
()
...
...
fleet_rec/
core/layer.py
→
core/layer.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/metric.py
→
core/metric.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/metrics/__init__.py
→
core/metrics/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/metrics/auc_metrics.py
→
core/metrics/auc_metrics.py
浏览文件 @
06a44f67
...
...
@@ -15,7 +15,7 @@
import
math
import
numpy
as
np
import
paddle.fluid
as
fluid
from
fleet
rec.core.metric
import
Metric
from
paddle
rec.core.metric
import
Metric
class
AUCMetric
(
Metric
):
...
...
fleet_rec/
core/model.py
→
core/model.py
浏览文件 @
06a44f67
...
...
@@ -2,7 +2,7 @@ import abc
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.utils
import
envs
class
Model
(
object
):
...
...
fleet_rec/
core/modules/__init__.py
→
core/modules/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/modules/coding/__init__.py
→
core/modules/coding/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/modules/coding/layers.py
→
core/modules/coding/layers.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/modules/modul/__init__.py
→
core/modules/modul/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/modules/modul/build.py
→
core/modules/modul/build.py
浏览文件 @
06a44f67
...
...
@@ -3,8 +3,8 @@ import copy
import
paddle.fluid
as
fluid
from
paddle.fluid.incubate.fleet.parameter_server.pslib
import
fleet
from
fleet
rec.core.model
import
Model
from
fleet
rec.core.utils
import
table
from
paddle
rec.core.model
import
Model
from
paddle
rec.core.utils
import
table
def
create
(
config
):
...
...
fleet_rec/
core/modules/modul/layers.py
→
core/modules/modul/layers.py
浏览文件 @
06a44f67
...
...
@@ -13,7 +13,7 @@
# limitations under the License.
import
paddle.fluid
as
fluid
from
fleet
rec.core.layer
import
Layer
from
paddle
rec.core.layer
import
Layer
class
EmbeddingInputLayer
(
Layer
):
...
...
fleet_rec/
core/reader.py
→
core/reader.py
浏览文件 @
06a44f67
...
...
@@ -19,7 +19,7 @@ import os
import
paddle.fluid.incubate.data_generator
as
dg
import
yaml
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.utils
import
envs
class
Reader
(
dg
.
MultiSlotDataGenerator
):
...
...
fleet_rec/
core/trainer.py
→
core/trainer.py
浏览文件 @
06a44f67
...
...
@@ -20,7 +20,7 @@ import time
import
yaml
from
paddle
import
fluid
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.utils
import
envs
class
Trainer
(
object
):
...
...
fleet_rec/
core/trainers/__init__.py
→
core/trainers/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/trainers/cluster_trainer.py
→
core/trainers/cluster_trainer.py
浏览文件 @
06a44f67
...
...
@@ -25,8 +25,8 @@ from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distribu
from
paddle.fluid.incubate.fleet.base.role_maker
import
PaddleCloudRoleMaker
from
paddle.fluid.incubate.fleet.base.role_maker
import
MPISymetricRoleMaker
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.trainers.transpiler_trainer
import
TranspileTrainer
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.trainers.transpiler_trainer
import
TranspileTrainer
class
ClusterTrainer
(
TranspileTrainer
):
...
...
fleet_rec/
core/trainers/ctr_coding_trainer.py
→
core/trainers/ctr_coding_trainer.py
浏览文件 @
06a44f67
...
...
@@ -18,8 +18,8 @@ import paddle.fluid as fluid
from
paddle.fluid.incubate.fleet.parameter_server.pslib
import
fleet
from
paddle.fluid.incubate.fleet.base.role_maker
import
MPISymetricRoleMaker
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.trainer
import
Trainer
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.trainer
import
Trainer
class
CtrPaddleTrainer
(
Trainer
):
...
...
fleet_rec/
core/trainers/ctr_modul_trainer.py
→
core/trainers/ctr_modul_trainer.py
浏览文件 @
06a44f67
...
...
@@ -24,12 +24,12 @@ from paddle.fluid.incubate.fleet.parameter_server.pslib import fleet
from
paddle.fluid.incubate.fleet.base.role_maker
import
GeneralRoleMaker
from
fleet
rec.core.utils
import
fs
as
fs
from
fleet
rec.core.utils
import
util
as
util
from
fleet
rec.core.metrics.auc_metrics
import
AUCMetric
from
fleet
rec.core.modules.modul
import
build
as
model_basic
from
fleet
rec.core.utils
import
dataset
from
fleet
rec.core.trainer
import
Trainer
from
paddle
rec.core.utils
import
fs
as
fs
from
paddle
rec.core.utils
import
util
as
util
from
paddle
rec.core.metrics.auc_metrics
import
AUCMetric
from
paddle
rec.core.modules.modul
import
build
as
model_basic
from
paddle
rec.core.utils
import
dataset
from
paddle
rec.core.trainer
import
Trainer
def
wroker_numric_opt
(
value
,
env
,
opt
):
...
...
fleet_rec/
core/trainers/single_trainer.py
→
core/trainers/single_trainer.py
浏览文件 @
06a44f67
...
...
@@ -20,8 +20,8 @@ from __future__ import print_function
import
logging
import
paddle.fluid
as
fluid
from
fleet
rec.core.trainers.transpiler_trainer
import
TranspileTrainer
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.trainers.transpiler_trainer
import
TranspileTrainer
from
paddle
rec.core.utils
import
envs
import
numpy
as
np
logging
.
basicConfig
(
format
=
"%(asctime)s - %(levelname)s - %(message)s"
)
...
...
fleet_rec/
core/trainers/tdm_cluster_trainer.py
→
core/trainers/tdm_cluster_trainer.py
浏览文件 @
06a44f67
...
...
@@ -25,8 +25,8 @@ from paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler import f
from
paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler.distributed_strategy
import
StrategyFactory
from
paddle.fluid.incubate.fleet.base.role_maker
import
PaddleCloudRoleMaker
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.trainers.cluster_trainer
import
ClusterTrainer
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.trainers.cluster_trainer
import
ClusterTrainer
logging
.
basicConfig
(
format
=
"%(asctime)s - %(levelname)s - %(message)s"
)
...
...
fleet_rec/
core/trainers/tdm_single_trainer.py
→
core/trainers/tdm_single_trainer.py
浏览文件 @
06a44f67
...
...
@@ -21,9 +21,9 @@ from __future__ import print_function
import
logging
import
paddle.fluid
as
fluid
from
fleet
rec.core.trainers.transpiler_trainer
import
TranspileTrainer
from
fleet
rec.core.trainers.single_trainer
import
SingleTrainer
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.trainers.transpiler_trainer
import
TranspileTrainer
from
paddle
rec.core.trainers.single_trainer
import
SingleTrainer
from
paddle
rec.core.utils
import
envs
import
numpy
as
np
logging
.
basicConfig
(
format
=
"%(asctime)s - %(levelname)s - %(message)s"
)
...
...
fleet_rec/
core/trainers/transpiler_trainer.py
→
core/trainers/transpiler_trainer.py
浏览文件 @
06a44f67
...
...
@@ -20,9 +20,9 @@ import os
import
paddle.fluid
as
fluid
from
paddle.fluid.incubate.fleet.parameter_server.distribute_transpiler
import
fleet
from
fleet
rec.core.trainer
import
Trainer
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.utils
import
dataloader_instance
from
paddle
rec.core.trainer
import
Trainer
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.utils
import
dataloader_instance
class
TranspileTrainer
(
Trainer
):
...
...
@@ -81,7 +81,7 @@ class TranspileTrainer(Trainer):
pipe_cmd
=
"python {} {} {} {}"
.
format
(
reader
,
reader_class
,
state
,
self
.
_config_yaml
)
if
train_data_path
.
startswith
(
"
fleet
rec::"
):
if
train_data_path
.
startswith
(
"
paddle
rec::"
):
package_base
=
envs
.
get_runtime_environ
(
"PACKAGE_BASE"
)
assert
package_base
is
not
None
train_data_path
=
os
.
path
.
join
(
...
...
fleet_rec/
core/utils/__init__.py
→
core/utils/__init__.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/utils/dataloader_instance.py
→
core/utils/dataloader_instance.py
浏览文件 @
06a44f67
...
...
@@ -16,9 +16,9 @@ from __future__ import print_function
import
os
import
sys
from
fleet
rec.core.utils.envs
import
lazy_instance_by_fliename
from
fleet
rec.core.utils.envs
import
get_global_env
from
fleet
rec.core.utils.envs
import
get_runtime_environ
from
paddle
rec.core.utils.envs
import
lazy_instance_by_fliename
from
paddle
rec.core.utils.envs
import
get_global_env
from
paddle
rec.core.utils.envs
import
get_runtime_environ
def
dataloader
(
readerclass
,
train
,
yaml_file
):
...
...
@@ -31,7 +31,7 @@ def dataloader(readerclass, train, yaml_file):
namespace
=
"evaluate.reader"
data_path
=
get_global_env
(
"test_data_path"
,
None
,
namespace
)
if
data_path
.
startswith
(
"
fleet
rec::"
):
if
data_path
.
startswith
(
"
paddle
rec::"
):
package_base
=
get_runtime_environ
(
"PACKAGE_BASE"
)
assert
package_base
is
not
None
data_path
=
os
.
path
.
join
(
package_base
,
data_path
.
split
(
"::"
)[
1
])
...
...
fleet_rec/
core/utils/dataset.py
→
core/utils/dataset.py
浏览文件 @
06a44f67
...
...
@@ -18,8 +18,8 @@ import datetime
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
fs
as
fs
from
fleet
rec.core.utils
import
util
as
util
from
paddle
rec.core.utils
import
fs
as
fs
from
paddle
rec.core.utils
import
util
as
util
class
Dataset
(
object
):
...
...
fleet_rec/
core/utils/dataset_instance.py
→
core/utils/dataset_instance.py
浏览文件 @
06a44f67
...
...
@@ -14,7 +14,7 @@
from
__future__
import
print_function
import
sys
from
fleet
rec.core.utils.envs
import
lazy_instance_by_fliename
from
paddle
rec.core.utils.envs
import
lazy_instance_by_fliename
if
len
(
sys
.
argv
)
!=
4
:
raise
ValueError
(
"reader only accept 3 argument: 1. reader_class 2.train/evaluate 3.yaml_abs_path"
)
...
...
fleet_rec/
core/utils/envs.py
→
core/utils/envs.py
浏览文件 @
06a44f67
...
...
@@ -93,9 +93,9 @@ def update_workspace():
return
# is fleet inner models
if
workspace
.
startswith
(
"
fleet
rec."
):
if
workspace
.
startswith
(
"
paddle
rec."
):
fleet_package
=
get_runtime_environ
(
"PACKAGE_BASE"
)
workspace_dir
=
workspace
.
split
(
"
fleet
rec."
)[
1
].
replace
(
"."
,
"/"
)
workspace_dir
=
workspace
.
split
(
"
paddle
rec."
)[
1
].
replace
(
"."
,
"/"
)
path
=
os
.
path
.
join
(
fleet_package
,
workspace_dir
)
else
:
path
=
workspace
...
...
@@ -127,7 +127,7 @@ def pretty_print_envs(envs, header=None):
if
header
:
draws
+=
h_format
.
format
(
header
[
0
],
header
[
1
])
else
:
draws
+=
h_format
.
format
(
"
fleet
rec Global Envs"
,
"Value"
)
draws
+=
h_format
.
format
(
"
paddle
rec Global Envs"
,
"Value"
)
draws
+=
line
+
"
\n
"
...
...
fleet_rec/
core/utils/fs.py
→
core/utils/fs.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/utils/table.py
→
core/utils/table.py
浏览文件 @
06a44f67
文件已移动
fleet_rec/
core/utils/util.py
→
core/utils/util.py
浏览文件 @
06a44f67
...
...
@@ -17,7 +17,7 @@ import time
import
datetime
from
paddle
import
fluid
from
fleet
rec.core.utils
import
fs
as
fs
from
paddle
rec.core.utils
import
fs
as
fs
def
save_program_proto
(
path
,
program
=
None
):
...
...
fleet_rec/check.py
已删除
100755 → 0
浏览文件 @
1c8486fc
import
argparse
if
__name__
==
"__main__"
:
parser
=
argparse
.
ArgumentParser
(
description
=
'fleet-rec check'
)
parser
.
add_argument
(
"--model"
,
type
=
str
)
parser
.
add_argument
(
"--engine"
,
type
=
str
)
print
(
"coming soon"
)
models/contentunderstanding/tagspace/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
10
workspace
:
"
fleet
rec.models.rank.tagspace"
workspace
:
"
paddle
rec.models.rank.tagspace"
reader
:
batch_size
:
5
...
...
models/contentunderstanding/tagspace/model.py
浏览文件 @
06a44f67
import
paddle.fluid
as
fluid
import
math
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
import
paddle.fluid
as
fluid
import
paddle.fluid.layers.nn
as
nn
...
...
models/contentunderstanding/tagspace/reader.py
浏览文件 @
06a44f67
...
...
@@ -10,8 +10,8 @@ import paddle
import
csv
import
io
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
TrainReader
(
Reader
):
def
init
(
self
):
...
...
models/contentunderstanding/text_classification/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
10
workspace
:
"
fleet
rec.models.rank.text_classification"
workspace
:
"
paddle
rec.models.rank.text_classification"
reader
:
batch_size
:
5
...
...
models/contentunderstanding/text_classification/model.py
浏览文件 @
06a44f67
import
paddle.fluid
as
fluid
import
math
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
import
paddle.fluid
as
fluid
import
paddle.fluid.layers.nn
as
nn
...
...
models/contentunderstanding/text_classification/reader.py
浏览文件 @
06a44f67
...
...
@@ -10,8 +10,8 @@ import paddle
import
csv
import
io
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
TrainReader
(
Reader
):
def
init
(
self
):
...
...
models/match/dssm/config.yaml
浏览文件 @
06a44f67
...
...
@@ -23,7 +23,7 @@ train:
strategy
:
"
async"
epochs
:
4
workspace
:
"
fleet
rec.models.match.dssm"
workspace
:
"
paddle
rec.models.match.dssm"
reader
:
batch_size
:
4
...
...
models/match/dssm/model.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@
import
math
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/match/dssm/synthetic_evaluate_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
EvaluateReader
(
Reader
):
...
...
models/match/dssm/synthetic_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
TrainReader
(
Reader
):
...
...
models/match/multiview-simnet/config.yaml
浏览文件 @
06a44f67
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
evaluate
:
workspace
:
"
fleet
rec.models.recall.multiview-simnet"
workspace
:
"
paddle
rec.models.recall.multiview-simnet"
reader
:
batch_size
:
2
class
:
"
{workspace}/evaluate_reader.py"
...
...
@@ -24,7 +24,7 @@ train:
strategy
:
"
async"
epochs
:
2
workspace
:
"
fleet
rec.models.recall.multiview-simnet"
workspace
:
"
paddle
rec.models.recall.multiview-simnet"
reader
:
batch_size
:
2
...
...
models/match/multiview-simnet/evaluate_reader.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@ import numpy as np
import
io
import
copy
import
random
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
EvaluateReader
(
Reader
):
...
...
models/match/multiview-simnet/model.py
浏览文件 @
06a44f67
...
...
@@ -19,8 +19,8 @@ import paddle.fluid.layers as layers
import
paddle.fluid.layers.tensor
as
tensor
import
paddle.fluid.layers.control_flow
as
cf
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
BowEncoder
(
object
):
""" bow-encoder """
...
...
models/match/multiview-simnet/reader.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@ import numpy as np
import
io
import
copy
import
random
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
TrainReader
(
Reader
):
...
...
models/multitask/esmm/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
3
workspace
:
"
fleet
rec.models.multitask.esmm"
workspace
:
"
paddle
rec.models.multitask.esmm"
reader
:
batch_size
:
2
...
...
models/multitask/esmm/esmm_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
from
collections
import
defaultdict
import
numpy
as
np
...
...
models/multitask/esmm/model.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@
import
math
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
import
numpy
as
np
...
...
models/multitask/mmoe/census_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
import
numpy
as
np
...
...
models/multitask/mmoe/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
3
workspace
:
"
fleet
rec.models.multitask.mmoe"
workspace
:
"
paddle
rec.models.multitask.mmoe"
reader
:
batch_size
:
2
...
...
models/multitask/mmoe/model.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@
import
math
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/multitask/share-bottom/census_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
import
numpy
as
np
...
...
models/multitask/share-bottom/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
3
workspace
:
"
fleet
rec.models.multitask.share-bottom"
workspace
:
"
paddle
rec.models.multitask.share-bottom"
reader
:
batch_size
:
2
...
...
models/multitask/share-bottom/model.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@
import
math
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/rank/criteo_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
TrainReader
(
Reader
):
...
...
models/rank/dcn/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
10
workspace
:
"
fleet
rec.models.rank.dcn"
workspace
:
"
paddle
rec.models.rank.dcn"
reader
:
batch_size
:
2
...
...
models/rank/dcn/criteo_reader.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@ from __future__ import print_function
import
math
import
sys
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
try
:
import
cPickle
as
pickle
except
ImportError
:
...
...
models/rank/dcn/data/download.py
浏览文件 @
06a44f67
...
...
@@ -6,7 +6,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
TOOLS_PATH
=
os
.
path
.
join
(
LOCAL_PATH
,
".."
,
".."
,
"tools"
)
sys
.
path
.
append
(
TOOLS_PATH
)
from
fleet
rec.tools.tools
import
download_file_and_uncompress
from
paddle
rec.tools.tools
import
download_file_and_uncompress
if
__name__
==
'__main__'
:
trainfile
=
'train.txt'
...
...
models/rank/dcn/model.py
浏览文件 @
06a44f67
import
paddle.fluid
as
fluid
import
math
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
from
collections
import
OrderedDict
class
Model
(
ModelBase
):
...
...
models/rank/deepfm/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
10
workspace
:
"
fleet
rec.models.rank.deepfm"
workspace
:
"
paddle
rec.models.rank.deepfm"
reader
:
batch_size
:
2
...
...
models/rank/deepfm/criteo_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
try
:
import
cPickle
as
pickle
except
ImportError
:
...
...
models/rank/deepfm/data/download_preprocess.py
浏览文件 @
06a44f67
...
...
@@ -6,7 +6,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
TOOLS_PATH
=
os
.
path
.
join
(
LOCAL_PATH
,
".."
,
".."
,
"tools"
)
sys
.
path
.
append
(
TOOLS_PATH
)
from
fleet
rec.tools.tools
import
download_file_and_uncompress
,
download_file
from
paddle
rec.tools.tools
import
download_file_and_uncompress
,
download_file
if
__name__
==
'__main__'
:
url
=
"https://s3-eu-west-1.amazonaws.com/kaggle-display-advertising-challenge-dataset/dac.tar.gz"
...
...
models/rank/deepfm/model.py
浏览文件 @
06a44f67
import
paddle.fluid
as
fluid
import
math
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/rank/din/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
10
workspace
:
"
fleet
rec.models.rank.din"
workspace
:
"
paddle
rec.models.rank.din"
reader
:
batch_size
:
2
...
...
models/rank/din/model.py
浏览文件 @
06a44f67
import
paddle.fluid
as
fluid
import
math
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/rank/din/reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
import
numpy
as
np
import
os
import
random
...
...
models/rank/dnn/backend.yaml
浏览文件 @
06a44f67
...
...
@@ -13,7 +13,7 @@
# limitations under the License.
engine
:
workspace
:
"
fleet
rec.models.rank.dnn"
workspace
:
"
paddle
rec.models.rank.dnn"
backend
:
"
MPI"
hdfs
:
...
...
@@ -24,7 +24,7 @@ engine:
package
:
build_script
:
"
{workspace}/package.sh"
python
:
"
/home/tangwei/fleet_rec_env/cpython-2.7.11-ucs4"
paddlerec
:
"
/home/tangwei/fleet_rec_env/
Fleet
Rec"
paddlerec
:
"
/home/tangwei/fleet_rec_env/
Paddle
Rec"
submit
:
hpc
:
"
/home/tangwei/Plines/client/smart_client_khan/"
...
...
models/rank/dnn/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
10
workspace
:
"
fleet
rec.models.rank.dnn"
workspace
:
"
paddle
rec.models.rank.dnn"
reader
:
batch_size
:
2
...
...
models/rank/dnn/model.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@
import
math
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/rank/dnn/worker.sh
浏览文件 @
06a44f67
...
...
@@ -56,7 +56,7 @@ function env_prepare() {
python
-c
"print('heheda')"
mpirun
-npernode
1 python/bin/python
-m
pip uninstall
-y
fleet
-rec
mpirun
-npernode
1 python/bin/python
-m
pip uninstall
-y
paddle
-rec
mpirun
-npernode
1 python/bin/python
-m
pip
install
whl/fleet_rec-0.0.2-py2-none-any.whl
--index-url
=
http://pip.baidu.com/pypi/simple
--trusted-host
pip.baidu.com
check_error
}
...
...
@@ -64,7 +64,7 @@ function env_prepare() {
function
run
()
{
echo
"run"
g_run_stage
=
"run"
mpirun
-npernode
2
-timestamp-output
-tag-output
-machinefile
${
PBS_NODEFILE
}
python/bin/python
-u
-m
fleetrec.run
-m
fleet
rec.models.rank.dnn
--engine
cluster
--role
worker
mpirun
-npernode
2
-timestamp-output
-tag-output
-machinefile
${
PBS_NODEFILE
}
python/bin/python
-u
-m
paddlerec.run
-m
paddle
rec.models.rank.dnn
--engine
cluster
--role
worker
}
function
main
()
{
...
...
models/rank/wide_deep/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
10
workspace
:
"
fleet
rec.models.rank.wide_deep"
workspace
:
"
paddle
rec.models.rank.wide_deep"
reader
:
batch_size
:
2
...
...
models/rank/wide_deep/model.py
浏览文件 @
06a44f67
import
paddle.fluid
as
fluid
import
math
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/rank/wide_deep/reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
try
:
import
cPickle
as
pickle
except
ImportError
:
...
...
models/rank/xdeepfm/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
10
workspace
:
"
fleet
rec.models.rank.xdeepfm"
workspace
:
"
paddle
rec.models.rank.xdeepfm"
reader
:
batch_size
:
2
...
...
models/rank/xdeepfm/criteo_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
try
:
import
cPickle
as
pickle
except
ImportError
:
...
...
models/rank/xdeepfm/data/download.py
浏览文件 @
06a44f67
...
...
@@ -6,7 +6,7 @@ LOCAL_PATH = os.path.dirname(os.path.abspath(__file__))
TOOLS_PATH
=
os
.
path
.
join
(
LOCAL_PATH
,
".."
,
".."
,
"tools"
)
sys
.
path
.
append
(
TOOLS_PATH
)
from
fleet
rec.tools.tools
import
download_file_and_uncompress
,
download_file
from
paddle
rec.tools.tools
import
download_file_and_uncompress
,
download_file
if
__name__
==
'__main__'
:
url_train
=
"https://paddlerec.bj.bcebos.com/xdeepfm%2Ftr"
...
...
models/rank/xdeepfm/model.py
浏览文件 @
06a44f67
import
paddle.fluid
as
fluid
import
math
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/recall/gnn/config.yaml
浏览文件 @
06a44f67
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
evaluate
:
workspace
:
"
fleet
rec.models.recall.gnn"
workspace
:
"
paddle
rec.models.recall.gnn"
reader
:
batch_size
:
50
class
:
"
{workspace}/evaluate_reader.py"
...
...
@@ -24,7 +24,7 @@ train:
strategy
:
"
async"
epochs
:
2
workspace
:
"
fleet
rec.models.recall.gnn"
workspace
:
"
paddle
rec.models.recall.gnn"
reader
:
batch_size
:
100
...
...
models/recall/gnn/evaluate_reader.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@ import numpy as np
import
io
import
copy
import
random
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
EvaluateReader
(
Reader
):
...
...
models/recall/gnn/model.py
浏览文件 @
06a44f67
...
...
@@ -17,8 +17,8 @@ import math
import
paddle.fluid
as
fluid
import
paddle.fluid.layers
as
layers
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/recall/gnn/reader.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@ import numpy as np
import
io
import
copy
import
random
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
TrainReader
(
Reader
):
...
...
models/recall/gru4rec/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
3
workspace
:
"
fleet
rec.models.recall.gru4rec"
workspace
:
"
paddle
rec.models.recall.gru4rec"
reader
:
batch_size
:
5
...
...
models/recall/gru4rec/model.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@
import
math
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/recall/gru4rec/rsc15_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
TrainReader
(
Reader
):
...
...
models/recall/readme.md
浏览文件 @
06a44f67
...
...
@@ -35,7 +35,7 @@ sh data_process.sh
```
### 训练
```
shell
python
-m
fleet
rec.run
-m
config.yaml
-d
cpu
-e
single
python
-m
paddle
rec.run
-m
config.yaml
-d
cpu
-e
single
```
### 预测
...
...
models/recall/ssr/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
3
workspace
:
"
fleet
rec.models.recall.ssr"
workspace
:
"
paddle
rec.models.recall.ssr"
reader
:
batch_size
:
5
...
...
models/recall/ssr/model.py
浏览文件 @
06a44f67
...
...
@@ -15,8 +15,8 @@
import
math
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
import
paddle.fluid.layers.tensor
as
tensor
import
paddle.fluid.layers.io
as
io
import
paddle.fluid.layers.control_flow
as
cf
...
...
models/recall/ssr/ssr_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
import
random
...
...
models/recall/tdm/config.yaml
浏览文件 @
06a44f67
...
...
@@ -18,7 +18,7 @@ train:
strategy
:
"
async"
epochs
:
2
workspace
:
"
fleet
rec.models.recall.tdm"
workspace
:
"
paddle
rec.models.recall.tdm"
reader
:
batch_size
:
32
...
...
@@ -73,7 +73,7 @@ train:
save_last
:
True
evaluate
:
workspace
:
"
fleet
rec.models.recall.tdm"
workspace
:
"
paddle
rec.models.recall.tdm"
reader
:
batch_size
:
1
class
:
"
{workspace}/tdm_evaluate_reader.py"
...
...
models/recall/tdm/model.py
浏览文件 @
06a44f67
...
...
@@ -17,8 +17,8 @@
import
paddle.fluid
as
fluid
import
math
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/recall/tdm/tdm_evaluate_reader.py
浏览文件 @
06a44f67
...
...
@@ -17,7 +17,7 @@
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
paddle
rec.core.reader
import
Reader
class
EvaluateReader
(
Reader
):
...
...
models/recall/tdm/tdm_reader.py
浏览文件 @
06a44f67
...
...
@@ -17,7 +17,7 @@
from
__future__
import
print_function
from
fleet
rec.core.reader
import
Reader
from
paddle
rec.core.reader
import
Reader
class
TrainReader
(
Reader
):
...
...
models/recall/word2vec/config.yaml
浏览文件 @
06a44f67
...
...
@@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
evaluate
:
workspace
:
"
fleet
rec.models.recall.word2vec"
workspace
:
"
paddle
rec.models.recall.word2vec"
reader
:
batch_size
:
50
class
:
"
{workspace}/w2v_evaluate_reader.py"
...
...
@@ -25,7 +25,7 @@ train:
strategy
:
"
async"
epochs
:
2
workspace
:
"
fleet
rec.models.recall.word2vec"
workspace
:
"
paddle
rec.models.recall.word2vec"
reader
:
batch_size
:
100
...
...
models/recall/word2vec/model.py
浏览文件 @
06a44f67
...
...
@@ -16,8 +16,8 @@ import math
import
numpy
as
np
import
paddle.fluid
as
fluid
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.model
import
Model
as
ModelBase
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.model
import
Model
as
ModelBase
class
Model
(
ModelBase
):
...
...
models/recall/word2vec/w2v_evaluate_reader.py
浏览文件 @
06a44f67
...
...
@@ -14,8 +14,8 @@
import
numpy
as
np
import
io
import
six
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
EvaluateReader
(
Reader
):
...
...
models/recall/word2vec/w2v_reader.py
浏览文件 @
06a44f67
...
...
@@ -13,8 +13,8 @@
# limitations under the License.
import
numpy
as
np
import
io
from
fleet
rec.core.reader
import
Reader
from
fleet
rec.core.utils
import
envs
from
paddle
rec.core.reader
import
Reader
from
paddle
rec.core.utils
import
envs
class
NumpyRandomInt
(
object
):
...
...
readme.md
浏览文件 @
06a44f67
...
...
@@ -74,7 +74,7 @@ PadlleRec以预置模型为核心,具备以下特点:
-
安装方法一
<PIP源直接安装>
:
```
bash
python
-m
pip
install
fleet
-rec
python
-m
pip
install
paddle
-rec
```
-
安装方法二
...
...
@@ -88,8 +88,8 @@ PadlleRec以预置模型为核心,具备以下特点:
*
源码安装Fleet-Rec
```
git clone https://github.com/
seiriosPlus/Fleet
Rec/
cd
Fleet
Rec
git clone https://github.com/
PaddlePaddle/Paddle
Rec/
cd
Paddle
Rec
python setup.py install
```
...
...
@@ -99,16 +99,16 @@ PadlleRec以预置模型为核心,具备以下特点:
##### 单机训练
```
bash
cd
Fleet
Rec
cd
Paddle
Rec
python
-m
fleet
rec.run
\
-m
fleet
rec.models.rank.dnn
\
python
-m
paddle
rec.run
\
-m
paddle
rec.models.rank.dnn
\
-d
cpu
\
-e
single
# 使用GPU资源进行训练
python
-m
fleet
rec.run
\
-m
fleet
rec.models.rank.dnn
\
python
-m
paddle
rec.run
\
-m
paddle
rec.models.rank.dnn
\
-d
gpu
\
-e
single
```
...
...
@@ -116,10 +116,10 @@ python -m fleetrec.run \
##### 本地模拟分布式训练
```
bash
cd
Fleet
Rec
cd
Paddle
Rec
# 使用CPU资源进行训练
python
-m
fleet
rec.run
\
-m
fleet
rec.models.rank.dnn
\
python
-m
paddle
rec.run
\
-m
paddle
rec.models.rank.dnn
\
-d
cpu
\
-e
local_cluster
```
...
...
@@ -127,10 +127,10 @@ python -m fleetrec.run \
##### 集群提交分布式训练<需要用户预先配置好集群环境,本提交命令不包含提交客户端>
```
bash
cd
Fleet
Rec
cd
Paddle
Rec
python
-m
fleet
rec.run
\
-m
fleet
rec.models.rank.dnn
\
python
-m
paddle
rec.run
\
-m
paddle
rec.models.rank.dnn
\
-d
cpu
\
-e
cluster
```
...
...
fleet_rec/
run.py
→
run.py
浏览文件 @
06a44f67
...
...
@@ -5,9 +5,9 @@ import tempfile
import
yaml
from
fleet
rec.core.factory
import
TrainerFactory
from
fleet
rec.core.utils
import
envs
from
fleet
rec.core.utils
import
util
from
paddle
rec.core.factory
import
TrainerFactory
from
paddle
rec.core.utils
import
envs
from
paddle
rec.core.utils
import
util
engines
=
{}
device
=
[
"CPU"
,
"GPU"
]
...
...
@@ -117,9 +117,9 @@ def cluster_engine(args):
return
# is fleet inner models
if
workspace
.
startswith
(
"
fleet
rec."
):
if
workspace
.
startswith
(
"
paddle
rec."
):
fleet_package
=
envs
.
get_runtime_environ
(
"PACKAGE_BASE"
)
workspace_dir
=
workspace
.
split
(
"
fleet
rec."
)[
1
].
replace
(
"."
,
"/"
)
workspace_dir
=
workspace
.
split
(
"
paddle
rec."
)[
1
].
replace
(
"."
,
"/"
)
path
=
os
.
path
.
join
(
fleet_package
,
workspace_dir
)
else
:
path
=
workspace
...
...
@@ -130,7 +130,7 @@ def cluster_engine(args):
cluster_envs
[
name
]
=
value
def
master
():
from
fleet
rec.core.engine.cluster.cluster
import
ClusterEngine
from
paddle
rec.core.engine.cluster.cluster
import
ClusterEngine
with
open
(
args
.
backend
,
'r'
)
as
rb
:
_envs
=
yaml
.
load
(
rb
.
read
(),
Loader
=
yaml
.
FullLoader
)
...
...
@@ -179,7 +179,7 @@ def cluster_mpi_engine(args):
def
local_cluster_engine
(
args
):
from
fleet
rec.core.engine.local_cluster
import
LocalClusterEngine
from
paddle
rec.core.engine.local_cluster
import
LocalClusterEngine
trainer
=
get_trainer_prefix
(
args
)
+
"ClusterTrainer"
cluster_envs
=
{}
...
...
@@ -205,7 +205,7 @@ def local_cluster_engine(args):
def
local_mpi_engine
(
args
):
print
(
"launch cluster engine with cluster to run model: {}"
.
format
(
args
.
model
))
from
fleet
rec.core.engine.local_mpi
import
LocalMPIEngine
from
paddle
rec.core.engine.local_mpi
import
LocalMPIEngine
print
(
"use 1X1 MPI ClusterTraining at localhost to run model: {}"
.
format
(
args
.
model
))
...
...
@@ -227,9 +227,9 @@ def local_mpi_engine(args):
def
get_abs_model
(
model
):
if
model
.
startswith
(
"
fleet
rec."
):
if
model
.
startswith
(
"
paddle
rec."
):
fleet_base
=
envs
.
get_runtime_environ
(
"PACKAGE_BASE"
)
workspace_dir
=
model
.
split
(
"
fleet
rec."
)[
1
].
replace
(
"."
,
"/"
)
workspace_dir
=
model
.
split
(
"
paddle
rec."
)[
1
].
replace
(
"."
,
"/"
)
path
=
os
.
path
.
join
(
fleet_base
,
workspace_dir
,
"config.yaml"
)
else
:
if
not
os
.
path
.
isfile
(
model
):
...
...
@@ -239,7 +239,7 @@ def get_abs_model(model):
if
__name__
==
"__main__"
:
parser
=
argparse
.
ArgumentParser
(
description
=
'
fleet
-rec run'
)
parser
=
argparse
.
ArgumentParser
(
description
=
'
paddle
-rec run'
)
parser
.
add_argument
(
"-m"
,
"--model"
,
type
=
str
)
parser
.
add_argument
(
"-e"
,
"--engine"
,
type
=
str
,
choices
=
[
"single"
,
"local_cluster"
,
"cluster"
,
...
...
setup.py
浏览文件 @
06a44f67
"""
setup for
fleet
-rec.
setup for
paddle
-rec.
"""
import
os
from
setuptools
import
setup
,
find_packages
...
...
@@ -12,12 +12,12 @@ requires = [
]
about
=
{}
about
[
"__title__"
]
=
"
fleet
-rec"
about
[
"__title__"
]
=
"
paddle
-rec"
about
[
"__version__"
]
=
"0.0.2"
about
[
"__description__"
]
=
"
fleet
-rec"
about
[
"__author__"
]
=
"
seiriosPlus
"
about
[
"__author_email__"
]
=
"
tangwei12
@baidu.com"
about
[
"__url__"
]
=
"https://github.com/
seiriosPlus/Fleet
Rec"
about
[
"__description__"
]
=
"
paddle
-rec"
about
[
"__author__"
]
=
"
paddle-dev
"
about
[
"__author_email__"
]
=
"
paddle-dev
@baidu.com"
about
[
"__url__"
]
=
"https://github.com/
PaddlePaddle/Paddle
Rec"
readme
=
"..."
...
...
@@ -30,22 +30,24 @@ def run_cmd(command):
def
build
(
dirname
):
package_dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
__file__
))
run_cmd
(
"cp -r {}/* {}"
.
format
(
package_dir
,
dirname
))
run_cmd
(
"mkdir {}"
.
format
(
os
.
path
.
join
(
dirname
,
"fleetrec"
)))
run_cmd
(
"mv {}/* {}"
.
format
(
os
.
path
.
join
(
dirname
,
"fleet_rec"
),
os
.
path
.
join
(
dirname
,
"fleetrec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"doc"
),
os
.
path
.
join
(
dirname
,
"fleetrec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"models"
),
os
.
path
.
join
(
dirname
,
"fleetrec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"tools"
),
os
.
path
.
join
(
dirname
,
"fleetrec"
)))
run_cmd
(
"mkdir {}"
.
format
(
os
.
path
.
join
(
dirname
,
"paddlerec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"core"
),
os
.
path
.
join
(
dirname
,
"paddlerec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"doc"
),
os
.
path
.
join
(
dirname
,
"paddlerec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"models"
),
os
.
path
.
join
(
dirname
,
"paddlerec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"tests"
),
os
.
path
.
join
(
dirname
,
"paddlerec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"tools"
),
os
.
path
.
join
(
dirname
,
"paddlerec"
)))
run_cmd
(
"mv {} {}"
.
format
(
os
.
path
.
join
(
dirname
,
"*.py"
),
os
.
path
.
join
(
dirname
,
"paddlerec"
)))
packages
=
find_packages
(
dirname
,
include
=
(
'
fleet
rec.*'
))
packages
=
find_packages
(
dirname
,
include
=
(
'
paddle
rec.*'
))
package_dir
=
{
''
:
dirname
}
package_data
=
{}
models_copy
=
[
'data/*.txt'
,
'data/*/*.txt'
,
'*.yaml'
,
'*.sh'
,
'tree/*.npy'
,
'tree/*.txt'
]
engine_copy
=
[
'*/*.sh'
]
for
package
in
packages
:
if
package
.
startswith
(
"
fleet
rec.models."
):
if
package
.
startswith
(
"
paddle
rec.models."
):
package_data
[
package
]
=
models_copy
if
package
.
startswith
(
"
fleet
rec.core.engine"
):
if
package
.
startswith
(
"
paddle
rec.core.engine"
):
package_data
[
package
]
=
engine_copy
setup
(
...
...
@@ -73,11 +75,11 @@ print('''
\033
[32m
_ _ _ _ _ _ _ _ _
/ \ / \ / \ / \ / \ / \ / \ / \ /
\
(
F | L | E | E | T
| - | R | E | C )
(
P | A | D | D | L | E
| - | R | E | C )
\_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/ \_/
\033
[0m
\033
[34m
Installation Complete. Congratulations!
How to use it ? Please visit our webside: https://github.com/
seiriosPlus/Fleet
Rec
How to use it ? Please visit our webside: https://github.com/
PaddlePaddle/Paddle
Rec
\033
[0m
'''
)
fleet_rec/
tests/__init__.py
→
tests/__init__.py
浏览文件 @
06a44f67
文件已移动
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录