inducer / loopy

A code generator for array-based code on CPUs and GPUs
http://mathema.tician.de/software/loopy
MIT License
580 stars 70 forks source link

Flop counting of FMA #3

Open inducer opened 9 years ago

inducer commented 9 years ago

@jdsteve2 @rckirby

One issue with FLOP is whether we count a*x + b as one or two operations. This is called FMA. It's often faster and it has better accuracy than the two operations carried out separately. But exactly since it's accuracy is different, compilers generally won't compile them as an FMA unless you specify -cl-fast-relaxed-math. There is also a fma function in OpenCL that allows you to explicitly ask for an FMA on a per-operation basis.

Since there are enough moving parts and since loopy doesn't yet take do anything to manage FMAs itself, I think we should have a knob on whether FMAs should count as one or two flops in the flop counter.

rckirby commented 9 years ago

So for now we should be counting this as two flops, but the issue of expressing this in loopy and it's flop counter is an important one.

Sent from my iPhone

On May 22, 2015, at 11:22 AM, Andreas Klöckner notifications@github.com wrote:

@jdsteve2 @rckirby

One issue with FLOP is whether we count a*x + b as one or two operations. This is called FMA. It's often faster and it has better accuracy than the two operations carried out separately. But exactly since it's accuracy is different, compilers generally won't compile them as an FMA unless you specify -cl-fast-relaxed-math. There is also a fma function in OpenCL that allows you to explicitly ask for an FMA on a per-operation basis.

Since there are enough moving parts and since loopy doesn't yet take do anything to manage FMAs itself, I think we should have a knob on whether FMAs should count as one or two flops in the flop counter.

— Reply to this email directly or view it on GitHub.

inducer commented 8 years ago

@jdsteve2 Can you remind me of what the status is here?

jdsteve2 commented 8 years ago

Not yet implemented, on my todo list

inducer commented 8 years ago

Thx!