Skip to content

Commit

Permalink
Branch was auto-updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Jan 13, 2021
2 parents 469fd00 + 83b1ff4 commit 2e65f6a
Show file tree
Hide file tree
Showing 83 changed files with 696 additions and 492 deletions.
12 changes: 0 additions & 12 deletions .github/prepare-nightly_pkg-name.py

This file was deleted.

12 changes: 6 additions & 6 deletions .github/prepare-nightly_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
import os
import re

PATH_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
_PATH_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
_PATH_INIT = os.path.join(_PATH_ROOT, 'pytorch_lightning', '__init__.py')

# get today date
now = datetime.datetime.now()
now_date = now.strftime("%Y%m%d")
PATH_INIT = os.path.join(PATH_ROOT, 'pytorch_lightning', '__init__.py')
print(f"prepare init '{PATH_INIT}' - replace version by {now_date}")
with open(PATH_INIT, 'r') as fp:
print(f"prepare init '{_PATH_INIT}' - replace version by {now_date}")
with open(_PATH_INIT, 'r') as fp:
init = fp.read()
init = re.sub(r'__version__ = [\d\.rc\'"]+', f'__version__ = "{now_date}"', init)
with open(PATH_INIT, 'w') as fp:
init = re.sub(r'__version__ = [\d\.\w\'"]+', f'__version__ = "{now_date}"', init)
with open(_PATH_INIT, 'w') as fp:
fp.write(init)
2 changes: 1 addition & 1 deletion .github/workflows/ci_dockers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
- "environment.yml"
- "requirements.txt"
- ".github/workflows/ci_dockers.yml"
- ".github/workflows/nightly.yml"
- ".github/workflows/events-nightly.yml"
- ".github/workflows/release-docker.yml"
- "setup.py"

Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/ci_pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Install pkg
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]

Expand All @@ -27,13 +27,13 @@ jobs:

- name: Prepare env
run: |
pip install check-manifest "twine==1.13.0"
pip install check-manifest "twine==3.2" setuptools wheel
- name: Create package
run: |
check-manifest
# python setup.py check --metadata --strict
python setup.py sdist
python setup.py sdist bdist_wheel
- name: Check package
run: |
Expand All @@ -46,12 +46,18 @@ jobs:
# this is just a hotfix because of Win cannot install it directly
pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
- name: Install package
- name: Install | Uninstall package - archive
run: |
# install as archive
pip install dist/*.tar.gz
cd ..
python -c "import pytorch_lightning as pl ; print(pl.__version__)"
pip uninstall -y pytorch-lightning
- name: Install | Uninstall package - wheel
run: |
# pip install virtualenv
# virtualenv vEnv --system-site-packages
# source vEnv/bin/activate
pip install dist/*
cd .. & python -c "import pytorch_lightning as pl ; print(pl.__version__)"
# deactivate
# rm -rf vEnv
# install as wheel
pip install dist/*.whl
cd ..
python -c "import pytorch_lightning as pl ; print(pl.__version__)"
pip uninstall -y pytorch-lightning
2 changes: 1 addition & 1 deletion .github/workflows/ci_test-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI basic testing
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: PyTorch & Conda
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI complete testing
# see: https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_test-tpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: TPU tests

on:
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
# TODO: temporal disable TPU testing until we find way how to pass credentials to forked PRs
# pull_request:
# branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: "Check Code Format"

on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]

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 @@ -3,7 +3,7 @@ name: "Docs check"

on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]

Expand Down
File renamed without changes.
26 changes: 26 additions & 0 deletions .github/workflows/events-ocasional.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Ocasional events

on:
push:
branches: [master, "release/*"]
pull_request_target: {}

jobs:

# autoupdate is a GitHub Action that auto-updates pull requests branches whenever changes land on their destination branch.
# see: https://github.com/marketplace/actions/auto-update
pr-auto-update:
name: Auto-update PR
runs-on: ubuntu-18.04
steps:
- uses: docker://chinthakagodawita/autoupdate-action:v1
# todo: this shall be resolved with https://github.com/chinthakagodawita/autoupdate/issues/100
continue-on-error: true
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
DRY_RUN: "false"
PR_FILTER: "labelled"
PR_LABELS: "0:] Ready-To-Go"
MERGE_MSG: "Branch was auto-updated."
RETRY_COUNT: "3"
RETRY_SLEEP: "500"
23 changes: 23 additions & 0 deletions .github/workflows/events-recurrent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Recurrent events

on:
push: {}
pull_request:
types: [synchronize]
pull_request_target: {}

jobs:

# This label will then be managed by this action.
# It will be added to PRs with merge conflicts and removed from PRs without conflicts.
# https://github.com/mschilde/auto-label-merge-conflicts
pr-label-conflicts:
name: Label PR conflits
runs-on: ubuntu-20.04
steps:
- uses: mschilde/[email protected]
with:
CONFLICT_LABEL_NAME: "has conflicts"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAX_RETRIES: 3
WAIT_MS: 5000
2 changes: 1 addition & 1 deletion .github/workflows/release-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Publish Docker Releases
# https://github.com/docker/build-push-action
on:
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
release:
types: [created]

Expand Down
39 changes: 28 additions & 11 deletions .github/workflows/release-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,15 @@ name: PyPI Release
# https://help.github.com/en/actions/reference/events-that-trigger-workflows
on: # Trigger the workflow on push or pull request, but only for the master branch
push:
branches: [master, "release/*"] # include release branches like release/1.0.x
branches: [master, "release/*"]
release:
types: [created]


jobs:
# based on https://github.com/pypa/gh-action-pypi-publish
build-publish:
build-package:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
Expand All @@ -28,6 +27,16 @@ jobs:
python setup.py sdist bdist_wheel
ls -lh dist/
- uses: actions/upload-artifact@v2
with:
name: pypi-packages
path: dist

publish-package:
runs-on: ubuntu-20.04
needs: build-package
steps:
- uses: actions/checkout@v2
- name: Upload to release
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
uses: svenstaro/upload-release-action@v2
Expand Down Expand Up @@ -62,6 +71,14 @@ jobs:
user: __token__
password: ${{ secrets.pypi_password }}

create-legacy-ckpt:
runs-on: ubuntu-20.04
needs: [build-package, publish-package]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.7
# 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
- name: Cache pip
Expand All @@ -74,7 +91,6 @@ jobs:
- name: Install dependencies
run: |
pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
pip install virtualenv
pip install awscli
- name: Configure AWS credentials
Expand All @@ -84,25 +100,26 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY_ID }}
aws-region: us-east-1

- uses: actions/download-artifact@v2
with:
name: pypi-packages
path: dist

- name: Pull files from S3
run: |
aws s3 cp --recursive s3://pl-public-data/legacy/checkpoints/ legacy/checkpoints/ # --acl public-read
ls -l legacy/checkpoints/
- name: Generate checkpoint
if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
# if: startsWith(github.event.ref, 'refs/tags') || github.event_name == 'release'
run: |
virtualenv vEnv --system-site-packages
source vEnv/bin/activate
pip install dist/*
ls -lh dist/
pip install dist/*.whl
pl_ver=$(python -c "import pytorch_lightning as pl ; print(pl.__version__)" 2>&1)
# generate checkpoint to this version
bash legacy/generate_checkpoints.sh $pl_ver
deactivate
rm -rf vEnv
- name: Push files to S3
run: |
aws s3 sync legacy/checkpoints/ s3://pl-public-data/legacy/checkpoints/
Expand Down
12 changes: 5 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,18 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Added

- Add automatic optimization property setter to lightning module ([#5169](https://github.com/PyTorchLightning/pytorch-lightning/pull/5169))

### Changed


### Deprecated


### Removed

- Changed deprecated `enable_pl_optimizer=True` ([#5244](https://github.com/PyTorchLightning/pytorch-lightning/pull/5244))

### Fixed

- Fixed `transfer_batch_to_device` for DDP with `len(devices_ids) == 1` ([#5195](https://github.com/PyTorchLightning/pytorch-lightning/pull/5195))

- Logging only on `not should_accumulate()` during training ([#5417](https://github.com/PyTorchLightning/pytorch-lightning/pull/5417))
- Resolve interpolation bug with Hydra ([#5406](https://github.com/PyTorchLightning/pytorch-lightning/pull/5406))
- Check environ before selecting a seed to prevent warning message ([#4743](https://github.com/PyTorchLightning/pytorch-lightning/pull/4743))


## [1.1.3] - 2021-01-05
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2018-2020 William Falcon
Copyright 2018-2021 William Falcon

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ with tempfile.NamedTemporaryFile(suffix='.onnx', delete=False) as tmpfile:
```python
class LitAutoEncoder(pl.LightningModule):
def training_step(self, batch, batch_idx, opt_idx):
(opt_a, opt_b) = self.optimizers()
# access your optimizers with use_pl_optimizer=False. Default is True
(opt_a, opt_b) = self.optimizers(use_pl_optimizer=True)

loss_a = ...
self.manual_backward(loss_a, opt_a)
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/test_sharded_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ def train_dataloader(self):
class SeedTrainLoaderManualModel(SeedTrainLoaderModel):
def training_step(self, batch, batch_idx, optimizer_idx):
# manual
(opt_a, opt_b) = self.optimizers()
# access your optimizers with use_pl_optimizer=False. Default is True
(opt_a, opt_b) = self.optimizers(use_pl_optimizer=True)
loss_1 = self.step(batch)

self.manual_backward(loss_1, opt_a)
Expand Down
1 change: 1 addition & 0 deletions docs/source/governance.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Core Maintainers
- Jeff Yang (`ydcjeff <https://github.com/ydcjeff>`_)
- Roger Shieh (`s-rog <https://github.com/s-rog>`_)
- Carlos Mocholí (`carmocca <https://github.com/carmocca>`_)
- Ananth Subramaniam (`ananthsub <https://github.com/ananthsub>`_)
2 changes: 1 addition & 1 deletion docs/source/multi_gpu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ project module) you can use the following method:
.. code-block:: python
# train on 8 GPUs (same machine (ie: node))
trainer = Trainer(gpus=8, accelerator='ddp')
trainer = Trainer(gpus=8, accelerator='ddp_spawn')
We STRONGLY discourage this use because it has limitations (due to Python and PyTorch):

Expand Down
3 changes: 2 additions & 1 deletion docs/source/new-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ Now you own the train loop!
.. code-block:: python
def training_step(self, batch, batch_idx, opt_idx):
(opt_a, opt_b, opt_c) = self.optimizers()
# access your optimizers with use_pl_optimizer=False. Default is True
(opt_a, opt_b, opt_c) = self.optimizers(use_pl_optimizer=True)
loss_a = self.generator(batch[0])
Expand Down
Loading

0 comments on commit 2e65f6a

Please sign in to comment.