diff --git a/.azure/gpu-tests-lite.yml b/.azure/gpu-tests-lite.yml index 5fcde1baaeed2d..ceb4c671cfe227 100644 --- a/.azure/gpu-tests-lite.yml +++ b/.azure/gpu-tests-lite.yml @@ -78,6 +78,13 @@ jobs: python -c "import torch ; mgpu = torch.cuda.device_count() ; assert mgpu == 2, f'GPU: {mgpu}'" displayName: 'Env details' + - bash: python -m coverage run --source lightning_lite -m pytest --ignore benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50 + env: + PL_RUN_CUDA_TESTS: "1" + workingDirectory: tests/tests_lite + displayName: 'Testing: Lite standard' + timeoutInMinutes: "10" + - bash: bash run_standalone_tests.sh workingDirectory: tests/tests_lite env: @@ -85,3 +92,19 @@ jobs: PL_STANDALONE_TESTS_SOURCE: "lightning_lite" displayName: 'Testing: Lite standalone tests' timeoutInMinutes: "10" + + - bash: | + python -m coverage report + python -m coverage xml + python -m coverage html + python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure + ls -l + workingDirectory: tests/tests_lite + displayName: 'Statistics' + + - task: PublishTestResults@2 + displayName: 'Publish test results' + inputs: + testResultsFiles: '$(Build.StagingDirectory)/test-results.xml' + testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)' + condition: succeededOrFailed() diff --git a/.azure/gpu-tests-pytorch.yml b/.azure/gpu-tests-pytorch.yml index f4816ce7046767..05571269a99a74 100644 --- a/.azure/gpu-tests-pytorch.yml +++ b/.azure/gpu-tests-pytorch.yml @@ -93,16 +93,6 @@ jobs: python ./requirements/pytorch/adjust-versions.py requirements/pytorch/examples.txt ${PYTORCH_VERSION} displayName: 'Adjust dependencies' - - bash: | - pip install -e . --find-links ${TORCH_URL} - git checkout -- setup.py MANIFEST.in - env: - PACKAGE_NAME: "lite" - FREEZE_REQUIREMENTS: "1" - # Lite shall have pin version, so to keep development aligned we need to install lite from source not from pypi - # also installing from source not from on-the-fly created package to prevent accidental interaction with cache - displayName: 'Install Lite pkg' - - bash: pip install -e .[strategies] -r requirements/pytorch/devel.txt -r requirements/pytorch/examples.txt --find-links ${TORCH_URL} env: PACKAGE_NAME: "pytorch" @@ -130,6 +120,20 @@ jobs: python requirements/pytorch/check-avail-extras.py displayName: 'Env details' + - bash: bash .actions/pull_legacy_checkpoints.sh + displayName: 'Get legacy checkpoints' + + - bash: python -m pytest pytorch_lightning + workingDirectory: src + displayName: 'Testing: PyTorch doctests' + + - bash: python -m coverage run --source pytorch_lightning -m pytest --ignore benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50 + env: + PL_RUN_CUDA_TESTS: "1" + workingDirectory: tests/tests_pytorch + displayName: 'Testing: PyTorch standard' + timeoutInMinutes: "35" + - bash: bash run_standalone_tests.sh workingDirectory: tests/tests_pytorch env: @@ -138,3 +142,44 @@ jobs: PL_STANDALONE_TESTS_SOURCE: "pytorch_lightning" displayName: 'Testing: PyTorch standalone tests' timeoutInMinutes: "35" + + - bash: bash run_standalone_tasks.sh + workingDirectory: tests/tests_pytorch + env: + PL_USE_MOCKED_MNIST: "1" + PL_RUN_CUDA_TESTS: "1" + displayName: 'Testing: PyTorch standalone tasks' + timeoutInMinutes: "10" + + - bash: | + python -m coverage report + python -m coverage xml + python -m coverage html + python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure + ls -l + workingDirectory: tests/tests_pytorch + displayName: 'Statistics' + + - task: PublishTestResults@2 + displayName: 'Publish test results' + inputs: + testResultsFiles: '$(Build.StagingDirectory)/test-results.xml' + testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)' + condition: succeededOrFailed() + + - script: | + set -e + bash run_ddp_examples.sh + bash run_pl_examples.sh --trainer.accelerator=gpu --trainer.devices=1 + bash run_pl_examples.sh --trainer.accelerator=gpu --trainer.devices=2 --trainer.strategy=ddp + bash run_pl_examples.sh --trainer.accelerator=gpu --trainer.devices=2 --trainer.strategy=ddp --trainer.precision=16 + workingDirectory: examples + env: + PL_USE_MOCKED_MNIST: "1" + displayName: 'Testing: PyTorch examples' + + - bash: python -m pytest benchmarks -v --maxfail=2 --durations=0 + workingDirectory: tests/tests_pytorch + env: + PL_RUN_CUDA_TESTS: "1" + displayName: 'Testing: PyTorch benchmarks'