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
4 changes: 2 additions & 2 deletions ci/run_single_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,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
Comment on lines +142 to +144

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since the import profiler checks are now non-blocking and warning-only, there is no longer a risk of blocking developer workflows due to threshold violations. Keeping the threshold at a reasonable value (like 5000 ms) is beneficial because it still alerts developers via warnings when imports are slow. Raising the threshold to 20000 ms (20 seconds) is extremely high and will likely prevent any warnings from ever being triggered, defeating the purpose of having a warning-only check.

Suggested change
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
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100
else
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000

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).")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

For consistency with the other updated messages (which now refer to "threshold" instead of "failure threshold"), we should update this success message to also use "threshold".

Suggested change
final_messages.append(f"SUCCESS: Median import time ({p50_time:.2f} ms) is within the failure threshold ({fail_threshold} ms).")
final_messages.append(f"SUCCESS: Median import time ({p50_time:.2f} ms) is within the threshold ({fail_threshold} ms).")


Expand Down
Loading