Skip to content

Commit 7732fc5

Browse files
committed
Merge remote-tracking branch 'origin/master' into TPU_device_check
# Conflicts: # CHANGELOG.md # pytorch_lightning/accelerators/tpu_backend.py # pytorch_lightning/trainer/data_loading.py # tests/models/test_tpu.py
2 parents f024a69 + 2c21f7d commit 7732fc5

File tree

129 files changed

+2858
-1066
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2858
-1066
lines changed

.circleci/config.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,8 @@ references:
3535
name: Build and push Docker image
3636
command: |
3737
gcloud --quiet auth configure-docker
38-
cd dockers/tpu-tests
39-
# TODO: How to find the GITHUB_REF in CircleCI?
40-
# $CI_PULL_REQUEST seems to be of form: https://github.com/org/repo-name/pull/11.
41-
# Grab the last bit, e.g. pull/11, convert to pull/11/head, and use it
42-
# for the GITHUB_REF so Docker can pull the latest pending code in PR.
43-
if [ -z "$CI_PULL_REQUEST" ]; then docker build --tag "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" -f Dockerfile --build-arg "TEST_IMAGE=1" .; else git_ref=$(echo "$CI_PULL_REQUEST" | sed "s/.*pytorch-lightning\///")/head && docker build --tag "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" -f Dockerfile --build-arg "TEST_IMAGE=1" --build-arg "GITHUB_REF=$git_ref" .; fi
38+
#cd dockers/tpu-tests
39+
docker build --tag "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID" -f ./dockers/tpu-tests/Dockerfile --build-arg "PYTHON_VERSION=$PYTHON_VER" .
4440
docker push "$GCR_IMAGE_PATH:$CIRCLE_WORKFLOW_JOB_ID"
4541
4642
deploy_cluster: &deploy_cluster
@@ -99,9 +95,13 @@ references:
9995
jobs:
10096

10197
TPU-tests:
98+
parameters:
99+
python:
100+
type: string
102101
docker:
103102
- image: circleci/python:3.7
104103
environment:
104+
- PYTHON_VER: << parameters.python >>
105105
- MAX_CHECKS: 240
106106
- CHECK_SPEEP: 5
107107
steps:
@@ -148,19 +148,14 @@ jobs:
148148

149149
workflows:
150150
version: 2
151-
build:
151+
tpu-tests:
152152
jobs:
153153
- build-Docs
154154
- TPU-tests:
155-
filters:
156-
branches:
157-
# https://discuss.circleci.com/t/create-separate-steps-jobs-for-pr-forks-versus-branches/13419/4
158-
#only:
159-
# # only from forks
160-
# - /^pull\/.\d+$/
161-
ignore:
162-
- master
163-
cleanup:
155+
matrix:
156+
parameters:
157+
python: ["3.6", "3.7"]
158+
tpu-cleanup:
164159
triggers:
165160
- schedule:
166161
# The cron format is:

.drone.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ steps:
4646
- pip install pip -U
4747
- pip --version
4848
- nvidia-smi
49-
#- bash ./tests/install_AMP.sh
49+
#- bash ./requirements/install_AMP.sh
5050
- apt-get update && apt-get install -y cmake
5151
- pip install -r ./requirements/base.txt --user -q --upgrade-strategy only-if-needed
5252
- pip install -r ./requirements/devel.txt --user -q --upgrade-strategy only-if-needed

.github/ISSUE_TEMPLATE/how-to-question.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ assignees: ''
99

1010
## ❓ Questions and Help
1111

12-
### Before asking:
13-
1. search the issues.
14-
2. search the docs.
12+
### Before asking:
13+
1. Try to find answers to your questions in [the Lightning Forum!](https://forums.pytorchlightning.ai/)
14+
2. Search for similar [issues](https://github.com/PyTorchLightning/pytorch-lightning/issues).
15+
3. Search the [docs](https://pytorch-lightning.readthedocs.io/en/latest/).
1516

1617
<!-- If you still can't find what you need: -->
1718

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import os
2+
import re
3+
4+
PATH_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
5+
6+
PATH_SETUP = os.path.join(PATH_ROOT, 'setup.py')
7+
print(f"rename package '{PATH_SETUP}'")
8+
with open(PATH_SETUP, 'r') as fp:
9+
setup = fp.read()
10+
setup = re.sub(r'name=[\'"]pytorch-lightning[\'"]', 'name="pytorch-lightning-nightly"', setup)
11+
with open(PATH_SETUP, 'w') as fp:
12+
fp.write(setup)

.github/prepare_nightly.py renamed to .github/prepare-nightly_version.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@
44

55
PATH_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
66

7-
PATH_SETUP = os.path.join(PATH_ROOT, 'setup.py')
8-
print(f"rename package '{PATH_SETUP}'")
9-
with open(PATH_SETUP, 'r') as fp:
10-
setup = fp.read()
11-
setup = re.sub(r'name=[\'"]pytorch-lightning[\'"]', 'name="pytorch-lightning-nightly"', setup)
12-
with open(PATH_SETUP, 'w') as fp:
13-
fp.write(setup)
14-
157
# get today date
168
now = datetime.datetime.now()
179
now_date = now.strftime("%Y%m%d")

.github/workflows/ci_dockers.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@ jobs:
1414
strategy:
1515
fail-fast: false
1616
matrix:
17-
python_version: [3.6, 3.8]
18-
pytorch_version: [1.3, 1.5, 1.7]
19-
exclude:
20-
- python_version: 3.8
21-
pytorch_version: 1.3
17+
python_version: [3.6]
18+
pytorch_version: [1.3, 1.7]
2219
steps:
2320
- name: Checkout
2421
uses: actions/checkout@v2
@@ -62,6 +59,9 @@ jobs:
6259
pytorch_version: 1.7
6360
pytorch_channel: pytorch-nightly
6461
- python_version: 3.8
62+
pytorch_version: 1.6
63+
pytorch_channel: pytorch
64+
- python_version: 3.6
6565
pytorch_version: 1.5
6666
pytorch_channel: pytorch
6767
steps:
File renamed without changes.

.github/workflows/ci_test-tpu.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ jobs:
2020
setup-build-publish-deploy:
2121
name: tpu-testing-job
2222
runs-on: ubuntu-20.04
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
python-version: [3.6, 3.7]
2327
# Timeout: https://stackoverflow.com/a/59076067/4521646
2428
timeout-minutes: 50
2529

2630
steps:
31+
- name: Set IMAGETAG
32+
run: echo "IMAGETAG=$(date +%s)_${{ matrix.python-version }}" >> $GITHUB_ENV
2733
- name: Install Go
2834
uses: actions/setup-go@v2
2935
with:
@@ -61,9 +67,9 @@ jobs:
6167
shell: bash
6268
- name: Build and Push Docker Image
6369
run: |
64-
cd dockers/tpu-tests
65-
docker build --tag "$IMAGE:$GITHUB_RUN_ID" -f Dockerfile --build-arg "GITHUB_REF=$GITHUB_REF" --build-arg "TEST_IMAGE=1" .
66-
docker push "$IMAGE:$GITHUB_RUN_ID"
70+
#cd dockers/tpu-tests
71+
docker build --tag "$IMAGE:$IMAGETAG" -f ./dockers/tpu-tests/Dockerfile --build-arg "PYTHON_VERSION=${{ matrix.python-version }}" .
72+
docker push "$IMAGE:$IMAGETAG"
6773
shell: bash
6874

6975
- name: Install jsonnet
@@ -78,7 +84,7 @@ jobs:
7884
7985
- name: Deploy the job on the kubernetes cluster
8086
run: |-
81-
job_name=$(jsonnet -J ml-testing-accelerators/ dockers/tpu-tests/tpu_test_cases.jsonnet --ext-str image=$IMAGE --ext-str image-tag=$GITHUB_RUN_ID | kubectl create -f -) && \
87+
job_name=$(jsonnet -J ml-testing-accelerators/ dockers/tpu-tests/tpu_test_cases.jsonnet --ext-str image=$IMAGE --ext-str image-tag=$IMAGETAG | kubectl create -f -) && \
8288
job_name=${job_name#job.batch/} && \
8389
job_name=${job_name% created} && \
8490
echo "Waiting on kubernetes job: $job_name in cluster: $GKE_CLUSTER" && \
@@ -99,7 +105,7 @@ jobs:
99105
# First portion is the test logs. Print these to Github Action stdout.
100106
cat xx00 && \
101107
echo "Done with log retrieval attempt." && \
102-
gcloud container images delete "$IMAGE:$GITHUB_RUN_ID" --force-delete-tags && \
108+
gcloud container images delete "$IMAGE:$IMAGETAG" --force-delete-tags && \
103109
exit $status_code
104110
shell: bash
105111

.github/workflows/docs-checks.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ jobs:
4949
pip install --requirement requirements/base.txt --upgrade-strategy only-if-needed --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
5050
pip install --requirement requirements/extra.txt
5151
pip install --requirement requirements/docs.txt
52-
python --version ; pip --version ; pip list
52+
python --version
53+
pip --version
54+
pip list
5355
shell: bash
5456

5557
- name: Test Documentation
@@ -87,7 +89,9 @@ jobs:
8789
pip install --requirement requirements/docs.txt
8890
# install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux
8991
sudo apt-get update && sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
90-
python --version ; pip --version ; pip list
92+
python --version
93+
pip --version
94+
pip list
9195
shell: bash
9296

9397
- name: Make Documentation

.github/workflows/nightly.yml

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
python -m pip install --user --upgrade setuptools wheel
2424
- name: Build
2525
run: |
26-
python .github/prepare_nightly.py
26+
python .github/prepare-nightly_version.py
2727
python setup.py sdist bdist_wheel
2828
ls -lh dist/
2929
@@ -34,12 +34,7 @@ jobs:
3434
user: __token__
3535
password: ${{ secrets.test_pypi_password }}
3636
repository_url: https://test.pypi.org/legacy/
37-
38-
- name: Publish distribution 📦 to PyPI
39-
uses: pypa/gh-action-pypi-publish@master
40-
with:
41-
user: __token__
42-
password: ${{ secrets.pypi_password }}
37+
verbose: true
4338

4439
docker-XLA:
4540
runs-on: ubuntu-20.04
@@ -52,7 +47,7 @@ jobs:
5247
- name: Checkout
5348
uses: actions/checkout@v2
5449

55-
- name: Publish Master to Docker
50+
- name: Publish XLA to Docker Hub
5651
# publish master
5752
uses: docker/[email protected]
5853
with:
@@ -88,7 +83,7 @@ jobs:
8883
- name: Checkout
8984
uses: actions/checkout@v2
9085

91-
- name: Publish Master to Docker
86+
- name: Publish CUDA to Docker Hub
9287
# publish master
9388
uses: docker/[email protected]
9489
with:
@@ -100,32 +95,7 @@ jobs:
10095
tags: "base-cuda-py${{ matrix.python_version }}-torch${{ matrix.pytorch_version }}"
10196
timeout-minutes: 55
10297

103-
104-
docker-Conda:
105-
runs-on: ubuntu-20.04
106-
strategy:
107-
fail-fast: false
108-
matrix:
109-
python_version: [ 3.6, 3.7, 3.8 ]
110-
pytorch_version: [ 1.3, 1.4, 1.5, 1.6, 1.7 ]
111-
pytorch_channel: [ "pytorch", "pytorch-nightly" ]
112-
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#example-including-new-combinations
113-
exclude:
114-
- pytorch_version: 1.7
115-
pytorch_channel: pytorch
116-
- pytorch_version: 1.3
117-
pytorch_channel: pytorch-nightly
118-
- pytorch_version: 1.4
119-
pytorch_channel: pytorch-nightly
120-
- pytorch_version: 1.5
121-
pytorch_channel: pytorch-nightly
122-
- pytorch_version: 1.6
123-
pytorch_channel: pytorch-nightly
124-
steps:
125-
- name: Checkout
126-
uses: actions/checkout@v2
127-
128-
- name: Publish Master to Docker
98+
- name: Publish Conda to Docker Hub
12999
# publish master
130100
uses: docker/[email protected]
131101
with:

0 commit comments

Comments
 (0)