News for hackers. Stuff that matters.
Re:2022 Mac Studio (20-core M1 Ultra) Review by torginus on Thursday April 28, 2022 @05:02PM (#31198172)
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.
Re:2022 Mac Studio (20-core M1 Ultra) Review by my123 on Thursday April 28, 2022 @07:20PM (#31199437)
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.

Re:2022 Mac Studio (20-core M1 Ultra) Review by paulmd on Thursday April 28, 2022 @08:14PM (#31199821)
You 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!

Re:2022 Mac Studio (20-core M1 Ultra) Review by my123 on Thursday April 28, 2022 @08:20PM (#31199868)
> 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

Re:2022 Mac Studio (20-core M1 Ultra) Review by the_svd_doctor on Thursday April 28, 2022 @05:05PM (#31198219)
Well that particular NASA code is from the 90’s and in Fortran. Maybe with MPI. That’s probably part of the reason why.
Re:2022 Mac Studio (20-core M1 Ultra) Review by willis936 on Thursday April 28, 2022 @07:36PM (#31199564)
Don't all high performance math libraries have the option of LAPACK interfaces?
Re:2022 Mac Studio (20-core M1 Ultra) Review by whatever1 on Friday April 29, 2022 @02:18AM (#31202007)
Because 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.

Re:2022 Mac Studio (20-core M1 Ultra) Review by dekhn on Friday April 29, 2022 @10:03AM (#31205226)
using 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.

Re:2022 Mac Studio (20-core M1 Ultra) Review by whatever1 on Friday April 29, 2022 @11:14AM (#31206203)
"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.

Re:2022 Mac Studio (20-core M1 Ultra) Review by CamperBob2 on Thursday April 28, 2022 @06:36PM (#31199091)
If 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.

Re:2022 Mac Studio (20-core M1 Ultra) Review by alimov on Thursday April 28, 2022 @07:54PM (#31199691)
Saying 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.

Re:2022 Mac Studio (20-core M1 Ultra) Review by gigatexal on Friday April 29, 2022 @05:40AM (#31203223)
I 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.
Re:2022 Mac Studio (20-core M1 Ultra) Review by lupire on Thursday April 28, 2022 @08:11PM (#31199804)
Alternatively, 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.

Re:2022 Mac Studio (20-core M1 Ultra) Review by madengr on Thursday April 28, 2022 @07:25PM (#31199486)
Came 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.
Re:2022 Mac Studio (20-core M1 Ultra) Review by _ph_ on Friday April 29, 2022 @03:33AM (#31202418)
Well, 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.