Top
Best
New

Posted by ingve 23 hours ago

Samsung's Processing-in-Memory (PIM)(chipsandcheese.com)
251 points | 96 commentspage 2
reliabilityguy 21 hours ago|
Interesting that Samsung still pursues PIM. IIRC they had a paper in ISCA21 or 22 where they showed HBM2 module with PIM, which back then impressed me quite a lot.

That being said, I am not sure what’s the killer application for this technology, and without such application adoption is unlikely.

xyzzy123 21 hours ago||
As I understand it, the killer app is llms. You could run MACs directly in RAM, offloading a lot of work from CPU and cutting down on insane (external) memory bandwidth required.

Imagine (this is a fantasy pitch but potentially achievable for some use cases) wanting to run a larger llm and all you have to do is buy more RAM so it fits.

reliabilityguy 18 hours ago|||
> You could run MACs directly in RAM

Sure, MACs are nice. However, unless there other, PIM-specific/optimal, algorithms, regular matrix multiplication algorithms like tiling-based won’t work here I think — how would the tile be shared? By doing read/write all the time?

whatshisface 10 hours ago||
Attention calculations aren't shared across more than one vector during next token prediction (thinking and writing) which this sounds almost perfect for. Per attention layer, for deepseek at 1M context, you want to broadcast a single 1KB vector to 4GB of dot products, and map reduce a 1KB vector back.
reliabilityguy 10 hours ago||
How exactly the map-reduce will happen though? Won’t you need to do it host-side, or make a lot of reads and writes?

Also, doesn’t it mean that you forgo batching?

ACCount37 7 hours ago|||
Map-reduce is implemented as a rolling calc, see: online softmax in FlashAttention kernels.
reliabilityguy 2 hours ago||
Rollie calculation, like the online softmax in FA, implies a centralized computing unit that does the compute and stores the intermediate results in its registers. With PIM you have no centralized compute unit, you have a bunch of memory, and a bunch of MACs all over the place.

How would you do map-reduce across multiple DIMMs w/o extra reads/writes?

PIM implies some sort of distributed compute, which can work for some cases, but I am not sure LLMs are one of them.

whatshisface 54 minutes ago||
Re-arrange x+(y+(z+w)) into (x+y)+(z+w) to accomplish a distributed sum. Shared bus, interconnect fabric. This is a supercomputer on a chip.
embedding-shape 21 hours ago||||
> Imagine (this is a fantasy pitch but potentially achievable for some use cases) wanting to run a larger llm and all you have to do is buy more RAM so it fits.

Isn't this how it works today already? Granted you wanted to run it on RAM rather than VRAM.

petu 20 hours ago||
Yes, but running out of RAM is impractical due to low memory bandwidth.

According to the article/Samsung RAM dies inside can support way higher bandwidth than they expose, they're limited by external interface / bus width:

> Together, they can utilize the chip’s internal bandwidth across all 16 banks, which comes out to 614 GB/s. For comparison, regular DRAM accesses can hit two banks in parallel and max out at 76.8 GB/s.

And that's just for single 64-bit IC. So way faster and more power efficient.

dannyw 17 hours ago||
You can scale with more memory channels. Workstation/server platforms go up to 12 or 16 channels if I remember correctly.

Consumer platforms have been stuck at dual channel for decades; most of it I attribute to intentional product segmentation. I'm hoping that LLMs might change eventually for an upcoming consumer platforms; going to 4 channel would be really nice.

zerd 21 minutes ago||
How do you scale past 16 channels though? 16 channels give you around 614 GB/s, while PIM can do that per chip, so it can achieve 58TB/s.
amelius 20 hours ago||||
You: "AI, please write me $COOL_APP."

AI: "Sorry, all the hardware is made for running AI."

eru 18 hours ago||
We can run Doom on everything. Surely we can run some interesting apps on hardware that's originally made for AI. (One big moment for AI was when people figured out how to run it on hardware originally meant for Doom's successors.)
WithinReason 19 hours ago|||
[dead]
imtringued 18 hours ago|||
The idea is this:

You have an eight socket server with 96 memory slots, you add 96x PIM memories into the server (optimistic), load all the LLM parameters or KV cache in RAM and exclusively let it perform GEMV and let it rip.

614 GB/s x 96 = 58,944 GB/s.

Alternatively, the memory is used for embedded inference tasks. You can now upgrade from the limited single or two digit MB SRAM accelerators to reasonably fast single digit gigabyte models. Without MoE you could reach 100 tokens per second with an 8B fp8 model on a single channel. With MoE you might break 500 tokens per second.

reliabilityguy 2 hours ago|||
> load all the LLM parameters or KV cache in RAM and exclusively let it perform GEMV and let it rip.

Won’t you have a bunch of extra reads/writes via the CPU because these DIMMs won’t be able to compute matrix multiplications?

hoppp 17 hours ago|||
And now the 96 memory slots need individual cooling.
throwaway173738 13 hours ago||
Which might be easier since the surface is larger
netfortius 21 hours ago||
> That being said, I am not sure what's the killer application for this technology...

Build it, and they will come ;)

mr_toad 19 hours ago||
“ Each PIM block only has fast access to its locally attached DRAM bank. All other input data has to be brought in through the DRAM chip’s comparatively constrained external interface. PIM blocks can’t directly exchange data with each other, so the host has to move data using regular DRAM reads and writes if one PIM block needs to use results generated by another.”

So how big are these banks? If you can’t fit the weights of a layer into one bank then presumably you lose a lot of the speed gains.

londons_explore 19 hours ago||
Not necessarily. If your weights have to go across 2 banks, you just have to split and transfer the input and output vectors, which are much smaller.
imtringued 19 hours ago||
For GEMV you lose nothing.

The reason is quite simple. You can split the matrix along both dimensions so you just tile it into 64x64 or whatever fits into the bank and just fill it up. The biggest problem is load balancing the tiles across all banks for maximum parallelism.

For GEMM I believe there is no point in doing PIM, you are better off with a GPU or NPU.

harshaw 18 hours ago||
This is somewhat orthogonal to the article, but the whole bubble on AI data centers seems to presume that the need for compute is so massive that it far exceeds the expected optimizations we would expect with at scale inference (PIM, ASICs, etc). I would expect that there is a set of optimizations like this one (or variations) that would someone negate the buildout. But it's not really discussed.
Tenoke 18 hours ago||
There's been a ton of optimizations already, it hasn't remotely reduced demand even temporarily. More efficiency just makes the compute have even higher ROI per $ and watt spent.
roryirvine 18 hours ago||
With sufficient optimisation, there ought to be a tipping point beyond which local inference is good enough. And, sure, datacentre compute will still be needed for training but one of the biggest current uses will begin to taper off.

The question really is how soon we reach that tipping point, and whether it's before or after the current bubble runs out of steam for some other reason.

Tenoke 17 hours ago||
>there ought to be a tipping point beyond which local inference is good enough

There's no such ought really. Even at current levels you'd need like a 100x gain from here to approach current top proprietary models (probably a lot more for say Mythos or Mythos 2), and it's not like they are stoppng to improve. This is before we even account that you'd just be running 1 agent then, and not a swarm like you'd be able to in the cloud or that you can do only so much compression before you are losing out

eureka7 12 hours ago||
> (probably a lot more for say Mythos or Mythos 2)

Not everyone needs that large of a model, though.

petra 14 hours ago|||
It's not just inference, some things done in data centers like simulations, testing, are complementary to inference.

And in these types of hardware, the time between a successful prototype and a fully deployed product is pretty long. Maybe they count on that to know when to stop?

UltraSane 18 hours ago||
Jevons Paradox shows that increasing efficiency can increase demand for a product by making it cost effective for more uses.
glitchbot 5 hours ago||
That game is still going? I have a char from 06!
plywoodShadow 19 hours ago||
What about energy consumption? Wouldn't active cooling be needed for RAM as well as for CPU and GPU?
topspin 17 hours ago|
The better question is: what is the net gain for the overall system? If PIM reduces the net thermal load and power consumption of the system for the same workload, then it’s a win regardless of where the heat sinks end up. The customers Samsung has in mind for this today are not limited to commodity designs. They’re using novel designs with each new hardware generation, so moving heat sinks around is not a deal-breaker.
bhouston 19 hours ago||
I wrote up a theoretical post here about LMM performance of a MacBook Pro with PIM memory:

https://ben3d.ca/blog/m5-max-samsung-lpddr5-pim-650-tokens-p...

asaddhamani 19 hours ago||
Interesting read. Definitely hoping this works out so we can have cheap LLM machines at home
howdyhowdy 15 hours ago||
I thought DMR and Venice were supporting memory encryption by default. With the keys living on the CPU side and no standards for key sharing, I wonder how this will gain traction.
userbinator 21 hours ago||
In-memory computation was already possible with regular DRAM: https://news.ycombinator.com/item?id=22712811

Add a new set of CPU instructions like “rep macb”

...and it's been long enough now, that I can say there was an effort to implement this on standard x86 memory controllers and have the existing string instructions do so, back in the days of SDR SDRAM, but the tradeoffs weren't (yet) in favour.

PunchyHamster 19 hours ago|
that's not at all comparable, you're still paying memory latency and not getting any extra bandwidth
nottorp 11 hours ago||
Is this about the fake craters in moon photos?
latchkey 9 hours ago|
2021 https://patents.google.com/patent/US11600340B2/en

https://x.com/xennygrimmato_/status/2025376089607209218

More comments...