-
Notifications
You must be signed in to change notification settings - Fork 36
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
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
3813c53
Clarify that git clone is unnecessary if done in previous step
benjaminastrand 2b5b3ee
Instructions as numbered list in step 3
benjaminastrand c12fd3d
Clarify that session shouldn't be started until step 4
benjaminastrand 6a540b3
Instructions as numbered list when generating access token
benjaminastrand 041ece3
Explain how to change partition when creating several clients
benjaminastrand 53f5c35
Instructions as numbered list when starting session
benjaminastrand be366e5
Changed 'the' to 'then'
benjaminastrand 74ebd80
Changed model overview image to 5 rounds
benjaminastrand 30ca7a8
Proper .rst syntax for ordered lists
benjaminastrand 89bf901
Remove indentation of links in bottom
benjaminastrand File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
||
|
@@ -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. | ||
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 | ||
----------------- | ||
|
||
|
@@ -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'. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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:: | ||
|
||
|
@@ -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. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.