Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ci/run_single_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ case ${TEST_TYPE} in
echo "Creating temporary virtualenv for import profile..."
python3 -m venv .venv-profiler
source .venv-profiler/bin/activate
export PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1
python -m pip install --upgrade pip setuptools

PACKAGE_NAME=$(basename $(pwd))
Expand Down Expand Up @@ -139,9 +140,9 @@ case ${TEST_TYPE} in
pip install -e .

if [ -f "${BASELINE_CSV}" ]; then
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 20000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100
else
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 20000
fi
retval=$?
deactivate
Expand Down
8 changes: 3 additions & 5 deletions scripts/import_profiler/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,9 @@ def run_master(iterations, target_module, cpu=0, csv_path=None, clear_cache=True
relative_diff_threshold = 0.15 * baseline_p50
if diff > diff_threshold and diff > relative_diff_threshold:
final_messages.append(
f"FAILURE: Import time regression of {diff:.2f} ms exceeds both the absolute threshold ({diff_threshold} ms) "
f"WARNING: Import time regression of {diff:.2f} ms exceeds both the absolute threshold ({diff_threshold} ms) "
f"and the relative threshold ({relative_diff_threshold:.2f} ms, 15% of baseline Median)."
)
exit_code = 1
else:
if diff > diff_threshold:
final_messages.append(f"SUCCESS: Import time regression of {diff:.2f} ms exceeds absolute threshold ({diff_threshold} ms) but is within relative threshold ({relative_diff_threshold:.2f} ms, 15%).")
Expand All @@ -281,10 +280,9 @@ def run_master(iterations, target_module, cpu=0, csv_path=None, clear_cache=True
if fail_threshold is not None:
if p50_time > fail_threshold:
if baseline_p50 is not None and baseline_p50 > fail_threshold:
final_messages.append(f"WARNING: Median import time ({p50_time:.2f} ms) exceeds the absolute failure threshold ({fail_threshold} ms), but the baseline ({baseline_p50:.2f} ms) also exceeded it. Bypassing absolute backstop failure.")
final_messages.append(f"WARNING: Median import time ({p50_time:.2f} ms) exceeds the absolute threshold ({fail_threshold} ms), and the baseline ({baseline_p50:.2f} ms) also exceeded it.")
else:
final_messages.append(f"FAILURE: Median import time ({p50_time:.2f} ms) exceeds the failure threshold ({fail_threshold} ms).")
exit_code = 1
final_messages.append(f"WARNING: Median import time ({p50_time:.2f} ms) exceeds the threshold ({fail_threshold} ms).")
else:
final_messages.append(f"SUCCESS: Median import time ({p50_time:.2f} ms) is within the failure threshold ({fail_threshold} ms).")

Expand Down
Loading