Skip to content

Commit ae92cb2

Browse files
committed
Test CI error
1 parent f34ee7e commit ae92cb2

File tree

2 files changed

+63
-41
lines changed

2 files changed

+63
-41
lines changed

.azure-pipelines/gpu-tests.yml

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -74,46 +74,46 @@ jobs:
7474
displayName: 'Get legacy checkpoints'
7575
7676
- bash: |
77-
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
77+
python -m coverage run --source pytorch_lightning -m pytest tests/accelerators/test_ddp.py tests/models/test_hooks.py -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
7878
displayName: 'Testing: standard'
7979
80-
- bash: |
81-
bash tests/special_tests.sh
82-
displayName: 'Testing: special'
83-
84-
- bash: |
85-
python -m coverage report
86-
python -m coverage xml
87-
python -m coverage html
88-
python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure
89-
ls -l
90-
displayName: 'Statistics'
91-
92-
- task: PublishTestResults@2
93-
displayName: 'Publish test results'
94-
inputs:
95-
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
96-
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
97-
condition: succeededOrFailed()
98-
99-
- task: PublishCodeCoverageResults@1
100-
displayName: 'Publish coverage report'
101-
inputs:
102-
codeCoverageTool: 'cobertura'
103-
summaryFileLocation: 'coverage.xml'
104-
reportDirectory: '$(Build.SourcesDirectory)/htmlcov'
105-
testRunTitle: '$(Agent.OS) - $(Build.BuildNumber)[$(Agent.JobName)] - Python $(python.version)'
106-
condition: succeededOrFailed()
107-
108-
- bash: |
109-
python -m pytest benchmarks -v --maxfail=2 --durations=0
110-
displayName: 'Testing: benchmarks'
111-
112-
- script: |
113-
set -e
114-
python -m pytest pl_examples -v --maxfail=2 --durations=0
115-
bash pl_examples/run_examples-args.sh --trainer.gpus 1 --trainer.max_epochs 1 --data.batch_size 64 --trainer.limit_train_batches 5 --trainer.limit_val_batches 3
116-
bash pl_examples/run_ddp-examples.sh --trainer.max_epochs 1 --data.batch_size 32 --trainer.limit_train_batches 2 --trainer.limit_val_batches 2
117-
env:
118-
PL_USE_MOCKED_MNIST: "1"
119-
displayName: 'Examples'
80+
#- bash: |
81+
# bash tests/special_tests.sh
82+
# displayName: 'Testing: special'
83+
#
84+
#- bash: |
85+
# python -m coverage report
86+
# python -m coverage xml
87+
# python -m coverage html
88+
# python -m codecov --token=$(CODECOV_TOKEN) --commit=$(Build.SourceVersion) --flags=gpu,pytest --name="GPU-coverage" --env=linux,azure
89+
# ls -l
90+
# displayName: 'Statistics'
91+
#
92+
#- task: PublishTestResults@2
93+
# displayName: 'Publish test results'
94+
# inputs:
95+
# testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
96+
# testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
97+
# condition: succeededOrFailed()
98+
#
99+
#- task: PublishCodeCoverageResults@1
100+
# displayName: 'Publish coverage report'
101+
# inputs:
102+
# codeCoverageTool: 'cobertura'
103+
# summaryFileLocation: 'coverage.xml'
104+
# reportDirectory: '$(Build.SourcesDirectory)/htmlcov'
105+
# testRunTitle: '$(Agent.OS) - $(Build.BuildNumber)[$(Agent.JobName)] - Python $(python.version)'
106+
# condition: succeededOrFailed()
107+
#
108+
#- bash: |
109+
# python -m pytest benchmarks -v --maxfail=2 --durations=0
110+
# displayName: 'Testing: benchmarks'
111+
#
112+
#- script: |
113+
# set -e
114+
# python -m pytest pl_examples -v --maxfail=2 --durations=0
115+
# bash pl_examples/run_examples-args.sh --trainer.gpus 1 --trainer.max_epochs 1 --data.batch_size 64 --trainer.limit_train_batches 5 --trainer.limit_val_batches 3
116+
# bash pl_examples/run_ddp-examples.sh --trainer.max_epochs 1 --data.batch_size 32 --trainer.limit_train_batches 2 --trainer.limit_val_batches 2
117+
# env:
118+
# PL_USE_MOCKED_MNIST: "1"
119+
# displayName: 'Examples'

tests/models/test_hooks.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,28 @@ def _predict_batch(trainer, model, batches):
378378
return out
379379

380380

381+
@RunIf(deepspeed=True, min_gpus=1)
382+
def test_ci_bug(tmpdir):
383+
called = []
384+
model = HookedModel(called)
385+
callback = HookedCallback(called)
386+
train_batches = 2
387+
val_batches = 2
388+
trainer = Trainer(
389+
default_root_dir=tmpdir,
390+
max_epochs=1,
391+
limit_train_batches=train_batches,
392+
limit_val_batches=val_batches,
393+
progress_bar_refresh_rate=0,
394+
weights_summary=None,
395+
callbacks=[callback],
396+
gpus=1,
397+
precision=16,
398+
plugins='deepspeed',
399+
)
400+
trainer.fit(model)
401+
402+
381403
@pytest.mark.parametrize(
382404
'kwargs',
383405
[

0 commit comments

Comments
 (0)