Skip to content

Add IQR-based environment fluctuation detection to benchmark timing stats#691

Merged
JewelRoam merged 1 commit intoPaddlePaddle:developfrom
JewelRoam:iqr
Apr 15, 2026
Merged

Add IQR-based environment fluctuation detection to benchmark timing stats#691
JewelRoam merged 1 commit intoPaddlePaddle:developfrom
JewelRoam:iqr

Conversation

@JewelRoam
Copy link
Copy Markdown
Collaborator

…tats

This commit introduces IQR (Interquartile Range) based environment fluctuation
detection to the timing statistics calculation in test_compiler_util.py. The
feature helps detect unstable benchmarking environments by measuring the
relative variation in timing results.

Key Changes:
- Enhanced get_timing_stats() to compute median, Q1, Q3, and IQR
- Added environment variable GRAPH_NET_FLUCTUATION_DETECT_THRESHOLD for
  configurable fluctuation detection sensitivity
- RuntimeError is raised when IQR/median exceeds the threshold
- Extended return stats dictionary with new fields: median, iqr
- Updated print_times_and_speedup() to use median for speedup calculation

IQR/median Ratio:
- Measures relative variability of timing measurements
- Lower values indicate more consistent timing
- Higher values indicate environment instability or interference

Environment Variable Configuration:
- GRAPH_NET_FLUCTUATION_DETECT_THRESHOLD (default: 0.2)
- Controls the sensitivity of fluctuation detection

Detection Algorithm:
1. Calculate median, Q1 (25th percentile), Q3 (75th percentile)
2. Compute IQR = Q3 - Q1
3. Calculate relative IQR = IQR / median
4. Compare against threshold
5. Raise RuntimeError with detailed diagnostics if exceeded

Error Message Format:
When fluctuation is detected, the error message includes:
- IQR/median ratio and threshold
- Raw timing values for manual inspection

Use Cases:
- Multi-user GPU environments where timing variance is common
- CI/CD pipeline monitoring for performance regression detection
- Manual benchmark verification in shared resources
- Identifying external workload interference

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@paddle-bot
Copy link
Copy Markdown

paddle-bot bot commented Apr 15, 2026

Thanks for your contribution!

@JewelRoam JewelRoam merged commit adc9037 into PaddlePaddle:develop Apr 15, 2026
3 of 4 checks passed
@JewelRoam JewelRoam deleted the iqr branch April 15, 2026 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants