Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleFL
提交
0411147c
P
PaddleFL
项目概览
PaddlePaddle
/
PaddleFL
通知
35
Star
5
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
6
列表
看板
标记
里程碑
合并请求
4
Wiki
3
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleFL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
6
Issue
6
列表
看板
标记
里程碑
合并请求
4
合并请求
4
Pages
分析
分析
仓库分析
DevOps
Wiki
3
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
0411147c
编写于
5月 19, 2020
作者:
J
jingqinghe
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update document
上级
9746199f
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
16 deletion
+16
-16
python/paddle_fl/paddle_fl/examples/submitter_demo/README.md
python/paddle_fl/paddle_fl/examples/submitter_demo/README.md
+3
-2
python/paddle_fl/paddle_fl/examples/submitter_demo/client.py
python/paddle_fl/paddle_fl/examples/submitter_demo/client.py
+7
-7
python/paddle_fl/paddle_fl/examples/submitter_demo/train_program.py
...dle_fl/paddle_fl/examples/submitter_demo/train_program.py
+6
-7
未找到文件。
python/paddle_fl/paddle_fl/examples/submitter_demo/README.md
浏览文件 @
0411147c
...
...
@@ -5,13 +5,14 @@ This document introduces how to submit an FL job to mpi cluster
### Dependency
-
paddlepaddle>=1.8
-
paddle_fl==0.2.0
### How to install PaddleFL
Please use pip which has paddlepaddle installed
```
sh
pip
install
paddle_fl
pip
install
paddle_fl
==
0.2.0
```
### How it works
...
...
@@ -27,7 +28,7 @@ The information of the cluster is defined in config.txt and will be transmitted
The train_program.py is the executed program in cluster.
```
sh
#use the python prepared above to
submit job
#use the python prepared above to
generate fl job and submit the job to mpi cluster
python/bin/python client.py config.txt
```
...
...
python/paddle_fl/paddle_fl/examples/submitter_demo/client.py
浏览文件 @
0411147c
...
...
@@ -18,16 +18,16 @@ import random
import
zmq
import
time
import
sys
from
paddle_fl.
paddle_fl.
core.submitter.client_base
import
HPCClient
from
paddle_fl.
paddle_fl.
core.scheduler.agent_master
import
FLScheduler
from
paddle_fl.core.submitter.client_base
import
HPCClient
from
paddle_fl.core.scheduler.agent_master
import
FLScheduler
import
paddle.fluid
as
fluid
from
paddle_fl.
paddle_fl.
core.master.job_generator
import
JobGenerator
from
paddle_fl.
paddle_fl.
core.strategy.fl_strategy_base
import
FLStrategyFactory
from
paddle_fl.core.master.job_generator
import
JobGenerator
from
paddle_fl.core.strategy.fl_strategy_base
import
FLStrategyFactory
from
model
import
Model
import
tarfile
#random_port = random.randint(60001, 64001)
random_port
=
6
0
001
random_port
=
6
4
001
print
(
random_port
)
current_ip
=
socket
.
gethostbyname
(
socket
.
gethostname
())
endpoints
=
"{}:{}"
.
format
(
current_ip
,
random_port
)
...
...
@@ -51,8 +51,8 @@ default_dict = {
"ugi"
:
""
,
"worker_nodes"
:
5
,
"server_nodes"
:
1
,
"hadoop_home"
:
""
,
"hpc_home"
:
""
,
"hadoop_home"
:
"
/path/to/hadoop
"
,
"hpc_home"
:
"
/path/to/hpc
"
,
"package_path"
:
"./package"
,
"priority"
:
"high"
,
"queue"
:
""
,
...
...
python/paddle_fl/paddle_fl/examples/submitter_demo/train_program.py
浏览文件 @
0411147c
...
...
@@ -17,17 +17,17 @@ import random
import
zmq
import
os
import
tarfile
import
paddle_fl
.paddle_fl
as
fl
import
paddle_fl
as
fl
import
paddle.fluid
as
fluid
from
paddle_fl.
paddle_fl.
core.server.fl_server
import
FLServer
from
paddle_fl.
paddle_fl.
core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.
paddle_fl.
core.trainer.fl_trainer
import
FLTrainerFactory
from
paddle_fl.core.server.fl_server
import
FLServer
from
paddle_fl.core.master.fl_job
import
FLRunTimeJob
from
paddle_fl.core.trainer.fl_trainer
import
FLTrainerFactory
import
numpy
as
np
import
sys
import
logging
import
time
random_port
=
6
0
001
random_port
=
6
4
001
scheduler_conf
=
{}
#connect to scheduler and get the role and id of the endpoint
...
...
@@ -99,8 +99,7 @@ else:
job
.
_scheduler_ep
=
scheduler_conf
[
"ENDPOINT"
]
trainer
=
FLTrainerFactory
().
create_fl_trainer
(
job
)
trainer
.
_current_ep
=
endpoint
place
=
fluid
.
CPUPlace
()
trainer
.
start
(
place
)
trainer
.
start
()
print
(
trainer
.
_scheduler_ep
,
trainer
.
_current_ep
)
output_folder
=
"fl_model"
epoch_id
=
0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录