News for hackers. Stuff that matters.
Re:New Mac Mini with M4 by angoragoats on Tuesday October 29, 2024 @12:16PM (#41985843)
The memory bandwidth on Apple silicon is only sometimes comparable to, and in many cases worse than, that of a GPU. For example, an nVidia RTX 4060 Ti 16GB GPU (not a high-end card by any means) has memory bandwidth of 288GiB/sec, which is more than double that of the M4 CPU.

On the higher end, building a machine with 6 to 8 24GB GPUs such as RTX 3090s would be comparable in cost to a Mac Studio with 192GB of memory, and would be at least an order of magnitude faster at inference (as well as power usage, but what you probably should care about here is W/token which is in the same ballpark).

Apple silicon is a reasonable solution for inference only if you need the most amount of memory possible, you don't care about absolute performance, and you're unwilling to deal with a multi-GPU setup.

Re:New Mac Mini with M4 by Y-bar on Tuesday October 29, 2024 @12:18PM (#41985892)
Note that they said the _Mac Studio_ which in the M2 model has between 400GB/s and 800GB/s memory bandwidth.

https://www.apple.com/mac-studio/specs/

Edit: since my reply you have edited your comment to mention the Studio, but the fact remains that the M2 Max has at least ~40% greater bandwidth than the number you quoted as an example.

Re:New Mac Mini with M4 by nextos on Tuesday October 29, 2024 @12:27PM (#41986042)
Exactly, the M2 Ultra is competitive for local inference use cases given the 800 GB/s bandwith and a relatively low cost and energy efficiency.

The M4 Pro in the Mini has a bandwidth of 273 GB/s, which is probably less appealing. But I wonder how it'd compare cost-wise and performance-wise, with several Minis in a little cluster, each running a small LLM and exchanging messages. This could be interesting for a local agent architecture.

Re:New Mac Mini with M4 by angoragoats on Tuesday October 29, 2024 @12:31PM (#41986112)
See my sibling reply below, but I disagree with your main point here. M2 Ultra is only competitive for very specific use cases, it does not really cost less than a much higher-performing setup, and if what you care about is true efficiency (meaning, W/token, or how much energy does the computer use to produce a given response), a multi-GPU setup and Mac Studios are on about equal footing.
Re:New Mac Mini with M4 by reissbaker on Tuesday October 29, 2024 @12:32PM (#41986133)
For reference comparing to what the big companies use, an H100 has over 3TB/s bandwidth. A nice home lab might be built around 4090s — two years old at this point — which have about 1TB/s.

Apple's chips have the advantage of being able to be specced out with tons of RAM, but performance isn't going to be in the same ballpark of even fairly old Nvidia chips.

Re:New Mac Mini with M4 by Y-bar on Wednesday October 30, 2024 @05:11AM (#41993112)
The cheapest 4090 is EUR 110 less than a complete 32GB RAM M2 max Mac Studio where I live. Speccing out a full Intel 14700K computer (avoiding the expensive 14900) with 32 GB RAM, NVMe storage, case, power supply, motherboard, 10G Ethernet … and we are approaching the cost of the 64GB M2 ultra which has a more comparable memory bandwidth to the Nvidia card, but with more than twice the RAM available to the GPU.
Re:New Mac Mini with M4 by reissbaker on Wednesday October 30, 2024 @08:31PM (#42002197)
Apple will let you buy more RAM for cheaper than Nvidia, but it won't be the same speed — it'll be ~20% slower than a 4090.
Re:New Mac Mini with M4 by Y-bar on Thursday October 31, 2024 @05:50AM (#42005084)
That's my point. I would absolutely be willing to suffer a 20% memory bandwidth penalty if it means I can put 200% more data in the memory buffer to begin with. Not having to page in and out of disk storage quickly make those 20% irrelevant.
Re:New Mac Mini with M4 by reissbaker on Monday November 04, 2024 @02:16AM (#42039282)
If you have enough 4090s, you don't need to page in and out of disk: everything stays in VRAM and is fast. But it's true that if you just want it to work, and you don't need the fastest perf, Apple is cheaper!
Re:New Mac Mini with M4 by Y-bar on Tuesday November 05, 2024 @02:37AM (#42049412)
How _exactly_ do I keep 50+ Gigabytes of data in the 4090's VRAM without paging back and forth to disk?
Re:New Mac Mini with M4 by angoragoats on Wednesday November 06, 2024 @06:20PM (#42071105)
As the person you’re replying to said, by having multiple 4090s. 3090s work pretty well also, and are less than half the cost of 4090s.
Re:New Mac Mini with M4 by Y-bar on Thursday November 07, 2024 @04:09PM (#42081044)
How is that relevant when the discussion from the start was about comparing a two year old Mac with a two year old GPU as a cost-benefit discussion.

In any case how are you going to fit 50+GB in two (24+24 GB) Nvidia cards without swapping to disk?

Re:New Mac Mini with M4 by angoragoats on Friday November 08, 2024 @07:24AM (#42086320)
You seem confused. Please feel free to read my post near the top of this very chain of comments, where I specifically compare a Mac Studio to a machine with 6 to 8 Nvidia GPUs. That was the discussion “from the start.”

> In any case how are you going to fit 50+GB in two (theoretically 24+24 GB) Nvidia cards

No one was talking about only two cards.

Re:New Mac Mini with M4 by Y-bar on Saturday November 09, 2024 @09:54AM (#42094704)
> Mac Studio to a machine with 6 to 8 Nvidia GPUs.

That post read like a joke comparison and still does. Can you elaborate how it is relevant?

Re:New Mac Mini with M4 by angoragoats on Saturday November 09, 2024 @03:16PM (#42096615)
What seems like a joke about it? And relevant to what, exactly?

The parent of my initial comment in this thread said: "For inference, Apple chips are great due to a high memory bandwidth... It's a cost effective option if you need a lot of memory plus a high bandwidth."

My post was attempting to explain at a high level how 1) Apple SoCs do not really have high memory bandwidth compared to a cluster of GPUs, and 2) you can actually build that cluster of GPUs for the same cost or cheaper than a loaded Mac Studio, and it will drastically outperform the Mac.

If you want specifics on how to build such a GPU cluster, you can search for "ROMED8-2T 3090" for some examples.

I hope this helps.

Re:New Mac Mini with M4 by angoragoats on Tuesday October 29, 2024 @12:24PM (#41985985)
Yeah, sorry, I realized that as well so I edited my post to add a higher end example with multiple 3090s or similar cards. A single 3090 has just under 1TiB/sec of memory bandwidth.

One more edit: I'd also like to point out that memory bandwidth is important, but not sufficient for fast inference. My entire point here is that Apple silicon does have high memory bandwidth for sure, but for inference it's very much held back by the relative slowness of the GPU compared with dedicated nVidia/AMD cards.

Re:New Mac Mini with M4 by int_19h on Tuesday October 29, 2024 @02:15PM (#41987660)
It's still "fast enough" for even 120b models in practice, and you don't need to muck around with building a multi-GPU rig (and figuring out how to e.g. cool it properly).

It's definitely not what you'd want for your data center, but for home tinkering it has a very clear niche.

Re:New Mac Mini with M4 by angoragoats on Tuesday October 29, 2024 @04:43PM (#41989157)
> It's still "fast enough" for even 120b models in practice

Is it? This is very subjective. The Mac Studio would not be "fast enough" for me on even a 70b model, not necessarily because its output is slow, but because the prompt evaluation speed is quite bad. See [0] for example numbers; on Llama 3 70B at Q4_K_M quantization, it takes an M2 Ultra with 192GB about 8.5 seconds just to evaluate a 1024-token prompt. A machine with 6 3090s (which would likely come in cheaper than the Mac Studio) is over 6 times faster at prompt parsing.

A 120b model is likely going to be something like 1.5-2x slower at prompt evaluation, rendering it pretty much unusable (again, for me).

[0] https://github.com/XiongjieDai/GPU-Benchmarks-on-LLM-Inferen...

Re:New Mac Mini with M4 by cpuguy83 on Tuesday October 29, 2024 @02:20PM (#41987721)
And yet the GPU costs about as much as the whole Mac Mini and wouldn't even come close to fitting inside one.
Re:New Mac Mini with M4 by angoragoats on Tuesday October 29, 2024 @04:35PM (#41989067)
You're mostly correct, though a 4060Ti 16GB is 20-30% cheaper than the cheapest Mac Mini. More importantly though, "fits inside a Mac Mini" is not a criterion I'm using to evaluate whether a particular solution is suitable for LLM inference. If it is for you, that's fine, but we have vastly different priorities.