3 ms·
But that makes me think, what prevents people from running these calculations on the GPU? Even the memory is shared - the few 100 gflops they get out of the M1
by torginus 5y ago
But that makes me think, what prevents people from running these calculations on the GPU? Even the memory is shared - the few 100 gflops they get out of the M1 ultra is pocket change in GPU terms.
- the_svd_doctor 5y agoWell that particular NASA code is from the 90’s and in Fortran. Maybe with MPI. That’s probably part of the reason why.
- willis936 5y agoDon't all high performance math libraries have the option of LAPACK interfaces?
- CamperBob2 5y agoIf a CPU doesn't run the OS and software I need to run, it might as well be a GPU or a Cray 9 or something dug out of the wreckage at Area 51. All of which are good descriptions of a CPU available only on the increasingly-proprietary Mac platform. So this entire thread is kind of pointless with regard to many real-world use cases.
- madengr 5y agoCame here to say the same. I don’t know of any computational heavy engineering software available for the Mac. Unfortunately I’m stuck on Windows for all my software.
- _ph_ 5y agoWell, the Apple Silicon Macs just arrived. If they are a compelling architecture for engineering software, then sooner or later a company will support them. Also, most Unix-based software should be rather easy portable, especially programs for computations which do not depend on a GUI. There is a lot of engineering software which is only available on Unix and these days mostly on Linux, as it comes from times when Windows and PCs where not even remotely a consideration as a platform.
- alimov 5y agoSaying nothing in so many words. > “If a CPU doesn't run the OS and software I need to run, it might as well be a GPU or …” > So this entire thread is kind of pointless with regard to many real-world use cases. Does this kind of reasoning apply to everything that doesn’t suit your unique personal needs? Personally I think this is an interesting thread, but I don’t use the qualifier of “is it useful to me” to determine whether something is interesting.
- lupire 5y agoAlternatively, your OS of choice may as well be a Cray 9 OS if it doesn't run on modern high-end hardware. Philosophical purity rarely provides top performance. And that's OK, slow and steady works for me, because I'm not doing max performance computing.
- gigatexal 5y agoI know you're getting downvoted but I feel more or less the same. That's why I am following the Asahi linux folks so closely. I really want them to succeed and for their work to make it possible for Fedora or Ubuntu to be a seamless experience on the M-* Apple hardware.
- my123 5y agoApple 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 5y 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 5y 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
- whatever1 5y agoBecause GPUs calculations are the same type of calculations. If you have a problem where you need to add plus 1 in all of the elements of a matrix, then GPUs are great. Games are a great example because you can take one pixel and calculate its values over time without much worry of what happens around it. Similar story for neural nets. For CFD it is a different problem. In each time-step you essentially solving a linear system Ax=b, so even if you are looking at element x(100,100,timeperiod2) you need to also know the value of the element x(1,1,timeperiod1). There are some algorithms that decouple the problem by introducing residuals for each element and then trying to iteratively reduce them, but as you can see, it is not a linear increase in speed as someone would had expected by looking at the GPU specs. TLDR: Yes you can do CFD with GPUs, but dont expect miracles.
- dekhn 5y agousing GPUs for CFD is pretty standard these days and has been for a few years. GPUs are fantastic for solving linear systems. Nobody uses GPUs for "linear speedups by looking at GPU specs". That's not how accelerators are measured.
- whatever1 5y ago"using GPUs for CFD is pretty standard these days and has been for a few years. " It is not standard in OpenFoam (only though rapidCFD) or Ansys (only this year they made an announcement for full acceleration). "GPUs are fantastic for solving linear systems." *Some* linear systems. They are horrible for sparse algebra.