malyzajko / daisy

Other
43 stars 10 forks source link

Mixed precision flag with if statements #8

Open bksaiki opened 4 years ago

bksaiki commented 4 years ago

I'm currently improving Daisy support for FPBench. I encountered an issue where benchmarks with if statements work with uniform precision but break with the --mixed-precision flag (and necessary file with variable-precision mappings).

Ex: FPBench sanity test

FPCore:

(FPCore (x) 
  :name "Single interval (1/4)" 
  :pre (< 1 x 1.000001) 
  :spec 1.0 
  (if (< 1 x 1.000001) 1 0))

Daisy (Scala):

def f(x: Real): Real = {
  require((1 < x && x < 1.000001))
  if ((1 < x && x < 1.000001)) {
    1
  } else {
    0
  }
}

Output (w/ uniform precision):

Absolute error: 2.220446049250313e-16
Real range:     [0.0, 1.0]

Output (w/ --mixed-precision flag):

Something really bad happened. Cannot continue.

Are if statements not supported with mixed precision or is this just a bug?

malyzajko commented 4 years ago

Mixed-precision tuning does not work for if statements right now.

bksaiki commented 4 years ago

Okay. I'll leave this issue open then.