Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future 1/n: package in src/ folder #13293

Merged
merged 19 commits into from
Jun 15, 2022
16 changes: 11 additions & 5 deletions .azure-pipelines/gpu-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ jobs:
clean: all

steps:
- bash: |
python -m pytest tests/benchmarks -v --durations=0
displayName: 'Testing: benchmarks'
env:
PL_RUNNING_BENCHMARKS: 1

- bash: |
pip install -e . -r requirements/strategies.txt
pip list
displayName: 'Install package'

- bash: |
python -m pytest tests/benchmarks -v --durations=0
displayName: 'Testing: benchmarks'
env:
PL_RUNNING_BENCHMARKS: 1
20 changes: 10 additions & 10 deletions .azure-pipelines/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,12 @@ jobs:
timeoutInMinutes: "100"
# how much time to give 'run always even if cancelled tasks' before stopping them
cancelTimeoutInMinutes: "2"

pool: azure-jirka-spot

container:
image: $(image)
# default shm size is 64m. Increase it to avoid:
# 'Error while creating shared memory: unhandled system error, NCCL version 2.7.8'
options: "--runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all --shm-size=512m"

workspace:
clean: all

Expand All @@ -56,8 +53,8 @@ jobs:
python -c "fname = 'requirements/strategies.txt' ; lines = [line for line in open(fname).readlines() if 'horovod' not in line] ; open(fname, 'w').writelines(lines)"
CUDA_VERSION_MM=$(python -c "import torch ; print(''.join(map(str, torch.version.cuda.split('.')[:2])))")
pip install "bagua-cuda$CUDA_VERSION_MM>=0.9.0"
pip install . --requirement requirements/devel.txt
pip install . --requirement requirements/strategies.txt
pip install -e .[strategies]
pip install --requirement requirements/devel.txt
pip list
displayName: 'Install dependencies'

Expand All @@ -72,12 +69,15 @@ jobs:
- bash: bash .actions/pull_legacy_checkpoints.sh
displayName: 'Get legacy checkpoints'

- bash: |
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests --ignore tests/benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
displayName: 'Testing: standard'
- bash: python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning
workingDirectory: src
displayName: 'Testing: doctests'

- bash: |
bash tests/standalone_tests.sh
- bash: python -m coverage run --source pytorch_lightning -m pytest tests --ignore tests/benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
displayName: 'Testing: unittests'

- bash: bash run_standalone_tests.sh
Borda marked this conversation as resolved.
Show resolved Hide resolved
workingDirectory: test
Borda marked this conversation as resolved.
Show resolved Hide resolved
env:
PL_USE_MOCKED_MNIST: "1"
displayName: 'Testing: standalone'
Expand Down
5 changes: 1 addition & 4 deletions .azure-pipelines/hpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ jobs:
timeoutInMinutes: "10"
# how much time to give 'run always even if cancelled tasks' before stopping them
cancelTimeoutInMinutes: "2"

pool: intel-hpus

workspace:
clean: all

Expand All @@ -33,8 +31,7 @@ jobs:
displayName: 'Instance HW info'

- bash: |
pip install . --requirement requirements/extra.txt
pip install . --requirement requirements/test.txt
pip install -e .[extra,test]
displayName: 'Install dependencies'

- bash: |
Expand Down
19 changes: 12 additions & 7 deletions .azure-pipelines/ipu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
# how long to run the job before automatically cancelling
timeoutInMinutes: "15"
pool: graphcore-ipus

workspace:
clean: all

Expand Down Expand Up @@ -55,7 +54,7 @@ jobs:
export GIT_TERMINAL_PROMPT=1
python ./requirements/adjust-versions.py requirements/extra.txt
python ./requirements/adjust-versions.py requirements/examples.txt
pip install . --requirement ./requirements/devel.txt
pip install -e . --requirement ./requirements/devel.txt
pip list
displayName: 'Install dependencies'

Expand All @@ -68,16 +67,22 @@ jobs:
set -eux
source ${{ variables.poplar_sdk }}/poplar-ubuntu*/enable.sh
source ${{ variables.poplar_sdk }}/popart-ubuntu*/enable.sh

python -c "import poptorch; print(poptorch.__version__)"
displayName: "Check poptorch installation"

- bash: |
source ${{ variables.poplar_sdk }}/poplar-ubuntu*/enable.sh
source ${{ variables.poplar_sdk }}/popart-ubuntu*/enable.sh
export POPTORCH_WAIT_FOR_IPU=1
export PL_RUN_IPU_TESTS=1
python -m coverage run --source pytorch_lightning -m pytest tests -vv --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
cd src
python -m pytest pytorch_lightning
displayName: 'DocTests'
carmocca marked this conversation as resolved.
Show resolved Hide resolved

- bash: |
source ${{ variables.poplar_sdk }}/poplar-ubuntu*/enable.sh
source ${{ variables.poplar_sdk }}/popart-ubuntu*/enable.sh
python -m coverage run --source pytorch_lightning -m pytest tests -vv --durations=50
env:
MKL_THREADING_LAYER: "GNU"
displayName: 'Testing: standard'
POPTORCH_WAIT_FOR_IPU: 1
PL_RUN_IPU_TESTS: 1
displayName: 'UnitTests'
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ references:
# the image uses python 2.7 by default, force a different version
pyenv global 3.7.3
python --version
pip install -r requirements/docs.txt
pip install -e . -r requirements/docs.txt
pip list
cd docs
make clean
Expand Down
52 changes: 26 additions & 26 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -22,35 +22,35 @@
/docs/source/expertise_levels @williamfalcon @RobertLaurella

# Packages
/pytorch_lightning/accelerators @williamfalcon @tchaton @SeanNaren @awaelchli @justusschock @kaushikb11
/pytorch_lightning/callbacks @williamfalcon @tchaton @carmocca @borda @kaushikb11
/pytorch_lightning/core @tchaton @SeanNaren @borda @carmocca @justusschock @kaushikb11
/pytorch_lightning/distributed @williamfalcon @tchaton @awaelchli @kaushikb11
/pytorch_lightning/lite @tchaton @awaelchli @carmocca
/pytorch_lightning/loggers @tchaton @awaelchli @borda
/pytorch_lightning/loggers/wandb.py @borisdayma
/pytorch_lightning/loggers/neptune.py @shnela @HubertJaworski @pkasprzyk @pitercl @Raalsky @aniezurawski @kamil-kaczmarek
/pytorch_lightning/loops @tchaton @awaelchli @justusschock @carmocca
/pytorch_lightning/overrides @tchaton @SeanNaren @borda
/pytorch_lightning/plugins @tchaton @SeanNaren @awaelchli @justusschock
/pytorch_lightning/profiler @williamfalcon @tchaton @borda @carmocca
/pytorch_lightning/profiler/pytorch.py @nbcsm @guotuofeng
/pytorch_lightning/strategies @tchaton @SeanNaren @awaelchli @justusschock @kaushikb11
/pytorch_lightning/trainer @williamfalcon @borda @tchaton @SeanNaren @carmocca @awaelchli @justusschock @kaushikb11
/pytorch_lightning/trainer/connectors @tchaton @SeanNaren @carmocca @borda
/pytorch_lightning/tuner @SkafteNicki @borda @awaelchli
/pytorch_lightning/utilities @borda @tchaton @SeanNaren @carmocca
/src/pytorch_lightning/accelerators @williamfalcon @tchaton @SeanNaren @awaelchli @justusschock @kaushikb11
/src/pytorch_lightning/callbacks @williamfalcon @tchaton @carmocca @borda @kaushikb11
/src/pytorch_lightning/core @tchaton @SeanNaren @borda @carmocca @justusschock @kaushikb11
/src/pytorch_lightning/distributed @williamfalcon @tchaton @awaelchli @kaushikb11
/src/pytorch_lightning/lite @tchaton @awaelchli @carmocca
/src/pytorch_lightning/loggers @tchaton @awaelchli @borda
/src/pytorch_lightning/loggers/wandb.py @borisdayma
/src/pytorch_lightning/loggers/neptune.py @shnela @HubertJaworski @pkasprzyk @pitercl @Raalsky @aniezurawski @kamil-kaczmarek
/src/pytorch_lightning/loops @tchaton @awaelchli @justusschock @carmocca
/src/pytorch_lightning/overrides @tchaton @SeanNaren @borda
/src/pytorch_lightning/plugins @tchaton @SeanNaren @awaelchli @justusschock
/src/pytorch_lightning/profiler @williamfalcon @tchaton @borda @carmocca
/src/pytorch_lightning/profiler/pytorch.py @nbcsm @guotuofeng
/src/pytorch_lightning/strategies @tchaton @SeanNaren @awaelchli @justusschock @kaushikb11
/src/pytorch_lightning/trainer @williamfalcon @borda @tchaton @SeanNaren @carmocca @awaelchli @justusschock @kaushikb11
/src/pytorch_lightning/trainer/connectors @tchaton @SeanNaren @carmocca @borda
/src/pytorch_lightning/tuner @SkafteNicki @borda @awaelchli
/src/pytorch_lightning/utilities @borda @tchaton @SeanNaren @carmocca

# Specifics
/pytorch_lightning/trainer/connectors/logger_connector @tchaton @carmocca
/pytorch_lightning/trainer/progress.py @tchaton @awaelchli @carmocca
/src/pytorch_lightning/trainer/connectors/logger_connector @tchaton @carmocca
/src/pytorch_lightning/trainer/progress.py @tchaton @awaelchli @carmocca

# API
/pytorch_lightning/callbacks/base.py @williamfalcon @awaelchli @ananthsub @carmocca
/pytorch_lightning/core/datamodule.py @williamFalcon @awaelchli @ananthsub @carmocca
/pytorch_lightning/trainer/trainer.py @williamfalcon @tchaton @awaelchli
/pytorch_lightning/core/hooks.py @williamfalcon @tchaton @awaelchli @ananthsub @carmocca
/pytorch_lightning/core/lightning.py @williamfalcon @tchaton @awaelchli
/src/pytorch_lightning/callbacks/base.py @williamfalcon @awaelchli @ananthsub @carmocca
/src/pytorch_lightning/core/datamodule.py @williamFalcon @awaelchli @ananthsub @carmocca
/src/pytorch_lightning/trainer/trainer.py @williamfalcon @tchaton @awaelchli
/src/pytorch_lightning/core/hooks.py @williamfalcon @tchaton @awaelchli @ananthsub @carmocca
/src/pytorch_lightning/core/lightning.py @williamfalcon @tchaton @awaelchli

# Testing
/tests/helpers/boring_model.py @williamfalcon @tchaton @borda
Expand All @@ -60,4 +60,4 @@
/SECURITY.md @williamfalcon
/README.md @williamfalcon @edenlightning @borda
/setup.py @williamfalcon @borda @carmocca
/pytorch_lightning/__about__.py @williamfalcon @borda @carmocca
/src/pytorch_lightning/__about__.py @williamfalcon @borda @carmocca
14 changes: 8 additions & 6 deletions .github/workflows/ci_pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,19 @@ jobs:
pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html

- name: Install | Uninstall package - archive
working-directory: ./dist
run: |
# install as archive
pip install dist/*.tar.gz
pip install *.tar.gz
cd ..
python -c "import pytorch_lightning as pl ; print(pl.__version__)"
pip uninstall -y pytorch-lightning
python -c "import pytorch_lightning ; print(pytorch_lightning.__version__)"
pip uninstall -y pytorch_lightning

- name: Install | Uninstall package - wheel
working-directory: ./dist
run: |
# install as wheel
pip install dist/*.whl
pip install *.whl
cd ..
python -c "import pytorch_lightning as pl ; print(pl.__version__)"
pip uninstall -y pytorch-lightning
python -c "import pytorch_lightning ; print(pytorch_lightning.__version__)"
pip uninstall -y pytorch_lightning
8 changes: 4 additions & 4 deletions .github/workflows/ci_test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ jobs:
run: |
conda info
conda list
pip install -r requirements/test.txt
pip install -e .[test]

- name: DocTests
run: |
coverage run --source pytorch_lightning -m pytest pytorch_lightning
working-directory: ./src
run: pytest pytorch_lightning --cov=pytorch_lightning

- name: Update all dependencies
env:
Expand All @@ -66,7 +66,7 @@ jobs:
- name: Pull legacy checkpoints
run: bash .actions/pull_legacy_checkpoints.sh

- name: UnitTests
- name: Testing
run: |
coverage run --source pytorch_lightning -m pytest --timeout 150 tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml

Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ci_test-full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ jobs:
run: |
flag=$(python -c "print('--pre' if '${{matrix.release}}' == 'pre' else '')" 2>&1)
url=$(python -c "print('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html')" 2>&1)
pip install -r requirements.txt --upgrade $flag --find-links "https://download.pytorch.org/whl/${url}"
pip install -r requirements/test.txt --upgrade
pip install -e .[test] --upgrade $flag --find-links "https://download.pytorch.org/whl/${url}"
pip list
shell: bash

- name: DocTests
run: coverage run --source pytorch_lightning -m pytest pytorch_lightning
working-directory: ./src
run: pytest pytorch_lightning --cov=pytorch_lightning

- name: Install extra dependencies
run: |
Expand Down Expand Up @@ -123,10 +123,9 @@ jobs:
key: pl-dataset

- name: Sanity check
run: |
python requirements/check-avail-extras.py
run: python requirements/check-avail-extras.py

- name: UnitTests
- name: Testing
run: |
# NOTE: do not include coverage report here, see: https://github.com/nedbat/coveragepy/issues/1003
coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}-${{ matrix.release }}.xml
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci_test-slow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ jobs:
run: |
# adjust versions according installed Torch version
python ./requirements/adjust-versions.py requirements.txt ${{ matrix.pytorch-version }}
pip install -r requirements.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade
pip install -r requirements/test.txt
pip install -e .[test] --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --upgrade
pip list
shell: bash

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ jobs:
pip list

- name: Type check
run: mypy --install-types --non-interactive
working-directory: ./src
run: mypy -p pytorch_lightning --install-types --non-interactive --config-file ../pyproject.toml
14 changes: 6 additions & 8 deletions .github/workflows/docs-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-${{ hashFiles('requirements/base.txt') }}
key: ${{ runner.os }}-docs-test-pip-td${{ env.TIME_PERIOD }}-${{ hashFiles('requirements/*.txt') }}
restore-keys: |
${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-
${{ runner.os }}-docs-test-pip-td${{ env.TIME_PERIOD }}-

- name: Install dependencies
run: |
Expand All @@ -42,9 +42,7 @@ jobs:
pip --version
pip install -q fire
# python -m pip install --upgrade --user pip
pip install -r requirements.txt --upgrade-strategy only-if-needed --find-links https://download.pytorch.org/whl/cpu/torch_stable.html --quiet
pip install -r requirements/devel.txt
pip install -r requirements/docs.txt
pip install -e . --quiet -r requirements/docs.txt -r requirements/devel.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip list
shell: bash

Expand Down Expand Up @@ -74,16 +72,16 @@ jobs:
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements/base.txt') }}
key: ${{ runner.os }}-docs-make-pip-${{ hashFiles('requirements/base.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-docs-make-pip-

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y cmake pandoc
pip --version
pip install --requirement requirements/docs.txt
pip install -e . --quiet -r requirements/docs.txt --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
# install Texlive, see https://linuxconfig.org/how-to-install-latex-on-ubuntu-20-04-focal-fossa-linux
sudo apt-get update && sudo apt-get install -y texlive-latex-extra dvipng texlive-pictures
pip list
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ clean:
rm -rf ./docs/source/generated
rm -rf ./docs/source/*/generated
rm -rf ./docs/source/api
rm -rf *.egg-info
rm -rf src/*.egg-info

test: clean
# Review the CONTRIBUTING documentation for other ways to test.
Expand Down
3 changes: 2 additions & 1 deletion dockers/tpu-tests/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ LABEL maintainer="PyTorchLightning <https://github.com/PyTorchLightning>"
COPY ./ ./pytorch-lightning/

# Pull the legacy checkpoints
RUN cd pytorch-lightning && bash .actions/pull_legacy_checkpoints.sh
RUN cd pytorch-lightning && \
bash .actions/pull_legacy_checkpoints.sh

RUN \
pip install -q fire && \
Expand Down
Loading