Move benchmarks into the test directory (#10614)
This commit is contained in:
parent
0de8ab4f2e
commit
5788789f01
|
@ -36,7 +36,7 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- bash: |
|
- bash: |
|
||||||
python -m pytest benchmarks -v --durations=0
|
python -m pytest tests/benchmarks -v --durations=0
|
||||||
displayName: 'Testing: benchmarks'
|
displayName: 'Testing: benchmarks'
|
||||||
env:
|
env:
|
||||||
PL_RUNNING_BENCHMARKS: 1
|
PL_RUNNING_BENCHMARKS: 1
|
||||||
|
|
|
@ -68,7 +68,7 @@ jobs:
|
||||||
displayName: 'Get legacy checkpoints'
|
displayName: 'Get legacy checkpoints'
|
||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
|
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'
|
displayName: 'Testing: standard'
|
||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
|
@ -113,5 +113,5 @@ jobs:
|
||||||
displayName: 'Testing: examples'
|
displayName: 'Testing: examples'
|
||||||
|
|
||||||
- bash: |
|
- bash: |
|
||||||
python -m pytest benchmarks -v --maxfail=2 --durations=0
|
python -m pytest tests/benchmarks -v --maxfail=2 --durations=0
|
||||||
displayName: 'Testing: benchmarks'
|
displayName: 'Testing: benchmarks'
|
||||||
|
|
|
@ -1,18 +0,0 @@
|
||||||
# Copyright The PyTorch Lightning team.
|
|
||||||
#
|
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
# you may not use this file except in compliance with the License.
|
|
||||||
# You may obtain a copy of the License at
|
|
||||||
#
|
|
||||||
# http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
#
|
|
||||||
# Unless required by applicable law or agreed to in writing, software
|
|
||||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
# See the License for the specific language governing permissions and
|
|
||||||
# limitations under the License.
|
|
||||||
import os
|
|
||||||
|
|
||||||
_BENCHMARK_ROOT = os.path.dirname(__file__)
|
|
||||||
_PROJECT_ROOT = os.path.dirname(_BENCHMARK_ROOT)
|
|
||||||
_PATH_DATASETS = os.path.join(_PROJECT_ROOT, "Datasets")
|
|
|
@ -7,7 +7,6 @@ requires = [
|
||||||
|
|
||||||
[tool.isort]
|
[tool.isort]
|
||||||
known_first_party = [
|
known_first_party = [
|
||||||
"benchmarks",
|
|
||||||
"docs",
|
"docs",
|
||||||
"pl_examples",
|
"pl_examples",
|
||||||
"pytorch_lightning",
|
"pytorch_lightning",
|
||||||
|
@ -24,7 +23,7 @@ line-length = 120
|
||||||
|
|
||||||
|
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
files = ["pytorch_lightning", "pl_examples", "benchmarks"]
|
files = ["pytorch_lightning"]
|
||||||
disallow_untyped_defs = "True"
|
disallow_untyped_defs = "True"
|
||||||
ignore_missing_imports = "True"
|
ignore_missing_imports = "True"
|
||||||
show_error_codes = "True"
|
show_error_codes = "True"
|
||||||
|
@ -53,9 +52,6 @@ module = [
|
||||||
"pytorch_lightning.distributed.*",
|
"pytorch_lightning.distributed.*",
|
||||||
"pytorch_lightning.tuner.*",
|
"pytorch_lightning.tuner.*",
|
||||||
"pytorch_lightning.utilities.*",
|
"pytorch_lightning.utilities.*",
|
||||||
"pl_examples.*",
|
|
||||||
"benchmarks.*",
|
|
||||||
"tests.helpers.*"
|
|
||||||
]
|
]
|
||||||
ignore_errors = "True"
|
ignore_errors = "True"
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import os
|
||||||
import matplotlib.pylab as plt
|
import matplotlib.pylab as plt
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
from benchmarks.test_basic_parity import measure_loops
|
from tests.benchmarks.test_basic_parity import measure_loops
|
||||||
from tests.helpers.advanced_models import ParityModuleMNIST, ParityModuleRNN
|
from tests.helpers.advanced_models import ParityModuleMNIST, ParityModuleRNN
|
||||||
|
|
||||||
NUM_EPOCHS = 20
|
NUM_EPOCHS = 20
|
|
@ -20,7 +20,7 @@ export PL_RUNNING_SPECIAL_TESTS=1
|
||||||
defaults='-m coverage run --source pytorch_lightning --append -m pytest --capture=no'
|
defaults='-m coverage run --source pytorch_lightning --append -m pytest --capture=no'
|
||||||
|
|
||||||
# find tests marked as `@RunIf(special=True)`. done manually instead of with pytest because it is faster
|
# find tests marked as `@RunIf(special=True)`. done manually instead of with pytest because it is faster
|
||||||
grep_output=$(grep --recursive --word-regexp 'tests' 'benchmarks' --regexp 'special=True' --include '*.py' --exclude 'tests/conftest.py')
|
grep_output=$(grep --recursive --word-regexp 'tests' --regexp 'special=True' --include '*.py' --exclude 'tests/conftest.py')
|
||||||
|
|
||||||
# file paths, remove duplicates
|
# file paths, remove duplicates
|
||||||
files=$(echo "$grep_output" | cut -f1 -d: | sort | uniq)
|
files=$(echo "$grep_output" | cut -f1 -d: | sort | uniq)
|
||||||
|
|
Loading…
Reference in New Issue