Commit adc9037
Add IQR-based environment fluctuation detection to benchmark timing stats (#691)
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>1 parent 8ce68eb commit adc9037
1 file changed
Lines changed: 42 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
111 | 143 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
116 | 150 | | |
117 | 151 | | |
118 | 152 | | |
| |||
206 | 240 | | |
207 | 241 | | |
208 | 242 | | |
209 | | - | |
210 | | - | |
| 243 | + | |
| 244 | + | |
211 | 245 | | |
212 | 246 | | |
213 | 247 | | |
214 | 248 | | |
215 | 249 | | |
216 | | - | |
217 | | - | |
| 250 | + | |
| 251 | + | |
218 | 252 | | |
219 | 253 | | |
220 | 254 | | |
| |||
0 commit comments