Skip to content

Commit

Permalink
Merge branch 'main' into fds-enable-more-datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljanes authored Oct 9, 2023
2 parents 018738e + 00f0d77 commit 518cbb2
Show file tree
Hide file tree
Showing 347 changed files with 2,537 additions and 1,270 deletions.
1 change: 1 addition & 0 deletions .github/workflows/android-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
run:
working-directory: src/kotlin
name: Release build and publish
if: github.repository == 'adap/flower'
runs-on: ubuntu-latest
steps:
- name: Check out code
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/datasets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Datasets

on:
push:
branches:
- main
paths:
- "datasets/**"
pull_request:
branches:
- main
paths:
- "datasets/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true

defaults:
run:
working-directory: datasets

jobs:
test_core:
runs-on: ubuntu-22.04
strategy:
matrix:
# Latest version which comes cached in the host image can be found here:
# https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#python
# In case of a mismatch, the job has to download Python to install it.
# Note: Due to a bug in actions/setup-python we have to put 3.10 in
# qoutes as it will otherwise will assume 3.1
python: [3.8, 3.9, '3.10']

name: Python ${{ matrix.python }}

steps:
- uses: actions/checkout@v4
- name: Bootstrap
uses: ./.github/actions/bootstrap
with:
python-version: ${{ matrix.python }}
- name: Install dependencies (mandatory only)
run: python -m poetry install --all-extras
- name: Test (formatting + unit tests)
run: ./dev/test.sh
5 changes: 4 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ jobs:
name: Build and deploy
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Bootstrap
uses: ./.github/actions/bootstrap
- name: Install pandoc
Expand All @@ -30,7 +32,7 @@ jobs:
- name: Build docs
run: ./dev/build-docs.sh
- name: Deploy docs
if: github.ref == 'refs/heads/main'
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork }}
env:
AWS_DEFAULT_REGION: ${{ secrets. AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand All @@ -39,3 +41,4 @@ jobs:
aws s3 sync --delete --exclude ".*" --exclude "v/*" --cache-control "no-cache" ./doc/build/html/ s3://flower.dev/docs/framework
aws s3 sync --delete --exclude ".*" --exclude "v/*" --cache-control "no-cache" ./baselines/doc/build/html/ s3://flower.dev/docs/baselines
aws s3 sync --delete --exclude ".*" --exclude "v/*" --cache-control "no-cache" ./examples/doc/build/html/ s3://flower.dev/docs/examples
aws s3 sync --delete --exclude ".*" --exclude "v/*" --cache-control "no-cache" ./datasets/doc/build/html/ s3://flower.dev/docs/datasets
40 changes: 40 additions & 0 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,40 @@ env:
FLWR_TELEMETRY_ENABLED: 0

jobs:
wheel:
runs-on: ubuntu-22.04
name: Build, test and upload wheel
steps:
- uses: actions/checkout@v3
- name: Bootstrap
uses: ./.github/actions/bootstrap
- name: Install dependencies (mandatory only)
run: python -m poetry install
- name: Build wheel
run: ./dev/build.sh
- name: Test wheel
run: ./dev/test-wheel.sh
- name: Upload wheel
if: ${{ github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork }}
id: upload
env:
AWS_DEFAULT_REGION: ${{ secrets. AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets. AWS_SECRET_ACCESS_KEY }}
run: |
cd ./dist
echo "WHL_PATH=$(ls *.whl)" >> "$GITHUB_OUTPUT"
sha_short=$(git rev-parse --short HEAD)
echo "SHORT_SHA=$sha_short" >> "$GITHUB_OUTPUT"
aws s3 cp --content-disposition "attachment" --cache-control "no-cache" ./ s3://artifact.flower.dev/py/${{ github.head_ref }}/$sha_short --recursive
outputs:
whl_path: ${{ steps.upload.outputs.WHL_PATH }}
short_sha: ${{ steps.upload.outputs.SHORT_SHA }}

frameworks:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: wheel
# Using approach described here:
# https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
strategy:
Expand Down Expand Up @@ -89,6 +120,10 @@ jobs:
python-version: 3.8
- name: Install dependencies
run: python -m poetry install
- name: Install Flower wheel from artifact store
if: ${{ github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork }}
run: |
python -m pip install https://artifact.flower.dev/py/${{ github.head_ref }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
- name: Download dataset
if: ${{ matrix.dataset }}
run: python -c "${{ matrix.dataset }}"
Expand All @@ -102,6 +137,7 @@ jobs:
strategies:
runs-on: ubuntu-22.04
timeout-minutes: 10
needs: wheel
strategy:
matrix:
strat: ["FedMedian", "FedTrimmedAvg", "QFedAvg", "FaultTolerantFedAvg", "FedAvgM", "FedAdam", "FedAdagrad", "FedYogi"]
Expand All @@ -119,6 +155,10 @@ jobs:
- name: Install dependencies
run: |
python -m poetry install
- name: Install Flower wheel from artifact store
if: ${{ github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork }}
run: |
python -m pip install https://artifact.flower.dev/py/${{ github.head_ref }}/${{ needs.wheel.outputs.short_sha }}/${{ needs.wheel.outputs.whl_path }}
- name: Cache Datasets
uses: actions/cache@v3
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/flower-swift_sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ concurrency:
jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'adap/flower'
steps:
- uses: actions/checkout@v4
- name: Pushes src/swift to flower-swift repository
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
release_nightly:
runs-on: ubuntu-22.04
name: Nightly
if: github.repository == 'adap/flower'
steps:
- uses: actions/checkout@v4
- name: Bootstrap
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/release.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:

deploy_docs:
needs: "build_docs"
if: github.ref == 'refs/heads/main'
if: ${{ github.ref == 'refs/heads/main' && github.repository == 'adap/flower' && !github.event.pull_request.head.repo.fork }}
runs-on: macos-latest
name: Deploy docs
steps:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_modules

# Flower Examples
examples/**/dataset/**
examples/**/dev/*.sh
#examples/**/dev/*.sh

# Flower Baselines
baselines/datasets/leaf
Expand Down
4 changes: 2 additions & 2 deletions baselines/doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Adap GmbH. All Rights Reserved.
# Copyright 2020 Flower Labs GmbH. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,7 @@
# -- Project information -----------------------------------------------------

project = "Flower"
copyright = "2022 Adap GmbH"
copyright = "2022 Flower Labs GmbH"
author = "The Flower Authors"

# The full version, including alpha/beta/rc tags
Expand Down
11 changes: 9 additions & 2 deletions baselines/fedprox/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ The following table shows the main hyperparameters for this baseline with their
To construct the Python environment, simply run:

```bash
# Set directory to use python 3.10 (install with `pyenv install <version>` if you don't have it)
pyenv local 3.10.12

# Tell poetry to use python3.10
poetry env use 3.10.12

# Install
poetry install
```

Expand Down Expand Up @@ -97,6 +104,6 @@ python -m fedprox.main --multirun mu=0.0,2.0 stragglers_fraction=0.0,0.5,0.9 '+r
python -m fedprox.main --config-name fedavg --multirun stragglers_fraction=0.0,0.5,0.9 '+repeat_num=range(5)'
```

The above commands would generate results that you can plot and would look like:
The above commands would generate results that you can plot and would look like the plot shown below. This plot was generated using the jupyter notebook in the `docs/` directory of this baseline after running the `--multirun` commands above.

![](docs/FedProx_mnist.png)
![](_static/FedProx_mnist.png)
Binary file modified baselines/fedprox/_static/FedProx_mnist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 518cbb2

Please sign in to comment.