<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><br><hr id="zwchr"><blockquote id="DWT17095" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><b>From: </b>"Matthias Braun" <matze@braunis.de><br><b>To: </b>"Hal Finkel" <hfinkel@anl.gov><br><b>Cc: </b>"Sebastian Paul Pop" <s.pop@samsung.com>, "llvm-dev" <llvm-dev@lists.llvm.org>, "Clang Dev" <cfe-dev@lists.llvm.org>, "nd" <nd@arm.com>, "Abe Skolnik" <a.skolnik@samsung.com><br><b>Sent: </b>Friday, October 7, 2016 8:53:49 PM<br><b>Subject: </b>Re: [llvm-dev] [test-suite] making the test-suite succeed with "-Ofast" and "-ffp-contract=on"<br><br>
<br class=""><div><blockquote class=""><div class="">On Oct 7, 2016, at 6:46 PM, Hal Finkel via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class=""><hr id="zwchr"></span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><blockquote style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class="">From: "Hal Finkel via llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a>><br class="">To: "Sebastian Pop" <<a href="mailto:sebpop.llvm@gmail.com" class="" target="_blank">sebpop.llvm@gmail.com</a>><br class="">Cc: "Sebastian Paul Pop" <<a href="mailto:s.pop@samsung.com" class="" target="_blank">s.pop@samsung.com</a>>, "llvm-dev" <<a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a>>, "Matthias Braun"<br class=""><<a href="mailto:matze@braunis.de" class="" target="_blank">matze@braunis.de</a>>, "Clang Dev" <<a href="mailto:cfe-dev@lists.llvm.org" class="" target="_blank">cfe-dev@lists.llvm.org</a>>, "nd" <<a href="mailto:nd@arm.com" class="" target="_blank">nd@arm.com</a>>, "Abe Skolnik" <<a href="mailto:a.skolnik@samsung.com" class="" target="_blank">a.skolnik@samsung.com</a>><br class="">Sent: Friday, October 7, 2016 7:56:53 PM<br class="">Subject: Re: [llvm-dev] [test-suite] making the test-suite succeed with "-Ofast" and "-ffp-contract=on"<br class=""><br class="">----- Original Message -----<br class=""><blockquote class="">From: "Sebastian Pop" <<a href="mailto:sebpop.llvm@gmail.com" class="" target="_blank">sebpop.llvm@gmail.com</a>><br class="">To: "Renato Golin" <<a href="mailto:renato.golin@linaro.org" class="" target="_blank">renato.golin@linaro.org</a>><br class="">Cc: "Kristof Beyls" <<a href="mailto:Kristof.Beyls@arm.com" class="" target="_blank">Kristof.Beyls@arm.com</a>>, "Sebastian Paul Pop"<br class=""><<a href="mailto:s.pop@samsung.com" class="" target="_blank">s.pop@samsung.com</a>>, "llvm-dev"<br class=""><<a href="mailto:llvm-dev@lists.llvm.org" class="" target="_blank">llvm-dev@lists.llvm.org</a>>, "nd" <<a href="mailto:nd@arm.com" class="" target="_blank">nd@arm.com</a>>, "Abe Skolnik"<br class=""><<a href="mailto:a.skolnik@samsung.com" class="" target="_blank">a.skolnik@samsung.com</a>>, "Clang Dev"<br class=""><<a href="mailto:cfe-dev@lists.llvm.org" class="" target="_blank">cfe-dev@lists.llvm.org</a>>, "Hal Finkel" <<a href="mailto:hfinkel@anl.gov" class="" target="_blank">hfinkel@anl.gov</a>>, "Stephen<br class="">Canon" <<a href="mailto:scanon@apple.com" class="" target="_blank">scanon@apple.com</a>>, "Matthias Braun"<br class=""><<a href="mailto:matze@braunis.de" class="" target="_blank">matze@braunis.de</a>><br class="">Sent: Friday, October 7, 2016 7:34:40 PM<br class="">Subject: [test-suite] making the test-suite succeed with "-Ofast"<br class="">and "-ffp-contract=on"<br class=""><br class="">Hi,<br class=""><br class="">I would like to provide a summary of the different proposals on how<br class="">to<br class="">fix the test-suite to make it succeed when specifying extra CFLAGS<br class="">"-Ofast" and "-ffp-contract=on".  I would like to expose the issue<br class="">and<br class="">proposed ways to fix it to other potential reviewers that could<br class="">provide extra feedback.  We also need to decide which proposal (or<br class="">combination of) to implement and commit.<br class=""><br class="">Proposal 1: <a href="https://reviews.llvm.org/D25277" class="" target="_blank">https://reviews.llvm.org/D25277</a><br class="">modify the CMakes to compile and run each of these benchmarks<br class="">twice:<br class="">once with added CFLAGS -ffp-contract=off.  Record on disk the full<br class="">output of both runs and compare with FP_TOLERANCE.  Hash the output<br class="">of<br class="">the run with -ffp-contract=off and exact match against the<br class="">reference<br class="">output.<br class=""><br class="">The good for Proposal 1:<br class="">- changes contained in the build system: no change to the code of<br class="">the<br class="">benchmarks<br class="">- runs benchmarks under an extra configuration with CFLAGS +=<br class="">-ffp-contract=off<br class=""><br class="">The bad for Proposal 1:<br class="">- compilation time will double<br class="">- running time on the device will double<br class="">- build system is more complex<br class="">- the build directory goes from 300M to 1.2G due to the extra<br class="">reference outputs recorded under -ffp-contract=off,<br class="">- when running test-suite over small devices it will cost 1G more<br class="">transfer over the network.<br class=""></blockquote><br class="">I prefer proposal 1 (although, to be fair, it was something I<br class="">suggested). Being the the business of trying to heavily modify every<br class="">benchmark that does floating-point computation, as in proposal 2,<br class="">does not seem to scale well, and can't always be done regardless.<br class=""><br class="">We can make some effort to reduce the size of the problems being<br class="">computed by some of the benchmarks (e.g. pollybench); I think that<br class="">is reasonable and will help with the extra space requirements. That<br class="">having been said, functionally speaking, our test suite is at least<br class="">an order of magnitude too small, and so my sympathy is somewhat<br class="">limited. We're going to have to find a way to execute the test suite<br class="">in stages on smaller devices to limit the peak usage, if not because<br class="">of this then because we've added a lot more test applications and<br class="">benchmarks in the future.<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; float: none; display: inline ! important;" class="">Another aspect to this is that we should have this kind of infrastructure for other purposes as well. We have a similar lack of testing for -ffast-math. We don't even do a good job of (i.e. have good buildbot coverage for) running the test suite @ -O1. -O2 and -O3 are much better tested. More regular testing at -O0 (especially with -g to pick up crashes in our debug-info generation logic) is needed as well.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;" class=""></div></blockquote><div><br class=""></div></div>I think we should rather just setup more build jobs that run different confiruations rather than modifying the testsuite to compile multiple configurations in a single run, as that keeps things simpler.</blockquote>Fair enough; however, for things like FP-contractions and fast-math optimizations, which can change the output, we need to figure how to to test these regularly, at least looking for compile-time failures (just disabling the tests for which these setting cause verification errors is unsatisfying because it is these very tests where we know the logic we want to test is actually firing). <br><br> -Hal <br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px; color: rgb(0, 0, 0); font-weight: normal; font-style: normal; text-decoration: none; font-family: Helvetica,Arial,sans-serif; font-size: 12pt;"><div class="">Chris and me also started collecting typical configurations in the test-suite/cmake/caches/ directory, I hope this will become a popular thing with more bot owners as it nicely documents what people are doing IMO and it makes it easy to describe the configuration used in bugreports / when reproducing issues on a personal machine.</div><div class=""><br class=""></div><div class="">- Matthias</div><div class=""><div class=""><br class=""></div><div class=""><br class=""></div></div></blockquote><br><br><br>-- <br><div><span name="x"></span>Hal Finkel<br>Lead, Compiler Technology and Programming Languages<br>Leadership Computing Facility<br>Argonne National Laboratory<span name="x"></span><br></div></div></body></html>