Skip to content

Commit

Permalink
Merge branch 'main' into update_cross_site_eval
Browse files Browse the repository at this point in the history
  • Loading branch information
YuanTingHsieh authored Aug 30, 2024
2 parents 53d30dd + 0c8fdaa commit 6c1e6ad
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 22 deletions.
14 changes: 7 additions & 7 deletions docs/examples/hello_fedavg_numpy.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The ``fedavg_script_executor_hello-numpy.py`` script builds the job with the Job

Define a FedJob
^^^^^^^^^^^^^^^^
:class:`FedJob<nvflare.job_config.fed_job.FedJob>` allows you to generate job configurations in a Pythonic way. It is initialized with the
:class:`FedJob<nvflare.job_config.api.FedJob>` allows you to generate job configurations in a Pythonic way. It is initialized with the
name for the job, which will also be used as the directory name if the job is exported.

.. code-block:: python
Expand All @@ -73,7 +73,7 @@ name for the job, which will also be used as the directory name if the job is ex
Define the Controller Workflow
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Define the controller workflow and send to server. We use :class:`FedAvg<nvflare.app_common.workflows.fedavg.FedAvg>` and specify the number of
clients and rounds, then use the :func:`to<nvflare.job_config.fed_job.FedJob.to>` routine to send the component to the server for the job.
clients and rounds, then use the :func:`to<nvflare.job_config.api.FedJob.to>` routine to send the component to the server for the job.

.. code-block:: python
Expand All @@ -91,7 +91,7 @@ Add Clients
Next, we can use the :class:`ScriptExecutor<nvflare.app_common.executors.script_executor.ScriptExecutor>` and send it to each of the
clients to run our training script. We will examine the training script ``hello-numpy_fl.py`` in the next main section.

The :func:`to<nvflare.job_config.fed_job.FedJob.to>` routine sends the component to the specified client for the job. Here, our clients
The :func:`to<nvflare.job_config.api.FedJob.to>` routine sends the component to the specified client for the job. Here, our clients
are named "site-0" and "site-1" and we are using the same training script for both.

.. code-block:: python
Expand All @@ -109,22 +109,22 @@ are named "site-0" and "site-1" and we are using the same training script for bo
Optionally Export the Job or Run in Simulator
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
With all the components needed for the job, you can export the job to a directory with :func:`export<nvflare.job_config.fed_job.FedJob.export>`
With all the components needed for the job, you can export the job to a directory with :func:`export<nvflare.job_config.api.FedJob.export>`
if you want to look at what is built and configured for each client. You can use the exported job to submit it to a real NVFlare deployment
using the :ref:`FLARE Console <operating_nvflare>` or :ref:`flare_api`.

.. code-block:: python
job.export_job("/tmp/nvflare/jobs/job_config")
This is optional if you just want to run the job in a simulator environment directly, as :class:`FedJob<nvflare.job_config.fed_job.FedJob>` has
a :func:`simulator_run<nvflare.job_config.fed_job.FedJob.simulator_run>` function.
This is optional if you just want to run the job in a simulator environment directly, as :class:`FedJob<nvflare.job_config.api.FedJob>` has
a :func:`simulator_run<nvflare.job_config.api.FedJob.simulator_run>` function.

.. code-block:: python
job.simulator_run("/tmp/nvflare/jobs/workdir")
The results are saved in the specified directory provided as an argument to the :func:`simulator_run<nvflare.job_config.fed_job.FedJob.simulator_run>` function.
The results are saved in the specified directory provided as an argument to the :func:`simulator_run<nvflare.job_config.api.FedJob.simulator_run>` function.


NVIDIA FLARE Client Training Script
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/hello_pt_job_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ NVIDIA FLARE Server & Application
---------------------------------
In this example, the server runs :class:`FedAvg<nvflare.app_common.workflows.fedavg.FedAvg>` with the default settings.

If you export the job with the :func:`export<nvflare.job_config.fed_job.FedJob.export>` function, you will see the
If you export the job with the :func:`export<nvflare.job_config.api.FedJob.export>` function, you will see the
configurations for the server and each client. The server configuration is ``config_fed_server.json`` in the config folder
in app_server:

Expand Down Expand Up @@ -206,7 +206,7 @@ in app_server:
This is automatically created by the Job API. The server application configuration leverages NVIDIA FLARE built-in components.

Note that ``persistor`` points to ``PTFileModelPersistor``. This is automatically configured when the model SimpleNetwork is added
to the server with the :func:`to<nvflare.job_config.fed_job.FedJob.to>` function. The Job API detects that the model is a PyTorch model
to the server with the :func:`to<nvflare.job_config.api.FedJob.to>` function. The Job API detects that the model is a PyTorch model
and automatically configures :class:`PTFileModelPersistor<nvflare.app_opt.pt.file_model_persistor.PTFileModelPersistor>`
and :class:`PTFileModelLocator<nvflare.app_opt.pt.file_model_locator.PTFileModelLocator>`.

Expand Down
4 changes: 2 additions & 2 deletions docs/examples/hello_tf_job_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ NVIDIA FLARE Server & Application
---------------------------------
In this example, the server runs :class:`FedAvg<nvflare.app_common.workflows.fedavg.FedAvg>` with the default settings.

If you export the job with the :func:`export<nvflare.job_config.fed_job.FedJob.export>` function, you will see the
If you export the job with the :func:`export<nvflare.job_config.api.FedJob.export>` function, you will see the
configurations for the server and each client. The server configuration is ``config_fed_server.json`` in the config folder
in app_server:

Expand Down Expand Up @@ -167,7 +167,7 @@ in app_server:
This is automatically created by the Job API. The server application configuration leverages NVIDIA FLARE built-in components.

Note that ``persistor`` points to ``TFModelPersistor``. This is automatically configured when the model is added
to the server with the :func:`to<nvflare.job_config.fed_job.FedJob.to>` function. The Job API detects that the model is a TensorFlow model
to the server with the :func:`to<nvflare.job_config.api.FedJob.to>` function. The Job API detects that the model is a TensorFlow model
and automatically configures :class:`TFModelPersistor<nvflare.app_opt.tf.model_persistor.TFModelPersistor>`.


Expand Down
3 changes: 2 additions & 1 deletion docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@ Stable releases are available on `NVIDIA FLARE PyPI <https://pypi.org/project/nv
.. note::

In addition to the dependencies included when installing nvflare, many of our example applications have additional packages that must be installed.
Make sure to install from any requirement.txt files before running the examples.
Make sure to install from any requirement.txt files before running the examples. If you already have a specific version of nvflare installed in your
environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare.
See :github_nvflare_link:`nvflare/app_opt <nvflare/app_opt>` for modules and components with optional dependencies.

Cloning the NVFlare Repository and Checking Out a Branch
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/dashboard_ui.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ for the server(s) and overseer (if :ref:`HA mode <high_availability>` is enabled

Member and Lead User Experience
===============================
The website should alredy be set up when ``Member`` or ``Lead`` users are invited to sign up by the project admin.
The website should already be set up when ``Member`` or ``Lead`` users are invited to sign up by the project admin.

.. _dashboard_homepage:

Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/experiment-tracking/mlflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This example also highlights the MLflow streaming capability from the clients to
### 1. Install requirements and configure PYTHONPATH

Install additional requirements:
Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):

```
python -m pip install -r requirements.txt
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"### 1. Install NVIDIA FLARE\n",
"\n",
"Follow the [Installation](https://nvflare.readthedocs.io/en/main/getting_started.html#installation) instructions.\n",
"Install additional requirements:\n"
"Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This example also highlights the TensorBoard streaming capability from the clien
### 1. Install requirements and configure PYTHONPATH

Install additional requirements:
Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):

```
python -m pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/experiment-tracking/wandb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This example also highlights the Weights and Biases streaming capability from th
### 1. Install requirements and configure PYTHONPATH

Install additional requirements:
Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):

```
python -m pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/gnn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Since the inductive learning mode is being used, the locally learnt model (a rep
### Experiments
#### Install NVIDIA FLARE
Follow the [Installation](../../getting_started/README.md) instructions.
Install additional requirements:
Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):
```
python3 -m pip install -r requirements.txt
```
Expand Down
2 changes: 1 addition & 1 deletion examples/advanced/llm_hf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ We conducted these experiments on two 80GB A100 GPUs, PEFT only needs 1 GPU, whi

## Setup
Please make sure you set up virtual environment following [example root readme](../../README.md).
Install additional requirements:
Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):
```
python3 -m pip install -r requirements.txt
```
Expand Down
2 changes: 2 additions & 0 deletions examples/getting_started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ In each example folder, install required packages for training:
(nvflare_example)$ pip install -r requirements.txt
```

Note that if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare.

For more detailed installation instructions including virtual environment setup, cloning the repository and checking out the examples,
or how to use Docker, see the installation section of the [documentation](https://nvflare.readthedocs.io/en/main/quickstart.html).

Expand Down
2 changes: 1 addition & 1 deletion examples/hello-world/hello-cyclic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ started with the following:

Follow the [Installation](../../getting_started/README.md) instructions to install NVFlare.

Install additional requirements:
Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):

```
pip3 install tensorflow
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-world/hello-pt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ started with the following:

Follow the [Installation](../../getting_started/README.md) instructions to install NVFlare.

Install additional requirements:
Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):

```
pip3 install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-world/hello-tf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ started with the following:

Follow the [Installation](../../getting_started/README.md) instructions to install NVFlare.

Install additional requirements:
Install additional requirements (if you already have a specific version of nvflare installed in your environment, you may want to remove nvflare in the requirements to avoid reinstalling nvflare):

```
pip3 install tensorflow
Expand Down

0 comments on commit 6c1e6ad

Please sign in to comment.