News for hackers. Stuff that matters.
Re:Beating C with Futhark Running on GPU by gridlockd on Friday October 25, 2019 @11:02AM (#21355689)
That's an apples to oranges comparison, because Futhark needs to compete with C on the GPU (CUDA/OpenCL), not C on the CPU.

That's what I'm missing from these benchmarks - how does it fare against a handwritten, competent implementation in those languages?

Re:Beating C with Futhark Running on GPU by Athas on Friday October 25, 2019 @01:34PM (#21357298)
You are right that it's interesting to compare Futhark-on-GPU with X-on-GPU for various values of X. In most of our academic work, that is what we do.

However, in practice, X-on-GPU where X is not Futhark is rare, because GPU programming is notoriously difficult and time-consuming. Futhark's purpose is to make high-performance data-parallel programming more accessible, even if you could potentially write a faster program yourself.

There are no empirical measurements that I know of, but I would not be surprised if it is a hundred times faster to write a Futhark program than the corresponding OpenCL program. CUDA fares a little better, but not by much. So even if your hand-written program might be twice as fast as Futhark, do you really have the time to write it in the first place? And if you later want to make a small change to its logic (say, adding another parallel loop on top), you may need to rework all of your optimisations from scratch.

Re:Beating C with Futhark Running on GPU by OskarS on Friday October 25, 2019 @12:41PM (#21356739)
In the linked post, the author tests Futhark running on the CPU without any parallelism or low-level optimizations, and it still beat GNU wc.

Fair enough about apples to oranges, but it was really distasteful to me that the top comment on this post was about how C is “unbeatable”, when the article clearly showed that Futhark was faster. And since we’re at the dawn of a new age of parallel computing, statements like that are absurd in general.

Re:Beating C with Futhark Running on GPU by mlyle on Friday October 25, 2019 @12:54PM (#21356872)
> In the linked post, the author tests Futhark running on the CPU without any parallelism or low-level optimizations, and it still beat GNU wc.

Barely...

It also mmaps in a whole 100 meg file. :P wc is not optimized to count as fast as possible, resource use be damned.

Re:Beating C with Futhark Running on GPU by penagwin on Friday October 25, 2019 @11:44AM (#21356122)
Yeah this is what I'd like to see, Futhark vs Cuda.

If your application is better suited for GPUs of course it'll be faster than C on the cpu. GPU mining and AI training are done on the GPU for a reason, and they of course beat "C" on the cpu.

Re:Beating C with Futhark Running on GPU by gilmi on Friday October 25, 2019 @11:44AM (#21356119)
Re:Beating C with Futhark Running on GPU by gridlockd on Friday October 25, 2019 @11:52AM (#21356201)
This is comparing against a high-level library (Thrust) that offers a comparable level of convenience.

That's fair, but it tells you nothing about the performance gap introduced by these high-level abstractions.

Re:Beating C with Futhark Running on GPU by Athas on Friday October 25, 2019 @01:27PM (#21357212)
There is also a comparison against HotSpot, which is a hand-written GPU program (albeit imperfectly).

Futhark does not outperform expertly hand-optimised GPU code, but most of the GPU code found in the wild is hardly expertly hand-optimised. Futhark comes out on top surprisingly often, but can be solidly beaten for complex algorithms or clever implementations. See figure 8 in this paper for examples: https://futhark-lang.org/publications/ppopp19.pdf