Hacker News new | ask | show | jobs
by spwa4 25 days ago
One thing I wonder about is that these CPUs are just so much faster than their memory controllers. So why not add more? Why don't they have a memory controller per core, for example?
9 comments

Cost, and especially now, cost of memory! But you can buy AMD chips with 2 controllers (consumer), 4 (threadripper), 6 (8005), 12 (EPYC) memory channels, so in effect you can. Next generation Zen 6 Epyc has 16 channels. Roughly you get about 1 channel per chiplet, but you csn adjust if you need more memory bandwidth by buying fewer chiplets, eg there is an 8 core EPYC if you want to optimisise for bandwidth. But many applications are not bandwidth bound so this isn't the right choice, eg they are IO bound, rarely compute bound.
Memory controllers are pretty much limited by external pinout.

Zen 4 and newer consumer chips have 4 memory controllers (for legacy reasons shown as 2) which handle 32bit wide LPDDR5 or DDR5 interfaces (2x per dimm for DDR5)

The AM5 (desktop) socket has in addition to the 4x 32bit memory lanes, 28 PCI-E lanes (generally 16x for GPU, two 4x general purpose, one 4x to chipset), 4x combined DP/HDMI outputs, USB 2.0 port, 4 USB 3.2 Gen 2 ports. And that's just the major buses, there's ton of other components exposed (simpler IO, sound, power)

All of that counts to staggering 1718 pins - anyone remember when moving dual-channel K8 from 940 pin to 939 allowed removal of whole layer from motherboard PCB, making them way cheaper?

The high-end performance server socket from AMD has 6096 pins, significant chunk of it being the 24x 32bit DDR5 interfaces.

So unfortunately it's very much not easy to add more memory, and that's before considering issues with routing it on motherboard even if you accept changing shapes

I have no real idea of how much a "pin" costs though; it seems There was a brief period of affordable threadripper, but then product segmentation made that not great for amd...

Perhaps it's better to stick on am5 for a while, but it's not clear if this number of pins is somehow cost effective, or if it's just enough to beat Intel.

> There was a brief period of affordable threadripper, but then product segmentation made that not great for amd...

The thing they're doing which is completely insane is using different sockets for Threadripper and Epyc.

The primary difference between them isn't the price -- they're both expensive -- it's that Epyc uses the power budget to reach higher core counts and Threadripper uses it to hit higher clock speeds. So for example, Zen5 Threadripper 9975WX has 32 cores with a 4 GHz base clock and 5.4 GHz boost clock. There is no equivalent Zen5 Epyc, the most similar is 9375F which is 3.8GHz/4.8GHz. Conversely, Epyc 9755 has 128 Zen5 cores and Epyc 9965 has 192 Zen5c cores and there is no Threadripper with that many cores.

The reason this matters is that the system boards themselves are pricey, not just the CPUs, but as the platform starts to age you start to get a lot of old servers on the used market that originally had a bottom-end Epyc in them. Which you'd then like to pull and replace with a Threadripper -- i.e. pay them more money to buy a new Threadripper -- except that they inexplicably decided to screw you and themselves by using a different socket.

And the same thing the other way around. It also means you can't find an older workstation with the bottom-end Threadripper and pay them money for a high core count Epyc with better performance per watt to use it as a server.

Whoever did it this way doesn't seem to understand that market segmentation is intended to separate price segments rather than just creating arbitrary compatibility impairment between things that have similar prices.

Apparently it is nearly possible electrically for some EPYC/Threadripper combinations, but requires considerable investment on the motherboard side - muxing different firmware types, analog and digital logic to detect CPU type and modify some of the connections (including different VRM configuration)

So, possible to do by motherboard vendor, not necessarily enforced by AMD, expensive

Anything is possible if you want to hire an entire team of professionals and fabricate your own parts, but that's not the issue.

Consider that they could have had the opposite of that. Companies design a single board that can be used for either chip instead of two separate boards, and thereby have lower design costs, which allows them to sell the boards for less while making more money, which in turn makes customers happy and causes them to buy more of your chips.

The real issue is that the cost is not really on AMD - the cost is on motherboard vendors - more complex routing, thicker PCBs, etc. - all adds up.

A pin on underside of CPU is reasonably cheaper especially with how they've got a sea of wires working for the humongous models replacing previous serdes-based approach

The new Zen 6 Venice server CPUs have 32 x 32-bit DDR5 interfaces, which also work up to 12800 MT/s, double in comparison with the DDR5-6400 supported by the Zen 5 server CPUs.

So the socket is even bigger, but they no longer support 2 DIMMs per channel, so a CPU socket connects to only 16 DIMM sockets.

The reason we had the saga of "registered" aka "buffered" memory, and the various serial-link based memories, is just how it is to run wide parallel buses at high clock speeds.

At the newest speeds, it becomes impractical even with buffered drivers and self-clocking

That's true.

However, besides the big SP7 socket with 16 DIMMs and 1 DIMM per channel, Zen 6 Venice will be available also with the somewhat smaller SP8 socket, which uses the same 16 DIMM sockets, but here there are 2 DIMMs per channel at a halved number of channels, so the maximum memory throughput is halved, from 1.6 TByte/s to 0.8 TByte/s, while the maximum amount of memory stays the same, at 2 TB.

It is interesting that Zen 6 has 2 I/O dies, each with 8 memory controllers, but in the smaller SP8 socket the same 2 memory controllers are used, with only 4 memory controllers enabled in each I/O die, instead of using only 1 I/O die.

Presumably that was done in order to not reduce the number of PCIe lanes in the SP8 socket, which actually has more PCIe lanes than the SP7 socket.

It's possible also that most beneficial routing/partitioning for IOD made an impact, including actual Infinity Fabric topology and port counts
I think it mostly is for more controllers to be useful that means more PHYs and more actual pins on the package and more traces on the board and more sockets for the memory and... The space and cost of all of that is substantial (to a point, and then it just physically can't be manufactured).
More memory controllers would add more bandwidth. That can help, but few workloads are bottlenecked by memory bandwidth. (Dual memory channels have been a thing in desktops and laptops since the early 2000s single-core era at least, but newer generations of DDR have increased bandwidth to keep up with increased core counts.) What's really needed is less memory latency (less latency = faster), which has not improved as much as bandwidth.
Strata is!
"few workloads are bottlenecked by memory bandwidth" becomes a self-fulfilling prophecy at a certain point. Especially when companies are marketing AI stuff but still sticking with 128 bit memory busses for their mainstream models. Except for Apple, the only company competing on this metric.
This is probably why open weight models run so well on "old" Epyc hardware.
That doesn't help memory latency and most of the time a cpu is waiting it's because of latency, not bandwidth.
It's not always trivial to saturate available memory bandwidth. You may need to use more than one core, or you need to carefully consider the topology of the chip you're working with (see lstopo). For example, what if the L3 cache is actually split in two [0]? In such cases, adding more bandwidth doesn't do much for you.

[0] https://en.algorithmica.org/hpc/cpu-cache/sharing/#saturatin...

This is something AI is really good at. Plus, you don't need AI for this. In my time at <FANG> I made a "runtime compiler" that did this for parallelizable calculations (applying kernels on images, this was a long time ago). It didn't even need information on the machine it was running on, it just spent 5-6 seconds during startup trying some 50 different memory access patterns, figuring out the size of the cache from when it slows down, ... and then you had a simple language you could specify operations to execute on large images and it would do them. Fast. Very fast.

And yes, this was only worth doing for things that were memory bound. But anything relating to images is, pretty much.

I wrote something similar for regexes too. Get all matches from a massive file, or check massive numbers of lines of text and figure out which ones match a given regex. That too is still running. Even the AI models are now using it, although I'm told they at least also improved that one. I wonder how, actually.

A team took over the image compiler and it's still running, I'm told. I got 12k'd, of course. At this point there's literally ONE person left in the team that created the core tools, and he's the one known for going into management first chance he got.

I should write an open source version of this focusing on ML. I wonder how hard that actually is ...

> It didn't even need information on the machine it was running on, it just spent 5-6 seconds during startup trying some 50 different memory access patterns, figuring out the size of the cache from when it slows down, ... and then you had a simple language you could specify operations to execute on large images and it would do them. Fast. Very fast.

This is pretty cool. It sounds very similar to how FFTW works. You create a plan, and you give it as much time as you're willing to spend on planning. It will then use that time to find the fastest set of underlying kernels for your hardware and input size.

Nine women cannot make a baby in one month.
I wonder how much more cores I need to start meaningfully predicting keyboard input and have all the babies will all applicable bathwater ready before the clock starts.
CPUs are just so much faster than their memory controllers

This assumption isn't true. It takes solid optimization to end up limited by memory bandwidth. The problem is memory latency and that is not something that can be solved by adding more bandwidth from another memory controller.

128 cores x 288 pins per DIMM = 36864 pins on your socket, and all the motherboard traces. Good luck with that...
Ah I see. But those pins have to exist inside the package, right? Even if it all gets merged into one memory controller, the cores (or some unit that's repeated) would still need to have a memory-like protocol with something that aggregates them ... So why not stick the memory inside (or close enough) to the package?

Is that why M1-6 chips have the memory glued on top?

Why would each core need a direct connection to the DIMMs?
That'd give you the best memory bandwidth. A single core is more than capable of saturating a single memory channel in certain streams of instructions.

Early AMD x86-64 chips were exactly that, and EPYC Naples (gen 1) was similar - each CCD had 2 memory channels. Later EPYCs ran the memory controllers from a separate IOD, in part because the strong NUMA topology was a bit too much for some OS's (Windows) to handle.

But these days with the very high core counts, it is infeasible for a memory channel per core.

because 64GB/s is 256 bits per cycle at 2 GHz.

If you want to have an NoC, then you will need an ultra wide multi channel interface on the order of 4096 bits for 16 parallel 256 bit channels per row.