3 ms·
Apple GPUs don't support FP64 at all - and Apple only provides Metal as a (supported and not deprecated) API. NVIDIA GPUs have much more ubiquitous programming
by my123 4y ago
Apple GPUs don't support FP64 at all - and Apple only provides Metal as a (supported and not deprecated) API.
NVIDIA GPUs have much more ubiquitous programming models, from CUDA C++ to OpenMP (both C++ and Fortran), allowing them to be much more useful.
AMD ROCm (a CUDA clone, but not managed too well...) isn't in a great state today, but it definitely provides an OpenMP compiler, for C++ only though, Fortran is not covered.
Intel GPUs have a much better SW story on all fronts for GPGPU than AMD's, and OpenMP is supported for both C++ and Fortran there.
tldr: if you want to run this code on GPUs, the two vendors to look for are NVIDIA and Intel. The others just don't have the software stack to do so. (without more heavyweight porting)
Of course, optimising for GPUs also adds work. That said, an OpenMP version is a very good starting point.
- paulmd 4y agoYou can always emulate FP64 - it is not performant to do so, but since CFD is essentially memory-bandwidth-bottlenecked rather than limited by shader performance, this probably is not a big concern. You've got shaders sitting around waiting anyway. The M1 architecture only allows the CPU to access a fraction of the memory bus, it is around 25% of the total bandwidth or so iirc. The rest has to go to the GPU or NPU or one of the other units, so even if your FP64 code was super shitty emulated with no hardware support, on paper you should be able to quadruple performance by utilizing it. If you can "pre-digest" it at all, and then push it back from the GPU to the CPU, that might be another viable approach. Of course none of this will exist out of the box in some 90s FORTRAN code!
- my123 4y ago> You can always emulate FP64 That's what's done by Intel for their newer consumer GPUs AFAIK, zero FP64 units present on die, but an emulation mode can be enabled to expose that support. (which is then done by software on the GPU) > it is around 25% 50%, ~ 200GB/sec on an M1 Max out of ~ 400GB/sec