diff --git a/.azure/gpu-tests-lite.yml b/.azure/gpu-tests-lite.yml index 5fcde1baaeed2..ceb4c671cfe22 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 f4816ce704676..c3cf3849a5c5b 100644 --- a/.azure/gpu-tests-pytorch.yml +++ b/.azure/gpu-tests-pytorch.yml @@ -130,6 +130,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 +152,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'