I think the story is different if you use Strassen-like algorithms (or the recent AI-generated n^2.25-plus-epsilon stuff) to multiply matrices where columns belong to different conversations, but I also think that no one actually does this in practice. (Or maybe someone does (Strassen, not more recent galactic algorithms) for prefill, but prefill can be efficient with matrix-matrix multiplication where neither matrix mixes data from different sessions.)
In any case, I wouldn’t be surprised if vLLM fixes this for a different reason: RL works better if the training and rollout stacks produce numerically identical results. This is the specific issue that I recall Google posting about.
P.S. I think Google may not have been the innovator here - I just happen to remember Google’s post more clearly because it was very recent.
Can you share any resources that show how the batching works at a deeper level? I understand batching is critical to scaling inference to up to a billion concurrent users but I don't have a concrete understanding of how it all comes together.
LLMs work similarly. When doing inference, you need to load the LLM weights layer-by-layer from off-chip memory into on-chip memory. During decode (the stage where you generate new tokens; prefill is where you process the submitted prompt), memory bandwidth is often your bottleneck, not compute. You want to maximize flops per byte. The way to do that is to batch, that is, to load a "tile" of weights once and use it on data from multiple different conversations so memory and compute stay appropriately balanced.
Just like Silicon Valley companies fly their employees on United, Delta or American, not their own private fleet of jets, most companies, for cost efficiency reasons, will use "public" inference fleets that smooth the peaks and throughs from different companies in different timezones and with different usage patterns throughout the day. Because the main cost of a GPU is the cost of manufacturing the GPU, any second that the GPU sits idle is lost revenue, just like an empty hotel room or an empty seat is lost revenue. This makes private inference largely uneconomical.
Yes, it's unfortunately economically feasible for each individual to have a car. It's inefficient, but "secure" and we're all paying the price. At the same time, developed countries have a healthy amount of public transit in the mix - buses, trams, metro, etc. If you look at any city bus on a busy day, every person in it started in a different place than everyone else, and is going to a different destination, but there's enough individuals sharing large parts of their routes that the single bus can run end-to-end with 100 people in it at any point.
LLMs are just learning the same (bitter) security lessons that have been learned in other shared systems.