by KingOfCoders · 4y ago · 0 comments
Ryzen 5xxx L1 32/32, L2 512, L3 32768
Ryzen 7xxx L1 32/32, L2 1024, L3 65536
M2 L1 192/128, L2 16384, SL 8192
M1 Ultra L1 192/128, L2 49152, SL 98304
[edit: see comment about latency cache comparison below]There's a trade-off: a bigger cache means a higher latency. According to https://twitter.com/chiakokhua/status/1564413952108335105 this doubling of the L2 cache already caused an increase of 2 cycles of latency.
> Ryzen L1 32/32
> M1/M2 L1 192/128
This is a consequence of Apple using a 16kiB page size, while the x86 world is stuck with a 4kiB page size. For technical reasons (the L1 lookup runs before or in parallel with the virtual to physical address translation), the L1 cache can only be indexed by the bits which don't change between virtual and physical addresses (that is, the bits representing the offset within the page), making it hard to increase the L1 cache size while keeping its latency low (and a low latency is very important in the L1 cache).
I don't know the latency for the Apple L2 caches, but it wouldn't surprise me if it's higher than the latency for the Intel and AMD L2 caches; having a larger L1 cache would mean Apple can afford to have a higher latency to the L2.
I can’t remember the exact article I read that in, but it’s pretty obvious when looking at Anandtech’s latency charts.
M1 latency: https://www.anandtech.com/show/17024/apple-m1-max-performanc...
Ryzen latency: https://www.anandtech.com/show/16214/amd-zen-3-ryzen-deep-di...
Ryzen 5xxxX3D: 96 MB of L3? https://www.anandtech.com/show/17337/the-amd-ryzen-7-5800x3d...
But it's not about "cache" per se, it's a different design. You need to do a lot more than just increase cache area to duplicate Apple's design choices.
[1] A big part of that is, of course, the architecture's genesis as a phone processor. Everyone loves to talk about how efficient the M1/2 are, but the truth is the CPU is a comparatively small part of the energy budget on devices with 5-10W displays. If you were designing a priori for a laptop, you wouldn't necessarily be as power-constrained in your design as the M chips.
Like the 5800X3D it will use 3D stacking to squeeze more cache into the same die area