Skip to content

Commit

Permalink
Merge pull request #5423 from OpenMined/dev
Browse files Browse the repository at this point in the history
0.5.0rc1
  • Loading branch information
madhavajay committed Apr 1, 2021
2 parents 15355b7 + 411a82e commit 5755b1f
Show file tree
Hide file tree
Showing 676 changed files with 94,446 additions and 10,508 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/benchmark_actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Pytest-benchmark
on:
push:
branches:
- dev
paths:
- "**.py"
- ".github/workflows/**.yml"

jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.8]
torch-version: [1.7.0]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: |
pip install --upgrade --user pip
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: Install PyTorch
run: |
pip install packaging
python scripts/adjust_torch_versions.py ./requirements.torch.txt ${{ matrix.torch-version }}
cat ./requirements.torch.txt
pip install -r requirements.torch.txt --no-deps -f https://download.pytorch.org/whl/torch_stable.html
- name: Reset git
run: |
git reset --hard
- name: Install PySyft dependencies
run: |
pip install -r requirements.dev.txt
pip install -e .
- name: Run benchmarks
run: |
pytest tests/benchmarks/pytest_benchmarks/bench_test.py --cov-fail-under 0 --benchmark-json tests/benchmarks/pytest_benchmarks/pytest_benchmarks_output.json
- name: Store benchmark result
uses: rhysd/github-action-benchmark@v1
with:
name: Pytest-benchmarks
tool: "pytest"
output-file-path: tests/benchmarks/pytest_benchmarks/pytest_benchmarks_output.json
github-token: ${{ secrets.GITHUB_TOKEN }}
auto-push: true
# Show alert with commit comment on detecting possible performance regression
alert-threshold: "200%"
comment-on-alert: true
fail-on-alert: true
85 changes: 85 additions & 0 deletions .github/workflows/merge_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Merge Tests
# Once PR tests have passed and we attempt to merge, we run these tests which are more
# comprehensive but very slow. The primary difference is the `pytest -m slow` tests.
# Because the linting and notebook checks have already passed in the PR tests we don't
# need them here. In addition, we skip MacOS on merge to dev as this happens frequently
# and the differences between Ubuntu and MacOS are minimal compared with the higher
# time unit cost of MacOS tests. Finally if we are merging with master we run the MacOS
# tests as well.
name: Merge Tests

on:
push:
branches:
- master
- dev
paths:
- "**.py"
- "setup.cfg"
- "**.txt"
- ".github/workflows/**.yml"
workflow_dispatch:
inputs:
none:
description: "Run Merge Tests Manually"
required: false

jobs:
python-tests-all:
strategy:
max-parallel: 30
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
torch-version: [1.6.0, 1.7.1, 1.8.0]
isMaster:
- ${{ contains(github.ref, 'master') }}
exclude:
- python-version: 3.9
torch-version: 1.6.0
- python-version: 3.9
torch-version: 1.7.1
- isMaster: false
os: macos-latest

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Upgrade pip
run: |
pip install --upgrade --user pip
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: Install PyTorch
run: |
pip install packaging --default-timeout=60
python scripts/adjust_torch_versions.py ./requirements.torch.txt ${{ matrix.torch-version }}
cat ./requirements.torch.txt
pip install -r requirements.torch.txt --no-deps -f https://download.pytorch.org/whl/torch_stable.html --default-timeout=60
- name: Install packages
run: |
pip install -r requirements.dev.txt --default-timeout=60
pip install -e . --default-timeout=60
- name: Run torch tests
run: |
pytest -m torch -n auto -p no:benchmark

0 comments on commit 5755b1f

Please sign in to comment.