From ed6f373a29abb4fb0f419603fa61efd5df7eb9b0 Mon Sep 17 00:00:00 2001 From: gaina Date: Tue, 17 Aug 2021 10:28:23 +0800 Subject: [PATCH 01/16] Update related files. --- README.md | 22 ++++++++++++++- README_cn.md | 20 ++++++++++++-- docs/source/md/compile_and_install.md | 24 +++++++++-------- docs/source/md/compile_and_install_cn.md | 27 ++++++++++--------- docs/source/md/introduction.md | 2 +- .../linear_reg_with_uci/decrypt_save.py | 4 +-- .../model_decryption/decrypt_and_inference.py | 2 +- 7 files changed, 71 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 59ad3a0c..2fbfc2c7 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,13 @@ Upon completion of the secure training (or inference) job, the models (or predic For more instructions, please refer to [mpc examples](./python/paddle_fl/mpc/examples) + ## Installation +We provide three ways to install PaddleFL: + +1. Use PaddleFL in docker + We **highly recommend** to run PaddleFL in Docker ```sh @@ -91,12 +96,27 @@ We **highly recommend** to run PaddleFL in Docker docker pull paddlepaddle/paddlefl:1.1.2 docker run --name --net=host -it -v $PWD:/paddle /bin/bash -#Install paddle_fl +``` + +2. Install PaddleFL via installation package + +We provide compiled PaddlePaddle and PaddleFL installation packages, you can download and install them directly. +``` +#Install PaddlePaddle +wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl +pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl +(Replace ** with the python version in the installation environment, for example, python3.8 corresponds to cp38) + +#Install PaddleFL pip3 install paddle_fl + ``` +3.Install PaddleFL from source code + If you want to compile and install from source code, please click [here](./docs/source/md/compile_and_install.md) to get instructions. + If you are using the gloo communication model, you will need Redis. We also provide a stable Redis installation package for download. ```sh diff --git a/README_cn.md b/README_cn.md index 276cdbf5..8e548f53 100644 --- a/README_cn.md +++ b/README_cn.md @@ -78,8 +78,10 @@ PFM 拥有与PaddlePaddle相同的运行模式。在训练前,用户需要定 请参考[MPC的例子](./python/paddle_fl/mpc/examples),以获取更多的信息。 - ## 安装 +我们提供三种方式安装PaddleFL,您可以根据自己的实际情况进行选择: + +1.在Docker中使用PaddleFL 我们**强烈建议** 您在docker中使用PaddleFL。 @@ -87,13 +89,27 @@ PFM 拥有与PaddlePaddle相同的运行模式。在训练前,用户需要定 #Pull and run the docker docker pull paddlepaddle/paddlefl:1.1.2 docker run --name --net=host -it -v $PWD:/paddle /bin/bash +``` +Docker中环境配置以及paddlepaddle和paddlefl已经安装完成,您可以直接运行示例代码,开始使用PaddleFL. + +2.安装包安装 -#Install paddle_fl +我们提供了编译好的PaddlePaddle及PaddleFL安装包,您可以直接进行下载安装。 +``` +#Install PaddlePaddle +wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl +pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl +(**替换成安装环境中的python版本,如python3.8对应cp38) + +#Install PaddleFL pip3 install paddle_fl + ``` +3.源码安装 若您希望从源码编译安装,请点击[这里](./docs/source/md/compile_and_install_cn.md)。 + 如果使用gloo通信模型,需要用到redis,我们也提供了稳定的redis安装包, 可供下载。 ```sh diff --git a/docs/source/md/compile_and_install.md b/docs/source/md/compile_and_install.md index fd0642da..6fe210fd 100644 --- a/docs/source/md/compile_and_install.md +++ b/docs/source/md/compile_and_install.md @@ -10,7 +10,7 @@ docker pull hub.baidubce.com/paddlefl/paddle_fl:latest docker run --name --net=host -it -v $PWD:/root /bin/bash #Install paddle_fl -pip install paddle_fl +pip3 install paddle_fl ``` We also prepare a stable redis package for you to download and install, which will be used in tasks with MPC. @@ -25,12 +25,12 @@ cd redis-stable && make #### A. Environment preparation -* CentOS 6 or CentOS 7 (64 bit) -* Python 2.7.15+/3.5.1+/3.6/3.7 ( 64 bit) or above -* pip or pip3 9.0.1+ (64 bit) -* PaddlePaddle release 1.8 (if not build paddle from source) +* CentOS 7 (64 bit) +* Python 3.5/3.6/3.7 ( 64 bit) or above +* pip3 9.0.1+ (64 bit) +* PaddlePaddle release 1.8.5 (if not build paddle from source) * Redis 5.0.8 (64 bit) -* GCC or G++ 6+ +* GCC or G++ 8.3.1 * cmake 3.15+ #### B. Clone the source code, compile and install @@ -44,19 +44,21 @@ cd /path/to/PaddleFL mkdir build && cd build ``` -Execute compile commands, where `PYTHON_EXECUTABLE` is path to the python binary where the PaddlePaddle is installed, `CMAKE_C_COMPILER` is the path of gcc and `CMAKE_CXX_COMPILER` is the path of g++. +Execute compile commands, where `CMAKE_C_COMPILER` is the path of gcc and `CMAKE_CXX_COMPILER` is the path of g++, `PYTHON_EXECUTABLE` is path to the python binary where the PaddlePaddle is installed, `PYTHON_INCLUDE_DIRS` is path to the file `Python.h`. Then you can put the directory in the following command and make: ```sh -cmake ../ -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMAKE_C_COMPILER=${gcc_path} -DCMAKE_CXX_COMPILER=${g++_path} +cmake .. -DCMAKE_C_COMPILER=${gcc_path} -DCMAKE_CXX_COMPILER=${g++_path} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIRS} -DBUILD_PADDLE_FROM_SOURCE=ON -DWITH_GRPC=ON make -j$(nproc) ``` - -Note that paddle must be built from source after paddle-fl version 1.1.2 by turning on cmake option `BUILD_PADDLE_FROM_SOURCE` (paddlepaddle1.8.5). +For example, +``` +cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DPYTHON_EXECUTABLE=/usr/local/python/bin/python3.8 -DPYTHON_INCLUDE_DIRS=/usr/local/python/include/python3.8/ -DBUILD_PADDLE_FROM_SOURCE=ON -DWITH_GRPC=ON +``` Install paddle if BUILD_PADDLE_FROM_SOURCE=on: ```sh -pip or pip3 install ./third_party/paddle/src/extern_paddle-build/python/dist/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl -U +pip3 install ./third_party/paddle/src/extern_paddle-build/python/dist/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl -U ``` Install the package: diff --git a/docs/source/md/compile_and_install_cn.md b/docs/source/md/compile_and_install_cn.md index f28f48fa..99cec496 100644 --- a/docs/source/md/compile_and_install_cn.md +++ b/docs/source/md/compile_and_install_cn.md @@ -2,17 +2,17 @@ #### A. 环境准备 -* CentOS 6 or CentOS 7 (64 bit) -* Python 2.7.15+/3.5.1+/3.6/3.7 ( 64 bit) or above -* pip or pip3 9.0.1+ (64 bit) -* PaddlePaddle release 1.8 (如果选择不从源代码构建paddle) +* CentOS 7 (64 bit) +* Python 3.5/3.6/3.7 ( 64 bit) or above +* pip3 9.0.1+ (64 bit) +* PaddlePaddle release 1.8.5 (如果选择不从源代码构建paddle) * Redis 5.0.8 (64 bit) -* GCC or G++ 4.8.3+ +* GCC or G++ 8.3.1 * cmake 3.15+ #### B. 克隆源代码并编译安装 -获取源代码 +1.获取源代码 ```sh git clone https://github.com/PaddlePaddle/PaddleFL cd /path/to/PaddleFL @@ -21,19 +21,22 @@ cd /path/to/PaddleFL mkdir build && cd build ``` -执行编译指令, `PYTHON_EXECUTABLE` 为安装了PaddlePaddle的可执行python路径, `CMAKE_C_COMPILER` 为指定的gcc路径, `CMAKE_CXX_COMPILER` 为指定的g++路径。 +2.执行编译指令, `CMAKE_C_COMPILER` 为指定的gcc路径, `CMAKE_CXX_COMPILER` 为指定的g++路径,`PYTHON_EXECUTABLE` 为安装了PaddlePaddle的可执行python路径,`DPYTHON_INCLUDE_DIRS`为指定Python.h文件所在路径。 之后就可以执行编译和安装的指令 ```sh -cmake ../ -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMAKE_C_COMPILER=${gcc_path} -DCMAKE_CXX_COMPILER=${g++_path} +cmake .. -DCMAKE_C_COMPILER=${gcc_path} -DCMAKE_CXX_COMPILER=${g++_path} -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DPYTHON_INCLUDE_DIRS=${PYTHON_INCLUDE_DIRS} -DBUILD_PADDLE_FROM_SOURCE=ON -DWITH_GRPC=ON make -j$(nproc) ``` +例如: +``` +cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DPYTHON_EXECUTABLE=/usr/local/python/bin/python3.8 -DPYTHON_INCLUDE_DIRS=/usr/local/python/include/python3.8/ -DBUILD_PADDLE_FROM_SOURCE=ON -DWITH_GRPC=ON +``` -注意, paddle-fl 1.1.2 版(或更高)必须从源码构建paddle, 即打开cmake选项`BUILD_PADDLE_FROM_SOURCE`. -安装paddle (如果选择从源代码构建paddle): +3.安装paddle (如果选择从源代码构建paddle): ```sh -pip or pip3 install ./third_party/paddle/src/extern_paddle-build/python/dist/paddlepaddle-1.8.0-cp36-cp36m-linux_x86_64.whl -U +pip3 install ./third_party/paddle/src/extern_paddle-build/python/dist/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl -U ``` 安装对应的安装包 @@ -41,5 +44,5 @@ pip or pip3 install ./third_party/paddle/src/extern_paddle-build/python/dist/pad make install cd /path/to/PaddleFL/python ${PYTHON_EXECUTABLE} setup.py sdist bdist_wheel -pip or pip3 install dist/***.whl -U +pip3 install dist/***.whl -U ``` diff --git a/docs/source/md/introduction.md b/docs/source/md/introduction.md index e74e7672..155fa863 100644 --- a/docs/source/md/introduction.md +++ b/docs/source/md/introduction.md @@ -82,5 +82,5 @@ For more instructions, please refer to [mpc examples](./python/paddle_fl/mpc/exa - Add K8S deployment scheme for PFM. - FL mobile simulator will be open sourced in following versions. -PaddleFL + diff --git a/python/paddle_fl/mpc/examples/linear_reg_with_uci/decrypt_save.py b/python/paddle_fl/mpc/examples/linear_reg_with_uci/decrypt_save.py index af8970e7..0b514067 100644 --- a/python/paddle_fl/mpc/examples/linear_reg_with_uci/decrypt_save.py +++ b/python/paddle_fl/mpc/examples/linear_reg_with_uci/decrypt_save.py @@ -22,7 +22,7 @@ decrypt_loss_file=sys.argv[1] decrypt_prediction_file=sys.argv[2] BATCH_SIZE=10 -process_data.load_decrypt_data("/tmp/uci_loss", (1, ), decrypt_loss_file) +process_data.load_decrypt_data("./mpc_infer_data/uci_loss", (1, ), decrypt_loss_file) print("uci_loss done") -process_data.load_decrypt_data("/tmp/uci_prediction", (BATCH_SIZE, ), decrypt_prediction_file) +process_data.load_decrypt_data("./mpc_infer_data/uci_prediction", (BATCH_SIZE, ), decrypt_prediction_file) print("prediction done") diff --git a/python/paddle_fl/mpc/examples/model_decryption/decrypt_and_inference.py b/python/paddle_fl/mpc/examples/model_decryption/decrypt_and_inference.py index 0607f8d1..8a984e49 100644 --- a/python/paddle_fl/mpc/examples/model_decryption/decrypt_and_inference.py +++ b/python/paddle_fl/mpc/examples/model_decryption/decrypt_and_inference.py @@ -18,7 +18,7 @@ import paddle import paddle.fluid as fluid -import paddle_fl.mpc.data_utils.data_utils import get_datautils +import paddle_fl.mpc.data_utils.data_utils mpc_du = get_datautils('aby3') From f1b82164dde72577a8835a6ce62a532120e3c82d Mon Sep 17 00:00:00 2001 From: gaina Date: Tue, 17 Aug 2021 15:03:02 +0800 Subject: [PATCH 02/16] modify readme --- README.md | 3 +++ README_cn.md | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/README.md b/README.md index 2fbfc2c7..a0d4e558 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,9 @@ We provide compiled PaddlePaddle and PaddleFL installation packages, you can dow wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl (Replace ** with the python version in the installation environment, for example, python3.8 corresponds to cp38) +E.g., if you are using python3.8, the commands are as below: +wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl +pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl #Install PaddleFL pip3 install paddle_fl diff --git a/README_cn.md b/README_cn.md index 8e548f53..f414a1ad 100644 --- a/README_cn.md +++ b/README_cn.md @@ -101,6 +101,10 @@ wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.wh pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl (**替换成安装环境中的python版本,如python3.8对应cp38) +例如,如果您是用的python版本为python3.8,那么使用下面的命令: +wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl +pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl + #Install PaddleFL pip3 install paddle_fl From a61c137c05a4c90846337d9a633d2a731991e546 Mon Sep 17 00:00:00 2001 From: gaina Date: Tue, 17 Aug 2021 15:05:35 +0800 Subject: [PATCH 03/16] add badges --- README.md | 15 +++++++++++++++ README_cn.md | 16 ++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/README.md b/README.md index a0d4e558..fce3e401 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ [DOC](https://paddlefl.readthedocs.io/en/latest/) | [Quick Start](https://paddlefl.readthedocs.io/en/latest/compile_and_intall.html) | [中文](./README_cn.md) +[![Release](https://img.shields.io/github/release/PaddlePaddle/PaddleFL.svg)](https://github.com/PaddlePaddle/PaddleFL/releases) +[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE) + PaddleFL is an open source federated learning framework based on PaddlePaddle. Researchers can easily replicate and compare different federated learning algorithms with PaddleFL. Developers can also benefit from PaddleFL in that it is easy to deploy a federated learning system in large scale distributed clusters. In PaddleFL, several federated learning strategies will be provided with application in computer vision, natural language processing, recommendation and so on. Application of traditional machine learning training strategies such as Multi-task learning, Transfer Learning in Federated Learning settings will be provided. Based on PaddlePaddle's large scale distributed training and elastic scheduling of training job on Kubernetes, PaddleFL can be easily deployed based on full-stack open sourced software. @@ -85,6 +88,18 @@ For more instructions, please refer to [mpc examples](./python/paddle_fl/mpc/exa ## Installation +### Environment preparation + +* CentOS 7 (64 bit) +* Python 3.5/3.6/3.7 ( 64 bit) or above +* pip3 9.0.1+ (64 bit) +* PaddlePaddle release 1.8.5 +* Redis 5.0.8 (64 bit) +* GCC or G++ 8.3.1 +* cmake 3.15+ + +### Installation steps + We provide three ways to install PaddleFL: 1. Use PaddleFL in docker diff --git a/README_cn.md b/README_cn.md index f414a1ad..5adc2977 100644 --- a/README_cn.md +++ b/README_cn.md @@ -1,5 +1,8 @@ [English](./README.md) | 简体中文 +[![Release](https://img.shields.io/github/release/PaddlePaddle/PaddleFL.svg)](https://github.com/PaddlePaddle/PaddleFL/releases) +[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE) + # PaddleFL PaddleFL是一个基于PaddlePaddle的开源联邦学习框架。研究人员可以很轻松地用PaddleFL复制和比较不同的联邦学习算法,开发人员也比较容易在大规模分布式集群中部署PaddleFL联邦学习系统。PaddleFL提供很多种联邦学习策略(横向联邦学习、纵向联邦学习)及其在计算机视觉、自然语言处理、推荐算法等领域的应用。此外,PaddleFL还将提供传统机器学习训练策略的应用,例如多任务学习、联邦学习环境下的迁移学习。依靠着PaddlePaddle的大规模分布式训练和Kubernetes对训练任务的弹性调度能力,PaddleFL可以基于全栈开源软件轻松地部署。 @@ -79,6 +82,19 @@ PFM 拥有与PaddlePaddle相同的运行模式。在训练前,用户需要定 ## 安装 + +### 环境依赖 + +* CentOS 7 (64 bit) +* Python 3.5/3.6/3.7/3.8 ( 64 bit) +* pip3 9.0.1+ (64 bit) +* PaddlePaddle release 1.8.5 (如果选择不从源代码构建paddle) +* Redis 5.0.8 (64 bit) +* GCC or G++ 8.3.1 +* cmake 3.15+ + +### 安装部署 + 我们提供三种方式安装PaddleFL,您可以根据自己的实际情况进行选择: 1.在Docker中使用PaddleFL From a78e2e3635985df19256b7cc9da0084f16b6d379 Mon Sep 17 00:00:00 2001 From: gaina <74752800+gaina99@users.noreply.github.com> Date: Tue, 17 Aug 2021 15:17:00 +0800 Subject: [PATCH 04/16] Update README_cn.md --- README_cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_cn.md b/README_cn.md index 5adc2977..4ecb2f47 100644 --- a/README_cn.md +++ b/README_cn.md @@ -117,7 +117,7 @@ wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.wh pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl (**替换成安装环境中的python版本,如python3.8对应cp38) -例如,如果您是用的python版本为python3.8,那么使用下面的命令: +例如,如果您使用的python版本为python3.8,那么使用下面的命令: wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl From 6d70da30384754957e02e7ac713fb749fd820adb Mon Sep 17 00:00:00 2001 From: gaina Date: Tue, 17 Aug 2021 15:38:21 +0800 Subject: [PATCH 05/16] modify readme --- README.md | 2 +- README_cn.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fce3e401..6db05426 100644 --- a/README.md +++ b/README.md @@ -93,7 +93,7 @@ For more instructions, please refer to [mpc examples](./python/paddle_fl/mpc/exa * CentOS 7 (64 bit) * Python 3.5/3.6/3.7 ( 64 bit) or above * pip3 9.0.1+ (64 bit) -* PaddlePaddle release 1.8.5 +* PaddlePaddle 1.8.5 * Redis 5.0.8 (64 bit) * GCC or G++ 8.3.1 * cmake 3.15+ diff --git a/README_cn.md b/README_cn.md index 4ecb2f47..ec5ff882 100644 --- a/README_cn.md +++ b/README_cn.md @@ -88,7 +88,7 @@ PFM 拥有与PaddlePaddle相同的运行模式。在训练前,用户需要定 * CentOS 7 (64 bit) * Python 3.5/3.6/3.7/3.8 ( 64 bit) * pip3 9.0.1+ (64 bit) -* PaddlePaddle release 1.8.5 (如果选择不从源代码构建paddle) +* PaddlePaddle 1.8.5 * Redis 5.0.8 (64 bit) * GCC or G++ 8.3.1 * cmake 3.15+ From 794a515207483edd1107aea40c177194a1452944 Mon Sep 17 00:00:00 2001 From: jed Date: Tue, 17 Aug 2021 17:53:40 +0800 Subject: [PATCH 06/16] Merge pull request #210 from gaina99/update_relatedfiles Update related files. From 943ad9f63274f91329f1b3653e8406b9c34956bf Mon Sep 17 00:00:00 2001 From: gaina Date: Tue, 17 Aug 2021 18:04:54 +0800 Subject: [PATCH 07/16] modifiy format --- README.md | 8 ++++++-- README_cn.md | 8 +++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6db05426..02198ae7 100644 --- a/README.md +++ b/README.md @@ -116,18 +116,22 @@ docker run --name --net=host -it -v $PWD:/paddle /bin/b 2. Install PaddleFL via installation package We provide compiled PaddlePaddle and PaddleFL installation packages, you can download and install them directly. +First, install PaddlePaddle ``` #Install PaddlePaddle wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl (Replace ** with the python version in the installation environment, for example, python3.8 corresponds to cp38) +``` E.g., if you are using python3.8, the commands are as below: +``` wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl - +``` +Then, install PaddleFL +``` #Install PaddleFL pip3 install paddle_fl - ``` 3.Install PaddleFL from source code diff --git a/README_cn.md b/README_cn.md index ec5ff882..0bee4792 100644 --- a/README_cn.md +++ b/README_cn.md @@ -111,19 +111,25 @@ Docker中环境配置以及paddlepaddle和paddlefl已经安装完成,您可以 2.安装包安装 我们提供了编译好的PaddlePaddle及PaddleFL安装包,您可以直接进行下载安装。 + +首先安装paddle ``` #Install PaddlePaddle wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl (**替换成安装环境中的python版本,如python3.8对应cp38) +``` 例如,如果您使用的python版本为python3.8,那么使用下面的命令: +``` wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl +``` +然后安装PaddleFL +``` #Install PaddleFL pip3 install paddle_fl - ``` 3.源码安装 From a541ae65f21220f33fa4e28d393ba17b4500936e Mon Sep 17 00:00:00 2001 From: gaina Date: Tue, 17 Aug 2021 18:10:55 +0800 Subject: [PATCH 08/16] modify format2 --- README.md | 4 ++-- README_cn.md | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 02198ae7..a14c3822 100644 --- a/README.md +++ b/README.md @@ -116,14 +116,14 @@ docker run --name --net=host -it -v $PWD:/paddle /bin/b 2. Install PaddleFL via installation package We provide compiled PaddlePaddle and PaddleFL installation packages, you can download and install them directly. + First, install PaddlePaddle ``` #Install PaddlePaddle wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl -(Replace ** with the python version in the installation environment, for example, python3.8 corresponds to cp38) ``` -E.g., if you are using python3.8, the commands are as below: +Please replace ** with the python version in the installation environment. E.g., if you are using python3.8, the commands are as below: ``` wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl diff --git a/README_cn.md b/README_cn.md index 0bee4792..1ee9c4f5 100644 --- a/README_cn.md +++ b/README_cn.md @@ -112,15 +112,14 @@ Docker中环境配置以及paddlepaddle和paddlefl已经安装完成,您可以 我们提供了编译好的PaddlePaddle及PaddleFL安装包,您可以直接进行下载安装。 -首先安装paddle +首先安装PaddlePaddle ``` #Install PaddlePaddle wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl -(**替换成安装环境中的python版本,如python3.8对应cp38) ``` -例如,如果您使用的python版本为python3.8,那么使用下面的命令: +安装时,请将**替换成安装环境中的python版本。例如,如果您使用的python版本为python3.8,那么使用下面的命令: ``` wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl From 8f96b6a2e1c644e87e7b6465a04ff1f5707c5b75 Mon Sep 17 00:00:00 2001 From: gaina <74752800+gaina99@users.noreply.github.com> Date: Tue, 17 Aug 2021 18:13:26 +0800 Subject: [PATCH 09/16] Update README_cn.md --- README_cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_cn.md b/README_cn.md index 1ee9c4f5..47e657f6 100644 --- a/README_cn.md +++ b/README_cn.md @@ -106,7 +106,7 @@ PFM 拥有与PaddlePaddle相同的运行模式。在训练前,用户需要定 docker pull paddlepaddle/paddlefl:1.1.2 docker run --name --net=host -it -v $PWD:/paddle /bin/bash ``` -Docker中环境配置以及paddlepaddle和paddlefl已经安装完成,您可以直接运行示例代码,开始使用PaddleFL. +Docker中环境配置以及paddlepaddle和paddlefl已经安装完成,您可以直接运行示例代码,开始使用PaddleFL。 2.安装包安装 From 62672dbfce849e0699fd6154a7794102c58bef67 Mon Sep 17 00:00:00 2001 From: gaina <74752800+gaina99@users.noreply.github.com> Date: Tue, 17 Aug 2021 18:16:10 +0800 Subject: [PATCH 10/16] Merge branch 'PaddlePaddle:master' into update_relatedfiles From faf5fbccb8e3e53081a158124fe4deb7cbdd2950 Mon Sep 17 00:00:00 2001 From: gaina <74752800+gaina99@users.noreply.github.com> Date: Tue, 17 Aug 2021 18:17:37 +0800 Subject: [PATCH 11/16] Update README_cn.md --- README_cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README_cn.md b/README_cn.md index 47e657f6..088bff4f 100644 --- a/README_cn.md +++ b/README_cn.md @@ -119,7 +119,7 @@ wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.wh pip3 install paddlepaddle-1.8.5-cp**-cp**-linux_x86_64.whl ``` -安装时,请将**替换成安装环境中的python版本。例如,如果您使用的python版本为python3.8,那么使用下面的命令: +安装时,请将**替换成安装环境中的python版本。例如,如果您使用的python版本为python3.8,那么使用下面的命令: ``` wget https://paddlefl.bj.bcebos.com/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl From 573e6f092ac444f53ae771692f1f9d9370093451 Mon Sep 17 00:00:00 2001 From: gaina <74752800+gaina99@users.noreply.github.com> Date: Tue, 17 Aug 2021 18:19:06 +0800 Subject: [PATCH 12/16] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a14c3822..64174921 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ Then, install PaddleFL pip3 install paddle_fl ``` -3.Install PaddleFL from source code +3. Install PaddleFL from source code If you want to compile and install from source code, please click [here](./docs/source/md/compile_and_install.md) to get instructions. From 153bcf9174482da3866475926fe3a587e10c49b6 Mon Sep 17 00:00:00 2001 From: jed Date: Tue, 17 Aug 2021 18:26:36 +0800 Subject: [PATCH 13/16] Merge pull request #212 from gaina99/update_relatedfiles Update readme format. From 709aa1676c07e645c0d01d66b14494da5d1a957c Mon Sep 17 00:00:00 2001 From: gaina Date: Tue, 17 Aug 2021 18:55:06 +0800 Subject: [PATCH 14/16] modify files --- README.md | 1 + README_cn.md | 1 + docs/source/md/compile_and_install.md | 31 +++--------------------- docs/source/md/compile_and_install_cn.md | 5 ++-- 4 files changed, 8 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 64174921..f0703515 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ Then, install PaddleFL #Install PaddleFL pip3 install paddle_fl ``` +The above command only suit for python with version 3.8. PaddleFL based on other versions of python can be installed by downloading the corresponding installation package from https://pypi.org/project/paddle-fl/1.1.2/#files. 3. Install PaddleFL from source code diff --git a/README_cn.md b/README_cn.md index 088bff4f..e0cb0259 100644 --- a/README_cn.md +++ b/README_cn.md @@ -130,6 +130,7 @@ pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl #Install PaddleFL pip3 install paddle_fl ``` +上面的命令仅适用于python3.8版本环境安装PaddleFL。基于其他python版本的PaddleFL可以通过从 https://pypi.org/project/paddle-fl/1.1.2/#files 下载对应安装包进行安装。 3.源码安装 若您希望从源码编译安装,请点击[这里](./docs/source/md/compile_and_install_cn.md)。 diff --git a/docs/source/md/compile_and_install.md b/docs/source/md/compile_and_install.md index 6fe210fd..bdf51ad1 100644 --- a/docs/source/md/compile_and_install.md +++ b/docs/source/md/compile_and_install.md @@ -1,26 +1,3 @@ -# Compile and Install - -## Installation - -We **highly recommend** to run PaddleFL in Docker - -```sh -#Pull and run the docker -docker pull hub.baidubce.com/paddlefl/paddle_fl:latest -docker run --name --net=host -it -v $PWD:/root /bin/bash - -#Install paddle_fl -pip3 install paddle_fl -``` - -We also prepare a stable redis package for you to download and install, which will be used in tasks with MPC. - -```sh -wget --no-check-certificate https://paddlefl.bj.bcebos.com/redis-stable.tar -tar -xf redis-stable.tar -cd redis-stable && make -``` - ## Compile From Source Code #### A. Environment preparation @@ -28,19 +5,18 @@ cd redis-stable && make * CentOS 7 (64 bit) * Python 3.5/3.6/3.7 ( 64 bit) or above * pip3 9.0.1+ (64 bit) -* PaddlePaddle release 1.8.5 (if not build paddle from source) +* PaddlePaddle 1.8.5 * Redis 5.0.8 (64 bit) * GCC or G++ 8.3.1 * cmake 3.15+ #### B. Clone the source code, compile and install -Fetch the source code and checkout stable release +Fetch the source code and prepare for compilation + ```sh git clone https://github.com/PaddlePaddle/PaddleFL cd /path/to/PaddleFL - -# Checkout stable release mkdir build && cd build ``` @@ -55,6 +31,7 @@ For example, ``` cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DPYTHON_EXECUTABLE=/usr/local/python/bin/python3.8 -DPYTHON_INCLUDE_DIRS=/usr/local/python/include/python3.8/ -DBUILD_PADDLE_FROM_SOURCE=ON -DWITH_GRPC=ON ``` +If you have installed PaddlePaddle in advance and only want to compile PaddleFL, then change "-DBUILD_PADDLE_FROM_SOURCE=ON" in the above command to "-DBUILD_PADDLE_FROM_SOURCE=OFF". Install paddle if BUILD_PADDLE_FROM_SOURCE=on: ```sh diff --git a/docs/source/md/compile_and_install_cn.md b/docs/source/md/compile_and_install_cn.md index 99cec496..d839d1c4 100644 --- a/docs/source/md/compile_and_install_cn.md +++ b/docs/source/md/compile_and_install_cn.md @@ -5,7 +5,7 @@ * CentOS 7 (64 bit) * Python 3.5/3.6/3.7 ( 64 bit) or above * pip3 9.0.1+ (64 bit) -* PaddlePaddle release 1.8.5 (如果选择不从源代码构建paddle) +* PaddlePaddle 1.8.5 * Redis 5.0.8 (64 bit) * GCC or G++ 8.3.1 * cmake 3.15+ @@ -16,8 +16,6 @@ ```sh git clone https://github.com/PaddlePaddle/PaddleFL cd /path/to/PaddleFL - -# Checkout stable release mkdir build && cd build ``` @@ -32,6 +30,7 @@ make -j$(nproc) ``` cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DPYTHON_EXECUTABLE=/usr/local/python/bin/python3.8 -DPYTHON_INCLUDE_DIRS=/usr/local/python/include/python3.8/ -DBUILD_PADDLE_FROM_SOURCE=ON -DWITH_GRPC=ON ``` +如果您事先安装好了PaddlePaddle,希望只编译PaddleFL,那么将上面命令中 "-DBUILD_PADDLE_FROM_SOURCE=ON" 改为 "-DBUILD_PADDLE_FROM_SOURCE=OFF" 即可。 3.安装paddle (如果选择从源代码构建paddle): From a0cc14436e513d4271358e4430dd3a81da7c7fad Mon Sep 17 00:00:00 2001 From: gaina Date: Tue, 17 Aug 2021 19:53:19 +0800 Subject: [PATCH 15/16] update files --- README.md | 3 ++- README_cn.md | 2 +- docs/source/md/compile_and_install.md | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f0703515..6c7040a9 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,8 @@ Then, install PaddleFL #Install PaddleFL pip3 install paddle_fl ``` -The above command only suit for python with version 3.8. PaddleFL based on other versions of python can be installed by downloading the corresponding installation package from https://pypi.org/project/paddle-fl/1.1.2/#files. +The above command will automatically install PaddleFL corresponding to python3.8. For other python3 environments, you can download the corresponding installation package from https://pypi.org/project/paddle-fl/1.1.2/#files and install it manually. + 3. Install PaddleFL from source code diff --git a/README_cn.md b/README_cn.md index e0cb0259..53c7b3e8 100644 --- a/README_cn.md +++ b/README_cn.md @@ -130,7 +130,7 @@ pip3 install paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl #Install PaddleFL pip3 install paddle_fl ``` -上面的命令仅适用于python3.8版本环境安装PaddleFL。基于其他python版本的PaddleFL可以通过从 https://pypi.org/project/paddle-fl/1.1.2/#files 下载对应安装包进行安装。 +上述命令会自动安装python3.8对应的PaddleFL。对于其他python3环境,您可以从 https://pypi.org/project/paddle-fl/1.1.2/#files 下载对应安装包手动安装。 3.源码安装 若您希望从源码编译安装,请点击[这里](./docs/source/md/compile_and_install_cn.md)。 diff --git a/docs/source/md/compile_and_install.md b/docs/source/md/compile_and_install.md index bdf51ad1..daf153f5 100644 --- a/docs/source/md/compile_and_install.md +++ b/docs/source/md/compile_and_install.md @@ -44,5 +44,5 @@ Install the package: make install cd /path/to/PaddleFL/python ${PYTHON_EXECUTABLE} setup.py sdist bdist_wheel -pip or pip3 install dist/***.whl -U +pip3 install dist/***.whl -U ``` From 8d6c67179fba698972bd8180eb05f8ccdf71d6c3 Mon Sep 17 00:00:00 2001 From: gaina <74752800+gaina99@users.noreply.github.com> Date: Tue, 17 Aug 2021 19:57:49 +0800 Subject: [PATCH 16/16] Update compile_and_install_cn.md --- docs/source/md/compile_and_install_cn.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/md/compile_and_install_cn.md b/docs/source/md/compile_and_install_cn.md index d839d1c4..4e9e6786 100644 --- a/docs/source/md/compile_and_install_cn.md +++ b/docs/source/md/compile_and_install_cn.md @@ -37,7 +37,7 @@ cmake .. -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DPYTHON_EXECUTABLE=/us ```sh pip3 install ./third_party/paddle/src/extern_paddle-build/python/dist/paddlepaddle-1.8.5-cp38-cp38-linux_x86_64.whl -U ``` -安装对应的安装包 +4.安装PaddleFL对应的安装包 ```sh make install