for Optimization and Analysis of Floating-Point Computations Heiko - - PowerPoint PPT Presentation

for optimization and analysis
SMART_READER_LITE
LIVE PREVIEW

for Optimization and Analysis of Floating-Point Computations Heiko - - PowerPoint PPT Presentation

Combining Tools for Optimization and Analysis of Floating-Point Computations Heiko Becker, Pavel Panchekha, Eva Darulova, Zachary Tatlock FM 2018, 17.07.2018 Floating-Point Computations Are Ubiquitous 2 Floating-Point Computations are Tricky


slide-1
SLIDE 1

Combining Tools for Optimization and Analysis

  • f Floating-Point Computations

Heiko Becker, Pavel Panchekha, Eva Darulova, Zachary Tatlock FM 2018, 17.07.2018

slide-2
SLIDE 2

Floating-Point Computations Are Ubiquitous

2

slide-3
SLIDE 3

Floating-Point Computations are Tricky

3

slide-4
SLIDE 4

Renewed Interest Lead to Numerous Tools

Precimonious Daisy Herbie VCFloat Precisa Gappa FPTuner

None of these tools have been connected together!

???

4

slide-5
SLIDE 5
  • verify Herbies optimizations with Daisy
  • compare Herbie’s and Daisy’s optimizations

⟹ best run together

+

5

  • connecting exposes tools to new inputs
  • found bugs and inaccuracies

⟹ call to action to connect tools

slide-6
SLIDE 6

+

  • unify input formats
  • verify Herbies optimizations with Daisy
  • compare optimization techniques
  • fix bugs and inaccuracies

Concretely

6

+𝐷𝐼𝐹𝐷𝐿

+𝑃𝑄𝑈

slide-7
SLIDE 7

Floating-Point Arithmetic

0.2 + 0.1 0.3 0.30000000000000004

0.2 + 0.1;

roundoff error

Units in the Last Place: relative measure of lost bits 1 + 𝜀 abstraction: 𝑓1 + 𝑓2 = 𝑓1 + 𝑓2 ∗ 1 + 𝜀

in Daisy in Herbie

error of 𝟏 error of 𝟓𝒇−𝟐𝟔

7

slide-8
SLIDE 8

Heuristic Optimization

  • f Floating-Point Programs

𝑦 + 1 − 𝑦 Optimizer 1 𝑦 + 1 + 𝑦 ⟹ dynamic analysis ⟹ (possibly) unsound optimizations ⟹ heuristic hill-climbing algorithm

8

slide-9
SLIDE 9

Sound Analysis

  • f Floating-Point Programs

𝑔 𝑦 = 𝑦 + 1 − 𝑦 Static Analyzer 𝑦 ∈ [10, 100] ⟹ sound dataflow analysis ⟹ 2.34e−15 is a sound but possibly pessimistic upper bound error is 2.34e−15

9

slide-10
SLIDE 10

Sound Optimization

  • f Floating-Point Programs

−𝑦1 ∗ 𝑦2 − 2 ∗ 𝑦2 ∗ 𝑦3 − 𝑦1 − 𝑦3 𝑦𝑗 ∈ [−15, 15] (−𝑦1 ∗ 𝑦2 − (𝑦1 + 𝑦3)) − (2 ∗ 𝑦2) ∗ 𝑦3 Static Analyzer + Rewriter ⟹ rewriting optimizes accuracy ⟹ improved error bound from 2.95e−13 to 1.98e−13

10

slide-11
SLIDE 11

+𝐷𝐼𝐹𝐷𝐿

11

slide-12
SLIDE 12

The FPBench Project

  • collection of benchmarks
  • new standardized input format
  • converters to input formats
  • FPCore → Gappa
  • FPCore → C
  • FPCore → Scala

12

slide-13
SLIDE 13

103 FPBench benchmarks in total

13

Herbie times out on 34 Daisy raises an alarm for 22 13 alarms on source programs 9 alarms on Herbies result End-to-end result for 47:

  • 8 have become worse
  • 18 have the same worst-case bound
  • 21 have a provable improvement

+𝐷𝐼𝐹𝐷𝐿

Herbie’s error improvement better

slide-14
SLIDE 14

+𝑃𝑄𝑈

14

slide-15
SLIDE 15

15

Error Improvement of Herbie Daisy Both better

slide-16
SLIDE 16

Evaluation of the optimization algorithms

16

Herbie Daisy Both

slide-17
SLIDE 17

Additional Benefit: Improving Tool Robustness

Herbie

  • Incorrect Typing rule for let-bindings
  • Incorrect handling of duplicate fields
  • Infinite loop for some preconditions

Daisy

  • Improved analysis of elementary functions
  • Improved error reporting

17

slide-18
SLIDE 18

Conclusion

  • floating-point tools solve orthogonal problems
  • connecting them is easy and exposes bugs
  • Daisy is a good verification backend for Herbie
  • Herbie’s and Daisy’s optimizations work best together
  • first step on bigger vision of connecting tools

Questions?

18

https://fpbench.org