Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…lightning into add-typing
  • Loading branch information
aniketmaurya committed May 11, 2021
2 parents 132d2d6 + 8538c1f commit 29d8c36
Show file tree
Hide file tree
Showing 118 changed files with 2,006 additions and 1,741 deletions.
8 changes: 7 additions & 1 deletion .azure-pipelines/ipu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ jobs:
- bash: |
export GIT_TERMINAL_PROMPT=1
pip install --requirement requirements.txt
python -c "fname = 'requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if 'fairscale' not in line] ; open(fname, 'w').writelines(lines)"
python -c "fname = 'requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if 'horovod' not in line] ; open(fname, 'w').writelines(lines)"
python ./requirements/adjust_versions.py requirements/extra.txt
python ./requirements/adjust_versions.py requirements/examples.txt
pip install --requirement ./requirements/devel.txt --upgrade-strategy only-if-needed
pip list
displayName: 'Install dependencies'
Expand Down Expand Up @@ -82,4 +86,6 @@ jobs:
source ${{ variables.poplar_sdk }}/popart-ubuntu*/enable.sh
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
env:
MKL_THREADING_LAYER: "GNU"
displayName: 'Testing: standard'
2 changes: 1 addition & 1 deletion .github/BECOMING_A_CORE_CONTRIBUTOR.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ The goal is to be inline with expectations for solving issues by the last one so
- Create 5+ meaningful PRs which solves some reported issue - bug,
- Perform 10+ PR reviews from other contributors.

If you want to be considered, ping me on [Slack](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-f6bl2l0l-JYMK3tbAgAmGRrlNr00f1A).
If you want to be considered, ping me on [Slack](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-pw5v393p-qRaDgEk24~EjiZNBpSQFgQ).
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ _**Note**, even if you do not find the solution, sending a PR with a test coveri

Want to keep Lightning healthy? Love seeing those green tests? So do we! How to we keep it that way? We write tests! We value tests contribution even more than new features.

Most of the tests in PyTorch Lightning train a trial MNIST model under various trainer conditions (ddp, ddp2+amp, etc...). The tests expect the model to perform to a reasonable degree of testing accuracy to pass. Want to add a new test case and not sure how? [Talk to us!](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-f6bl2l0l-JYMK3tbAgAmGRrlNr00f1A)
Most of the tests in PyTorch Lightning train a trial MNIST model under various trainer conditions (ddp, ddp2+amp, etc...). The tests expect the model to perform to a reasonable degree of testing accuracy to pass. Want to add a new test case and not sure how? [Talk to us!](https://join.slack.com/t/pytorch-lightning/shared_invite/zt-pw5v393p-qRaDgEk24~EjiZNBpSQFgQ)

---

Expand Down
18 changes: 18 additions & 0 deletions .github/prune-packages.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import sys
from pprint import pprint


def main(req_file: str, *pkgs):
with open(req_file, 'r') as fp:
lines = fp.readlines()

for pkg in pkgs:
lines = [ln for ln in lines if not ln.startswith(pkg)]
pprint(lines)

with open(req_file, 'w') as fp:
fp.writelines(lines)


if __name__ == "__main__":
main(*sys.argv[1:])
17 changes: 17 additions & 0 deletions .github/set-min-requirements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
requirement_fnames = (
'requirements.txt',
'requirements/extra.txt',
'requirements/loggers.txt',
'requirements/test.txt',
'requirements/examples.txt',
)


def replace_min(fname: str):
req = open(fname).read().replace('>=', '==')
open(fname, 'w').write(req)


if __name__ == '__main__':
for fname in requirement_fnames:
replace_min(fname)
33 changes: 33 additions & 0 deletions .github/workflows/ci_dockers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,3 +149,36 @@ jobs:
file: dockers/nvidia/Dockerfile
push: false
timeout-minutes: 50

build-ipu:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- python_version: 3.8
pytorch_version: 1.7
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Build IPU Docker
uses: docker/build-push-action@v2
with:
build-args: |
PYTHON_VERSION=${{ matrix.python_version }}
PYTORCH_VERSION=${{ matrix.pytorch_version }}
file: dockers/base-ipu/Dockerfile
push: false
tags: pytorchlightning/pytorch_lightning:base-ipu-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}
timeout-minutes: 50

- name: Build IPU CI runner Docker
uses: docker/build-push-action@v2
with:
build-args: |
PYTHON_VERSION=${{ matrix.python_version }}
PYTORCH_VERSION=${{ matrix.pytorch_version }}
file: dockers/ipu-ci-runner/Dockerfile
push: false
timeout-minutes: 50
25 changes: 5 additions & 20 deletions .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:

- name: Update pip
run: |
# todo: unfreeze PIP after resolving minimal dependencies
pip install --quiet "pip==20.1" --upgrade --user # needed for get pip cacher folder
# needed for `pip cache` command
pip install --quiet "pip==20.2" --upgrade --user
# Github Actions: Run step on specific OS: https://stackoverflow.com/a/57948488/4521646
- name: Setup macOS
Expand All @@ -56,11 +56,7 @@ jobs:
- name: Setup Windows
if: runner.os == 'windows'
run: |
# remove Horovod from requirements
fname = 'requirements/extra.txt'
lines = [line for line in open(fname).readlines() if not line.startswith('horovod')]
open(fname, 'w').writelines(lines)
shell: python
python .github/prune-packages.py requirements/extra.txt "horovod"
# todo: re-enable when allow testing py 3.9 with min config, atm some Hydra issues
#- name: Adjust minimal for Python 3.9
Expand All @@ -78,18 +74,7 @@ jobs:
- name: Set min. dependencies
if: matrix.requires == 'minimal'
run: |
files = (
'requirements.txt',
'requirements/extra.txt',
'requirements/loggers.txt',
'requirements/test.txt',
'requirements/examples.txt',
)
for fname in files:
req = open(fname).read().replace('>=', '==')
open(fname, 'w').write(req)
shell: python
python .github/set-min-requirements.py
# Note: This uses an internal pip API and may not always work
# https://github.com/actions/cache/blob/master/examples.md#multiple-oss-in-a-workflow
Expand Down Expand Up @@ -120,7 +105,7 @@ jobs:
if: matrix.python-version == 3.9
run: |
# pip uninstall -y horovod
python -c "fname = 'requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if not line.startswith('horovod')] ; open(fname, 'w').writelines(lines)"
python .github/prune-packages.py requirements/extra.txt "horovod"
- name: Install dependencies
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
python --version
pip --version
# remove Horovod from requirements
python -c "fname = 'requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if not line.startswith('horovod')] ; open(fname, 'w').writelines(lines)"
python .github/prune-packages.py requirements/extra.txt "horovod"
# python -m pip install --upgrade --user pip
pip install --requirement requirements.txt --upgrade-strategy only-if-needed --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
pip install --requirement requirements/extra.txt
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/events-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,49 @@ jobs:
push: true
tags: nvcr.io/pytorchlightning/pytorch_lightning:nvidia
timeout-minutes: 55

docker-ipu:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- python_version: 3.8
pytorch_version: 1.7

steps:
- name: Checkout
uses: actions/checkout@v2

# https://github.com/docker/setup-buildx-action
# Set up Docker Buildx - to use cache-from and cache-to argument of buildx command
- uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Publish IPU base to Docker Hub
# publish master/release
uses: docker/build-push-action@v2
with:
build-args: |
PYTHON_VERSION=${{ matrix.python_version }}
PYTORCH_VERSION=${{ matrix.pytorch_version }}
file: dockers/base-ipu/Dockerfile
push: true
tags: pytorchlightning/pytorch_lightning:base-ipu-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}
timeout-minutes: 55

- name: Publish IPU CI runner to Docker Hub
# publish master/release
uses: docker/build-push-action@v2
with:
build-args: |
PYTHON_VERSION=${{ matrix.python_version }}
PYTORCH_VERSION=${{ matrix.pytorch_version }}
file: dockers/ipu-ci-runner/Dockerfile
push: true
tags: pytorchlightning/pytorch_lightning:ipu-ci-runner-py${{ matrix.python_version }}
timeout-minutes: 55
2 changes: 1 addition & 1 deletion .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
push:
branches: [master, "release/*"]
release:
types: [created, published]
types: [published]

jobs:
cuda-PL:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
push:
branches: [master, "release/*"]
release:
types: [created, published]
types: [published]


jobs:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ default_language_version:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
rev: v3.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer

- repo: https://github.com/PyCQA/isort
rev: 5.7.0
rev: 5.8.0
hooks:
- id: isort
args: [--settings-path, ./pyproject.toml]

- repo: https://github.com/pre-commit/mirrors-yapf
rev: v0.30.0
rev: v0.31.0
hooks:
- id: yapf
args: [--parallel, --in-place]
Loading

0 comments on commit 29d8c36

Please sign in to comment.