Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/SK-972 | Suggested changes to quick start guide #691

Merged
merged 10 commits into from
Sep 3, 2024
Binary file modified docs/img/studio_model_overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 23 additions & 10 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ code used by the client to execute local training and local validation. The seed
For a detailed explaination of the compute package and seed model, see this guide: :ref:`projects-label`

To work through this quick start you need a local copy of the ``mnist-pytorch`` example project contained in the main FEDn Git repository.
The following command clones the entire repository but you will only use the example:
Clone the repository using the following command, if you didn't already do it in the previous step:

.. code-block:: bash

git clone https://github.com/scaleoutsystems/fedn.git

Locate into the ``fedn/examples/mnist-pytorch`` folder. The compute package is located in the folder ``client``.
Navigate to the ``fedn/examples/mnist-pytorch`` folder. The compute package is located in the folder ``client``.

Create a compute package:

Expand All @@ -94,11 +94,17 @@ Next will now upload these files to your Studio project.

3. Initialize the server-side
------------------------------
The next step is to initialize the server side with the client code and the initial global model.
In the Studio UI, navigate to the project you created in step one and click on the "Sessions" tab. Click on the "New Session" button. Under the "Compute package" tab, select a name and upload the generated package file. Under the "Seed model" tab, upload the generated seed file:
The next step is to initialize the server side with the client code and the initial global model. In the Studio UI,

1. Navigate to the project you created in step 1 and click on the "Sessions" tab.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this format as an itemized list when built with sphinx?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. However, I changed it to the recommended syntax using '#.' for ordered lists.

2. Click on the "New Session" button.
3. Under the "Compute package" tab, select a name and upload the generated package file.
4. Under the "Seed model" tab, upload the generated seed file:

.. image:: img/upload_package.png

Continue to step 4 before starting the session. The uploaded package and seed files are saved.

4. Start clients
-----------------

Expand All @@ -110,15 +116,17 @@ Now we are ready to start FEDn clients on your local machine. There are two step
**Generate an access token for the client (in Studio)**

Each local client needs an access token in order to connect securely to the FEDn server. These tokens are issued from your Studio Project.
Go to the Clients' tab and click 'Connect client'. Download a client configuration file and save it to the root of the ``examples/mnist-pytorch folder``.
Rename the file to 'client.yaml'.

1. Go to the 'Clients' tab and click 'Connect client'.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question here.

2. Download a client configuration file and save it to the root of the ``examples/mnist-pytorch`` folder.
3. Rename the file to 'client.yaml'.

**Start the client (on your local machine)**

The default training and test data for this particular example (mnist-pytorch) is for convenience downloaded and split automatically by the client when it starts up.
The number of splits and which split to use by a client can be controlled via the environment variables ``FEDN_NUM_DATA_SPLITS`` and ``FEDN_DATA_PATH``.

Start a client (using a 10-split and the first partition) by running the following commands:
Start a client (using a 10-split and the 1st partition) by running the following commands:

.. tabs::

Expand All @@ -139,20 +147,25 @@ Start a client (using a 10-split and the first partition) by running the followi
fedn run client -in client.yaml --secure=True --force-ssl

Repeat these two steps (generate an access token and start a local client) for the number of clients you want to use.
A normal laptop should be able to handle several clients for this example. Remember to use different partitions for each client.
A normal laptop should be able to handle several clients for this example. Remember to use different partitions for each client, by changing the number in the ``FEDN_DATA_PATH`` variable.

5. Train the global model
-----------------------------

With clients connected, we are now ready to train the global model. This can be done using either the Studio dashboard or the Python API. In FEDn, training is organised
in Sessions. One training session consists of a configurable number of training rounds (local model updates and aggregation).

In Studio click on the "Sessions" link, then the "New session" button in the upper right corner. Click the "Start session" tab and enter your desirable settings (the default settings are good for this example) and hit the "Start run" button.
In Studio,

1. Click on the "Sessions" link, then the "New session" button in the upper right corner.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same question.

2. Click the "Start session" tab and enter your desirable settings (the default settings are good for this example).
3. Hit the "Start run" button.

In the terminal where your are running your client you should now see some activity. When a round is completed, you can see the results on the "Models" page.

**Watch real-time updates of training progress**

Once a training session is started, you can monitor the progress by clicking the drop-down button for the active Sessions and the clicking on the "View session" button. The session page will show
Once a training session is started, you can monitor the progress by clicking the drop-down button for the active Sessions and then clicking on the "View session" button. The session page will show
metrics related to the training progress (accuracy, loss etc), as well as performance data such as total round times and individual client training times. A list of models in the session is updated as soon as new models are generated.
To get more information about a particular model, navigate to the model page by clicking the model name. From the model page you can download the model weights and get validation metrics.

Expand Down
Loading