Skip to content

Commit 6a8d341

Browse files
Retry op numeric tests Arm (#19321)
Similar to the cadence retries. The numerics tests are a little too strict likely and a little flakey. cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell
1 parent 5faf36e commit 6a8d341

2 files changed

Lines changed: 15 additions & 11 deletions

File tree

.ci/scripts/test_backend.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export PYTHON_EXECUTABLE=python
3535

3636
# CMake options to use, in addition to the defaults.
3737
EXTRA_BUILD_ARGS=""
38+
PYTEST_RETRY_ARGS=()
3839

3940
if [[ "$FLOW" == *qnn* ]]; then
4041
# Setup QNN sdk and deps - note that this is a bit hacky due to the nature of the
@@ -57,6 +58,7 @@ if [[ "$FLOW" == *vulkan* ]]; then
5758
fi
5859

5960
if [[ "$FLOW" == *arm* ]]; then
61+
PYTEST_RETRY_ARGS=(--reruns 2 --reruns-delay 1)
6062

6163
# Setup ARM deps.
6264
if [[ "$FLOW" == *vgf* ]]; then
@@ -95,6 +97,6 @@ GOLDEN_DIR="${ARTIFACT_DIR}/golden-artifacts"
9597
export GOLDEN_ARTIFACTS_DIR="${GOLDEN_DIR}"
9698

9799
EXIT_CODE=0
98-
${CONDA_RUN_CMD} pytest -c /dev/null -n auto backends/test/suite/$SUITE/ -m flow_$FLOW --json-report --json-report-file="$REPORT_FILE" || EXIT_CODE=$?
100+
${CONDA_RUN_CMD} pytest -c /dev/null -n auto "${PYTEST_RETRY_ARGS[@]}" backends/test/suite/$SUITE/ -m flow_$FLOW --json-report --json-report-file="$REPORT_FILE" || EXIT_CODE=$?
99101
# Generate markdown summary.
100102
${CONDA_RUN_CMD} python -m executorch.backends.test.suite.generate_markdown_summary_json "$REPORT_FILE" > ${GITHUB_STEP_SUMMARY:-"step_summary.md"} --exit-code $EXIT_CODE

backends/arm/test/test_arm_baremetal.sh

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ fi
4848
TEST_SUITE_NAME="$(basename "$0") ${TEST_SUITE}"
4949

5050
EXCLUDE_TARGET_EXPR="(not u55) and (not u85) and (not tosa) and (not _vgf_)"
51+
PYTEST_RETRY_ARGS=(--reruns 2 --reruns-delay 1)
5152

5253
all() { # Run all tests
5354
# This will list all lines in this file that is starting with test_ remove () { and add this script name in
@@ -80,7 +81,7 @@ test_pytest_ops_no_target() {
8081
echo "${TEST_SUITE_NAME}: Run pytest ops for target-less tests"
8182

8283
# Run arm baremetal pytest tests without target
83-
pytest --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ --ignore=backends/arm/test/models -k "${EXCLUDE_TARGET_EXPR}"
84+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ --ignore=backends/arm/test/models -k "${EXCLUDE_TARGET_EXPR}"
8485
echo "${TEST_SUITE_NAME}: PASS"
8586
}
8687

@@ -91,7 +92,7 @@ test_pytest_models_no_target() {
9192
source backends/arm/scripts/install_models_for_test.sh
9293

9394
# Run arm baremetal pytest tests without FVP
94-
pytest --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k "${EXCLUDE_TARGET_EXPR}"
95+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k "${EXCLUDE_TARGET_EXPR}"
9596
echo "${TEST_SUITE_NAME}: PASS"
9697
}
9798

@@ -101,7 +102,7 @@ test_pytest_models_no_target() {
101102
test_pytest_ops_tosa() {
102103
echo "${TEST_SUITE_NAME}: Run pytest ops for TOSA"
103104

104-
pytest --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ --ignore=backends/arm/test/models -k tosa
105+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ --ignore=backends/arm/test/models -k tosa
105106
echo "${TEST_SUITE_NAME}: PASS"
106107
}
107108

@@ -111,7 +112,7 @@ test_pytest_models_tosa() {
111112
# Install model dependencies for pytest
112113
source backends/arm/scripts/install_models_for_test.sh
113114

114-
pytest --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k tosa
115+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k tosa
115116
echo "${TEST_SUITE_NAME}: PASS"
116117
}
117118

@@ -134,7 +135,7 @@ test_pytest_ops_ethos_u55() {
134135
backends/arm/scripts/build_executorch.sh
135136
backends/arm/test/setup_testing.sh
136137

137-
pytest --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ --ignore=backends/arm/test/models -k u55
138+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ --ignore=backends/arm/test/models -k u55
138139
echo "${TEST_SUITE_NAME}: PASS"
139140
}
140141

@@ -147,7 +148,7 @@ test_pytest_models_ethos_u55() {
147148
# Install model dependencies for pytest
148149
source backends/arm/scripts/install_models_for_test.sh
149150

150-
pytest --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k u55
151+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k u55
151152
echo "${TEST_SUITE_NAME}: PASS"
152153
}
153154

@@ -188,7 +189,7 @@ test_pytest_ops_ethos_u85() {
188189
backends/arm/test/setup_testing.sh
189190

190191
# Run arm baremetal pytest tests with FVP
191-
pytest --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ --ignore=backends/arm/test/models -k u85
192+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ --ignore=backends/arm/test/models -k u85
192193
echo "${TEST_SUITE_NAME}: PASS"
193194
}
194195

@@ -201,7 +202,7 @@ test_pytest_models_ethos_u85() {
201202
# Install model dependencies for pytest
202203
source backends/arm/scripts/install_models_for_test.sh
203204

204-
pytest --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k u85
205+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k u85
205206
echo "${TEST_SUITE_NAME}: PASS"
206207
}
207208

@@ -235,7 +236,7 @@ test_pytest_ops_vkml() {
235236

236237
source backends/arm/test/setup_testing_vkml.sh
237238

238-
pytest --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ \
239+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=10 backends/arm/test/ \
239240
--ignore=backends/arm/test/models -k _vgf_
240241
echo "${TEST_SUITE_NAME}: PASS"
241242
}
@@ -248,7 +249,7 @@ test_pytest_models_vkml() {
248249
# Install model dependencies for pytest
249250
source backends/arm/scripts/install_models_for_test.sh
250251

251-
pytest --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k _vgf_
252+
pytest "${PYTEST_RETRY_ARGS[@]}" --verbose --color=yes --numprocesses=auto --durations=0 backends/arm/test/models -k _vgf_
252253
echo "${TEST_SUITE_NAME}: PASS"
253254
}
254255

@@ -295,6 +296,7 @@ test_smaller_stories_llama() {
295296
# Get path to source directory
296297
pytest \
297298
-c /dev/null \
299+
"${PYTEST_RETRY_ARGS[@]}" \
298300
--verbose \
299301
--color=yes \
300302
--numprocesses=auto \

0 commit comments

Comments
 (0)