StanfordAHA/lassen

Match Halide execution to floating point IPs

Closed this issue · 7 comments

Kuree commented

The bfloat implementation in Halide seems to be consistent with the IP with rnd=1. It would much easier if we can use that mode instead.

I think we should check which path is doing what type of rounding, and not just make the hardware match our Halide implementation. I thought the hardware was doing round to nearest even, which is what I think we want. If Halide is just doing round to nearest, we probably should change Halide, and not the hardware. But I could be completely wrong on what is implemented on either side

Kuree commented

IEEE defines 5 different valid rounding rules:https://en.wikipedia.org/wiki/IEEE_754#Rounding_rules
I believe any of them are IEEE compliant implementation.

We will see if we can change Halide's behavior tomorrow.

Screen Shot 2019-06-04 at 3 50 34 PM

Here are the rounding modes for the IP

I am surprised that Halide does not use round to nearest even.

@jeffsetter, can you investigate exactly what rounding mode is being used by halide?

Kuree commented

@rdaly525 We're implementing rnd=0 mode in Halide right now.

So, just to be clear: Halide's implementation is RNE and RTL's implementation is RNE, but we are getting different results?

Kuree commented

Halide is using rnd=1 and we're using rnd=0 in RTL. We will change the Halide implementation to match with the RTL.