Estimating Inference Capacity and Fleet Size
Explore how to perform back-of-the-envelope calculations for deploying large language models. Understand resource requirements including model storage, user data, inference server estimation, GPU fleet size, cost, and network bandwidth to efficiently plan scalable inference systems.
Previously, we devised a formula to estimate model training time and applied it to inference. Building on that foundation, this lesson performs quick BOTECs for the resources required to deploy an LLM at scale. We cover the following:
Storage estimation:
Model storage
User profile data
User interaction data
Indexing storage
Inference server and fleet estimation
GPU cost estimation
Network bandwidth estimation
With these calculations, we aim to estimate the end-to-end resource footprint for deploying LLMs at scale. Let’s start with resource estimation fundamentals.
Resource estimation
Resource estimation ensures the infrastructure can handle the expected workload efficiently while remaining cost-effective. It determines the compute, storage, and network requirements for scalability, reliability, and performance. Accurate estimation prevents over-provisioning, which inflates costs, and under-provisioning, which causes failures or poor user experience.
Note: These estimates depend on initial assumptions. For this course, we assume 100 million daily active users (DAU). These numbers will be refined as the system scales.
Storage requirements
Storage covers the model itself, user profile data, and user interaction data. Production systems may also store metadata, context, logs, prompt templates, and configuration files. We focus on the most essential components.
Let’s start with estimating the model’s storage.
Model storage
The storage for a model depends on its parameter count and the precision used to store each parameter. Data precision can be
At FP16 (2 bytes per parameter), a 3-billion-parameter model needs:
Higher precision improves accuracy but increases size and can slow inference. Quantization trades some accuracy for a smaller footprint.
User data and interaction data
Assume each user’s profile takes 10 KB and each user makes 10 interactions per day, with each interaction stored at 2 KB:
Indexing storage
Fast retrieval of interaction data requires an index. Assuming a 25% overhead:
The model and profile data are static, so they are excluded from the daily indexing calculation. The total daily storage is:
Over a 30-day month, this is