The deeper issue is batched inference including requests from several users. However a non-batched inference service would be significantly more expensive.
See my comment about Google’s post. Google and others have worked on deterministic inference, batched and otherwise. It takes more effort to set up but has no apparent substantial performance hit.
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.
Security and some sort of sandboxing is increasingly becoming a non-negotiable at most enterprises.
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.
If you are transporting thousands of independent passengers, it is cheaper to put them on a few big planes than to give each one a private jet. This is true, even though some passengers will shout that they have a bomb mid-flight and force that entire airplane to emergency land, causing losses to the airline and inconveniencing hundreds of others instead of just themselves. Other passengers are "noisy neighbors", literally and figuratively.
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.
Your explanation is very good at building intuition, but it has a data flaw - vLLM, at least, only does batching in the prefill phase, never the decode phase. It can simultaneously compute the KVs for multiple queries from multiple users if they all fit within a given prefill window (put multiple people on the same plane in your analogy), but once that is done the decode stage can only process one query at a time (the destination airport only has taxi service, no trains or connecting flights).