Skip to content

Commit 729a7a4

Browse files
carmoccaawaelchli
authored andcommitted
Move benchmarks into the test directory (#10614)
1 parent 9a17cf9 commit 729a7a4

File tree

9 files changed

+6
-28
lines changed

9 files changed

+6
-28
lines changed

.azure-pipelines/gpu-benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
steps:
3838
- bash: |
39-
python -m pytest benchmarks -v --durations=0
39+
python -m pytest tests/benchmarks -v --durations=0
4040
displayName: 'Testing: benchmarks'
4141
env:
4242
PL_RUNNING_BENCHMARKS: 1

.azure-pipelines/gpu-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
displayName: 'Get legacy checkpoints'
6969
7070
- bash: |
71-
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
71+
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests --ignore tests/benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
7272
displayName: 'Testing: standard'
7373
7474
- bash: |
@@ -113,5 +113,5 @@ jobs:
113113
displayName: 'Testing: examples'
114114
115115
- bash: |
116-
python -m pytest benchmarks -v --maxfail=2 --durations=0
116+
python -m pytest tests/benchmarks -v --maxfail=2 --durations=0
117117
displayName: 'Testing: benchmarks'

benchmarks/__init__.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ requires = [
77

88
[tool.isort]
99
known_first_party = [
10-
"benchmarks",
1110
"docs",
1211
"pl_examples",
1312
"pytorch_lightning",
@@ -24,7 +23,7 @@ line-length = 120
2423

2524

2625
[tool.mypy]
27-
files = ["pytorch_lightning", "pl_examples", "benchmarks"]
26+
files = ["pytorch_lightning"]
2827
disallow_untyped_defs = "True"
2928
ignore_missing_imports = "True"
3029
show_error_codes = "True"
@@ -52,9 +51,6 @@ module = [
5251
"pytorch_lightning.distributed.*",
5352
"pytorch_lightning.tuner.*",
5453
"pytorch_lightning.utilities.*",
55-
"pl_examples.*",
56-
"benchmarks.*",
57-
"tests.helpers.*"
5854
]
5955
ignore_errors = "True"
6056

tests/benchmarks/__init__.py

Whitespace-only changes.

benchmarks/generate_comparison.py renamed to tests/benchmarks/generate_comparison.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import matplotlib.pylab as plt
1717
import pandas as pd
1818

19-
from benchmarks.test_basic_parity import measure_loops
19+
from tests.benchmarks.test_basic_parity import measure_loops
2020
from tests.helpers.advanced_models import ParityModuleMNIST, ParityModuleRNN
2121

2222
NUM_EPOCHS = 20

tests/special_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export PL_RUNNING_SPECIAL_TESTS=1
2020
defaults='-m coverage run --source pytorch_lightning --append -m pytest --capture=no'
2121

2222
# find tests marked as `@RunIf(special=True)`. done manually instead of with pytest because it is faster
23-
grep_output=$(grep --recursive --word-regexp 'tests' 'benchmarks' --regexp 'special=True' --include '*.py' --exclude 'tests/conftest.py')
23+
grep_output=$(grep --recursive --word-regexp 'tests' --regexp 'special=True' --include '*.py' --exclude 'tests/conftest.py')
2424

2525
# file paths, remove duplicates
2626
files=$(echo "$grep_output" | cut -f1 -d: | sort | uniq)

0 commit comments

Comments
 (0)