5 ms·
I cannot overstate the importance of using a programming language targeting GPUs directly like Futhark (https://github.com/diku-dk/futhark https://github.com/di
by futharkshill 5y ago
I cannot overstate the importance of using a programming language targeting GPUs directly like Futhark (https://github.com/diku-dk/futhark https://github.com/diku-dk/futhark). In this case, it is a functional, declarative language where you can focus on the why, not the how. Just like CPUs are incredibly complex, higher level abstractions are very important.
If you were a pro GPU programmer and had 10 years, Futhark would be maybe 10x slower. But just like we do not program in assembly when making critically fast software, most non-simple things are easier written in this.
- joe_the_user 5y agoInteresting. How fast can Futhark be compared to a standard CUDA loop with a few arithmetic, load and save operations? Basically, suppose you're doing simple gathering and scattering?
- futharkshill 5y agoI think it will always be slower than hand-optimized GPU code, just like assembly. But for most complex programs, I think the compiler is better than humans. @arthas, the author, at some point made comparisons against implementations and it was a most twice as slow, but often faster.
- amkkma 5y ago>Higher level abstractions like these? https://github.com/JuliaGPU/KernelAbstractions.jl https://github.com/JuliaGPU/KernelAbstractions.jl https://github.com/mcabbott/Tullio.jl https://github.com/mcabbott/Tullio.jl https://github.com/JuliaFolds/FoldsCUDA.jl https://github.com/JuliaFolds/FoldsCUDA.jl https://juliagpu.gitlab.io/CUDA.jl/usage/array/ https://juliagpu.gitlab.io/CUDA.jl/usage/array/
- futharkshill 5y agoWell, yes, but to be honest that code still has to be annotated with bounds and batch sizes etc. In futhark you need to know absolutely zero about GPUs
- dklend122 5y agoYes, but that's only required for one of those packages. One of Julia's benefits is that the compiler is hackable so high level abstractions can be experimented with in user space.
- freemint 5y ago> Higher Level abstractions like here: https://www.youtube.com/watch?v=x_I6Bu7IDJo https://www.youtube.com/watch?v=x_I6Bu7IDJo ?
- eptcyka 5y agoIf one is writing CUDA code manually, isn't said one also trying optimize the code for performance? Otherwise, it'd just be ran on a CPU.
- futharkshill 5y agoIf you are writing some very important function, you may write it in assembly and it will be faster than e.g. a C implementation (CPU). But how often do you do that? I think of e.g. CUDA as assembly for the GPU as you have to know about batch size, and special operations and annotations, but Futhark is like writing C or Java for the GPU (it actually compiles to CPUs as well), and it is just a much nicer experience, and I think 99.9% of all people will write faster code because GPUs are simply so complex