News for hackers. Stuff that matters.
Re:Jamba: Production-grade Mamba-based AI model by pama on Friday March 29, 2024 @12:01AM (#39860568)
The big (huge?) memory requirement is during training. These LLMs work with high dimensional vectors and they calculate gradients with respect to high dimensional vectors and they do updates that require state of the optimizer. If you have 3 particles in 3 dimensions and you need their forces that creates 3 new 3D vectors and once you update their position along the forces then they also carry momenta. Now generalize these simple 3-body physics to the typical 60-layer creatures inside the LLM with vectors of several thousand dimensions, interactions/weights that are scaling like the squares of these vectors, to a total parameter count that adds up to the 10s to 100s of billions of parameters, and then take derivatives and start to keep track of momenta. It is a feat of modern engineering that some groups can train such models efficiently. I hope we will see more of the training stories becoming public in the near future.
Re:Jamba: Production-grade Mamba-based AI model by nl on Friday March 29, 2024 @03:53AM (#39861600)
This is wrong. You need big memory during inference too.

The difference there is you can use tricks like quantisation and offloading to CPU to reduce it somewhat at the cost of accuracy and/or speed.

Re:Jamba: Production-grade Mamba-based AI model by brrrrrm on Friday March 29, 2024 @09:45AM (#39864049)
Training is 3x the memory used by inference, and usually run at a much larger batch size
Re:Jamba: Production-grade Mamba-based AI model by pama on Friday March 29, 2024 @09:56PM (#39871125)
Not sure what you mean by wrong. I have never encountered a case yet when training an LLM (no matter what architecture) would require limited memory and was pointing out that the typical memory requirements for training are much higher yet than the typical requirements for inference.