This document explains how to use and deploy the vertical federated learning framework.
The MindSpore Vertical Federated Learning (VFL) physical architecture is shown in the figure:
As shown above, there are two participants in the vertical federated interaction: the Leader node and the Follower node, each of which has processes in two roles: FLDataWorker
and VFLTrainer
:
FLDataWorker
The functions of FLDataWorker
mainly includes:
RESTful
interface is provided to users for cluster management.In a federated learning task, there is only one Scheduler
, which communicates with the Server
through TCP protocol.
VFLTrainer
VFLTrainer
is the main body that performs the vertical federated training tasks, and performs the forward and reverse computation after model slicing, Embedding tensor transfer, gradient tensor transfer, and reverse optimizer update. The current version supports single-computer single-card and single-computer multi-card training modes.
In the MindSpore federated learning framework, Server
also supports elastic scaling and disaster recovery, enabling dynamic provisioning of hardware resources without interruption of training tasks.
FLDataWorker
and VFLTrainer
are generally deployed in the same server or container.
It is recommended to use Anaconda to create a virtual environment for the following operations.
MindSpore vertical federated supports deployment on x86 CPU, GPU CUDA and Ascend hardware platforms. The latest version of MindSpore can be installed by referring to MindSpore Installation Guide.
Compile and install via source code.
git clone https://gitee.com/mindspore/federated.git -b r0.1
cd federated
bash build.sh
For bash build.sh
, accelerate compilation through the -jn
option, e.g. -j16
, and download third-party dependencies from gitee instead of github by the -S on
option.
Once compiled, find the Federated whl installation package in the build/package/
directory to install.
pip install mindspore_federated-{version}-{python_version}-linux_{arch}.whl
Execute the following command to verify the installation. The installation is successful if no error is reported when importing Python modules.
from mindspore_federated import FLServerJob
A running sample of FLDataWorker can be found in Vertical federated learning data access.
A running sample of VFLTrainer can be found in Vertical federated learning model training - Wide&Deep Recommended Application.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。