Skip to content

Commit 089fcb9

Browse files
Collect and run all IPU tests (#11170)
* Collect and run all ipu tests * Update azure pipeline * Increase pytest verbosity * Update RunIf Co-authored-by: Akihiro Nitta <[email protected]>
1 parent 4651c11 commit 089fcb9

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.azure-pipelines/ipu-tests.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ jobs:
7676
source ${{ variables.poplar_sdk }}/poplar-ubuntu*/enable.sh
7777
source ${{ variables.poplar_sdk }}/popart-ubuntu*/enable.sh
7878
export POPTORCH_WAIT_FOR_IPU=1
79-
python -m coverage run --source pytorch_lightning -m pytest tests/accelerators/test_ipu.py -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
79+
export PL_RUN_IPU_TESTS=1
80+
python -m coverage run --source pytorch_lightning -m pytest tests -vv --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
8081
env:
8182
MKL_THREADING_LAYER: "GNU"
8283
displayName: 'Testing: standard'

tests/conftest.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,3 +190,11 @@ def pytest_collection_modifyitems(items):
190190
# has `@RunIf(slow=True)`
191191
if marker.name == "skipif" and marker.kwargs.get("slow")
192192
]
193+
elif os.getenv("PL_RUN_IPU_TESTS", "0") == "1":
194+
items[:] = [
195+
item
196+
for item in items
197+
for marker in item.own_markers
198+
# has `@RunIf(ipu=True)`
199+
if marker.name == "skipif" and marker.kwargs.get("ipu")
200+
]

tests/helpers/runif.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,10 @@ def __new__(
149149
reasons.append("TPU")
150150

151151
if ipu:
152-
conditions.append(not _IPU_AVAILABLE)
152+
env_flag = os.getenv("PL_RUN_IPU_TESTS", "0")
153+
conditions.append(env_flag != "1" or not _IPU_AVAILABLE)
153154
reasons.append("IPU")
155+
kwargs["ipu"] = True
154156

155157
if horovod:
156158
conditions.append(not _HOROVOD_AVAILABLE)

0 commit comments

Comments
 (0)