Skip to main content


Substra


Substra is an open source federated learning (FL) software. It enables the training and validation of machine learning models on distributed datasets. It provides a flexible Python interface and a web application to run federated learning training at scale. This specific repository is about SubstraFL the high-level federated learning Python library based on the low-level Substra python library. SubstraFL is used to run complex federated learning experiments at scale.

Substra's main usage is in production environments. It has already been deployed and used by hospitals and biotech companies (see the MELLODDY project for instance). Substra can also be used on a single machine to perform FL simulations and debug code.

Substra was originally developed by Owkin and is now hosted by the Linux Foundation for AI and Data. Today Owkin is the main contributor to Substra.

Join the discussion on Slack and subscribe here to our newsletter.

How to install

pip install substrafl

To start using Substra

Have a look at our documentation.

Try out our MNIST example.

Support

If you need support, please either raise an issue on Github or ask on Slack.

Contributing

Substra warmly welcomes any contribution. Feel free to fork the repo and create a pull request.

How to test

Install substrafl in editable mode with developper dependencies. In addition, install substra and substra-tools in editable mode. It is recommended to install all the libraries in a Python virtual env.

git clone git@github.com:Substra/substrafl.git
pip install -e "substrafl[dev]"
git clone git@github.com:Substra/substra.git
pip install -e substra
git clone git@github.com:Substra/substra-tools.git
pip install -e substra-tools

Now you can use the following command from subtrafl top level directory to run tests:

cd substrafl
make test-subprocess

Running advanced test suites

Substra can be used in three different modes: using Python subprocesses (subprocess), using Docker (docker) and using Kubernetes (remote).

The command make test-subprocess runs the test suite in subprocess mode. It's lightweight and perfect to start.

To test with the Docker mode, you will need Docker installed and running on your machine. If necessary, install it using Docker Desktop.

The following command runs the test suites in subprocess and Docker mode:

make test-local
``

Please be warned that some of these tests are slow and the whole test suite might require a couple hours to complete.

To try out a local deployment with Kubernetes, please follow the [installation instructions](https://docs.substra.org/en/stable/contributing/local-deployment.html) provided in the documentation.
The following command runs the remote tests:

```sh
make test-remote

How to generate the changelog

The changelog is managed with towncrier. To add a new entry in the changelog, add a file in the changes folder. The file name should have the following structure: <unique_id>.<change_type>. The unique_id is a unique identifier, we currently use the PR number. The change_type can be of the following types: added, changed, removed, fixed.

To generate the changelog (for example during a release), use the following command (you must have the dev dependencies installed):

towncrier build --version=<x.y.z>

You can use the --draft option to see what would be generated without actually writing to the changelog (and without removing the fragments).

Appendix

Building the documentation

The API documentation is generated from the SubstraFL repository thanks to the auto doc module. It is automatically built by https://github.com/Substra/substra-documentation and integrated into the general documentation here.

You can build the API documentation locally to see the changes made by your PR.

Requirements

You need to have substrafl.dev installed on your machine and some extra requirements. From the SubstraFL repo:

pip install -e '.[dev]'
cd docs
pip install -r requirements.txt

Build

You can build the documentation to see if your changes are well taken into account. From the ./docs folder :

make clean html

No warning should be thrown by this command.

Then open the ./docs/_build/index.html file to see the results.

You can also generate the documentation live so each of your changes are taken into account on the fly:

make livehtml

NB: Sometimes make livehtml does not take changes into account so running the make html command in parallel might be needed.

Metadata

Release files for substrafl 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for substrafl 1.0.0
File Size Uploaded Provenance Actions
substrafl-1.0.0.tar.gz 720.0 kB Without provenance Details for substrafl-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for substrafl 1.0.0
File Interpreter ABI Platform Actions
substrafl-1.0.0-py3-none-any.whl Python 3 none any Details for substrafl-1.0.0-py3-none-any.whl

Total release size: 838.2 kB

Release files / substrafl-1.0.0.tar.gz

Download URL substrafl-1.0.0.tar.gz
Size 720.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5cd540c431860feccda77d72bc1772a773b6816e7ca957e502b61eab4ec96a87
BLAKE2b-256 checksum
How to use checksums
f144dee326198a8744b4941e324e02cfd108055375219ca9307c225ea14e8ce7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.2

Release files / substrafl-1.0.0-py3-none-any.whl

Download URL substrafl-1.0.0-py3-none-any.whl
Size 118.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba7cb13a1ad828ef98c0cbd8869a6ba8b66961cf2bdbe4d1ac510787995695cf
BLAKE2b-256 checksum
How to use checksums
9df6c3fd09a4aabfba8c8f402a319186c7fb62e3763bef2b971c5c3f9784b5ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.27.2

Security for substrafl 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page