Skip to content

Commit 17be40e

Browse files
committed
Split test pipeline
1 parent fc37315 commit 17be40e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

.github/workflows/job_pytorch_models_tests.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ jobs:
132132
if: ${{ inputs.model_scope == 'precommit' || inputs.model_scope == 'nightly_scope2' }}
133133
run: |
134134
export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH
135-
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_"${TYPE}"_tests.html --self-contained-html -v -k "not (TestTimmConvertModel or TestTorchHubConvertModel or TestEdsrConvertModel or TestLLMModel)"
135+
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_"${TYPE}"_tests.html --self-contained-html -v -k "not (TestTimmConvertModel or TestTorchHubConvertModel or TestEdsrConvertModel or TestLLMModel or TestDetectron2ConvertModel or TestTorchbenchmarkConvertModel)"
136136
env:
137137
TYPE: ${{ inputs.model_scope == 'precommit' && 'precommit' || 'nightly' }}
138138
TEST_DEVICE: CPU
@@ -154,6 +154,28 @@ jobs:
154154
TEST_DEVICE: CPU
155155
OP_REPORT_FILE: ${{ env.INSTALL_TEST_DIR }}/TEST-torch_unsupported_ops.log
156156

157+
# Detectron2 and Torchbench install packages at runtime via subprocess,
158+
# so they run after model tests and before transformation tests to avoid
159+
# polluting the environment for other model tests.
160+
- name: PyTorch Detectron2 Tests
161+
if: ${{ inputs.model_scope == 'precommit' || inputs.model_scope == 'nightly_scope2' }}
162+
run: |
163+
export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH
164+
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/test_detectron2.py -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-torch_model_detectron2_"${TYPE}"_tests.html --self-contained-html -v
165+
env:
166+
TYPE: ${{ inputs.model_scope == 'precommit' && 'precommit' || 'nightly' }}
167+
TEST_DEVICE: CPU
168+
OP_REPORT_FILE: ${{ env.INSTALL_TEST_DIR }}/TEST-torch_unsupported_ops.log
169+
170+
- name: PyTorch Torchbench Tests
171+
if: ${{ inputs.model_scope == 'nightly_scope2' }}
172+
run: |
173+
export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH
174+
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/pytorch/test_torchbench.py -m nightly --html=${INSTALL_TEST_DIR}/TEST-torch_model_torchbench_nightly_tests.html --self-contained-html -v
175+
env:
176+
TEST_DEVICE: CPU
177+
OP_REPORT_FILE: ${{ env.INSTALL_TEST_DIR }}/TEST-torch_unsupported_ops.log
178+
157179
- name: Install deps for transformation tests
158180
if: ${{ inputs.model_scope == 'precommit' }}
159181
run: |

0 commit comments

Comments
 (0)