This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Tweak predictors based on SPEC2006 and SPEC2017


Hello.

In current stage1 Honza spent a significant amount of time to improve profiling infrastructure.
New classes profile_count and profile_probability have been added and we hope the profile
is maintained more sensitively among various optimization passes.

My patch series makes adjustments to values of predictors defined in predict.def based on
what I measured on SPEC2006 and SPEC2017. For both, -O2 -march=native was used and it was
run on a Haswell CPU. Note that numbers should be reproducible on any CPU, as coverage mapping
to source files should match.

Compare to previous release (GCC 7.x branch), I made 2 main differences:
1) For GCC 7.x tuning I wrongly used train run to collect numbers -> fixed by running train run
with ref size of benchmarks
2) I noticed we have branches that in some cases dominate a predictor. That's caused by fact that
we calculate average predictor value based on number of successful branching. Imagine a very hot
condition in a loop. Such branch can dominate a predictor. So that I decided to calculate statistics
also without branches that have coverage >= 10%. Doing that shows that some predictors can be close
to 50%, or value chosen in predict.def is very far from what we have considering all branches.
In such cases, I explain why I've chosen to either remove a predictor or adjust based on non-dominating
branches.

The email contains of statistics for SPEC2006 suite, SPEC2017 suite and combined values based on these.
Apart from that, statistics for each individual benchmark can be also found.

There are numbers for 2 configurations of SPEC2006 and SPEC2017 which were run with the series on a Ryzen 5
machine:

+-------------------------------------------+--------+----------+----------+
| 1) ===== CPU2006: -O2 -march=native       |        |          |          |
| Performance Regressions - Execution Time  | Δ (B)  | Baseline | Current  |
| SPEC/SPEC2006/FP/459.GemsFDTD             | 3.78%  | 234.6328 | 243.5055 |
| SPEC/SPEC2006/INT/456.hmmer               | 3.08%  | 312.4193 | 322.0455 |
| SPEC/SPEC2006/FP/482.sphinx3              | 2.26%  | 370.0952 | 378.4484 |
| SPEC/SPEC2006/FP/433.milc                 | 1.95%  | 289.1947 | 294.8295 |
| SPEC/SPEC2006/FP/465.tonto                | 1.70%  | 325.3729 | 330.9081 |
| SPEC/SPEC2006/FP/416.gamess               | 1.63%  | 550.4813 | 559.4563 |
| SPEC/SPEC2006/INT/429.mcf                 | 1.61%  | 245.2728 | 249.2234 |
|                                           |        |          |          |
| Performance Improvements - Execution Time | Δ (B)  | Baseline | Current  |
| SPEC/SPEC2006/FP/436.cactusADM            | -5.94% | 305.2817 | 287.1523 |
| SPEC/SPEC2006/INT/483.xalancbmk           | -2.84% | 200.1121 | 194.4234 |
| SPEC/SPEC2006/INT/401.bzip2               | -1.31% | 378.0334 | 373.0694 |
|                                           |        |          |          |
| 2) ===== CPU2006: -Ofast -march=native    |        |          |          |
| Performance Regressions - Execution Time  | Δ (B)  | Baseline | Current  |
| SPEC/SPEC2006/FP/459.GemsFDTD             | 3.11%  | 210.9732 | 217.5323 |
| SPEC/SPEC2006/INT/429.mcf                 | 1.63%  | 242.1709 | 246.1208 |
| SPEC/SPEC2006/FP/482.sphinx3              | 1.57%  | 270.7089 | 274.9587 |
| SPEC/SPEC2006/INT/400.perlbench           | 1.40%  | 274.1239 | 277.9529 |
| SPEC/SPEC2006/FP/481.wrf                  | 1.33%  | 180.1668 | 182.555  |
|                                           |        |          |          |
| Performance Improvements - Execution Time | Δ (B)  | Baseline | Current  |
| SPEC/SPEC2006/FP/450.soplex               | -4.38% | 214.6197 | 205.2086 |
| SPEC/SPEC2006/FP/436.cactusADM            | -3.24% | 153.1062 | 148.1397 |
| SPEC/SPEC2006/FP/435.gromacs              | -2.94% | 199.6355 | 193.7684 |
| SPEC/SPEC2006/INT/471.omnetpp             | -1.93% | 285.8131 | 280.3005 |
| SPEC/SPEC2006/INT/445.gobmk               | -1.14% | 375.2672 | 370.9727 |
|                                           |        |          |          |
| 3) ===== CPU2017: -O2 -march=native       |        |          |          |
| Performance Regressions - Execution Time  | Δ (B)  | Baseline | Current  |
| SPEC/SPEC2017/INT/557.xz_r                | 2.51%  | 397.0281 | 407.0107 |
| SPEC/SPEC2017/INT/520.omnetpp_r           | 1.69%  | 443.3886 | 450.8843 |
| SPEC/SPEC2017/FP/549.fotonik3d_r          | 1.44%  | 361.6036 | 366.7952 |
| SPEC/SPEC2017/FP/508.namd_r               | 1.07%  | 198.1652 | 200.2947 |
|                                           |        |          |          |
| Performance Improvements - Execution Time | Δ (B)  | Baseline | Current  |
| SPEC/SPEC2017/INT/548.exchange2_r         | -6.78% | 433.2191 | 403.8602 |
| SPEC/SPEC2017/FP/507.cactuBSSN_r          | -1.49% | 223.5739 | 220.2388 |
| SPEC/SPEC2017/FP/511.povray_r             | -1.34% | 483.2885 | 476.8329 |
| SPEC/SPEC2017/INT/500.perlbench_r         | -1.03% | 417.0421 | 412.7557 |
|                                           |        |          |          |
| 4) ===== CPU2017: -Ofast -march=native    |        |          |          |
| Performance Regressions - Execution Time  | Δ (B)  | Baseline | Current  |
| SPEC/SPEC2017/FP/544.nab_r                | 7.67%  | 314.2308 | 338.3466 |
| SPEC/SPEC2017/FP/538.imagick_r            | 7.26%  | 352.263  | 377.8382 |
| SPEC/SPEC2017/FP/526.blender_r            | 1.56%  | 270.6487 | 274.8841 |
| SPEC/SPEC2017/INT/548.exchange2_r         | 1.55%  | 348.1742 | 353.5598 |
| SPEC/SPEC2017/INT/523.xalancbmk_r         | 1.41%  | 298.9601 | 303.1769 |
|                                           |        |          |          |
| Performance Improvements - Execution Time | Δ (B)  | Baseline | Current  |
| SPEC/SPEC2017/INT/505.mcf_r               | -1.14% | 310.5277 | 306.9915 |
| SPEC/SPEC2017/INT/500.perlbench_r         | -1.07% | 413.7797 | 409.3348 |
+-------------------------------------------+--------+----------+----------+

I'm planning to comment each predictor change in upcoming emails which
contain patches.

Apart from that the patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Martin

Attachment: 2017-per-benchmark.txt.bz2
Description: application/bzip

Attachment: 2006-per-benchmark.txt.bz2
Description: application/bzip

Attachment: all.txt
Description: Text document

Attachment: 2017-all.txt
Description: Text document

Attachment: 2006-all.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]