MLSys·im is an analytical modeling framework for the stage before hardware is benchmarked or provisioned. It makes the first-order constraints explicit (memory, compute, network, data, reliability, cost, and carbon), which narrows the design space and shows which experiments are worth running.
Each of the four questions below maps to a solver. The analytical answer comes first; the sensitive parameters are then validated on the real stack once hardware is available.
Memory fit
Estimate weights, activations, optimizer state, KV cache, and communication buffers before a job fails at runtime.
The binding constraint
Separate compute, memory bandwidth, network communication, data input, reliability, cost, and carbon constraints.
Serving capacity
Size serving replicas for a QPS and p99 target, including batching and queueing assumptions.
Design-space sweeps
Sweep batch size, precision, parallelism, efficiency, geography, and hardware without needing cluster access.
At batch 1 on the theoretical ceiling (\(\eta = 1.0\)), ResNet-50’s arithmetic intensity is 146 FLOP/byte, just under the A100’s ridge point of 153 FLOP/byte. The memory term (0.028 ms) edges out the compute term (0.026 ms), though both are small next to the fixed dispatch overhead of 0.515 ms. The 0.54 ms total is mostly overhead, which is why batching helps so much here. Start from the Model Zoo and Silicon Zoo, or define a custom workload and hardware target.
What MLSys·im models
Every solver takes typed registry objects and returns an analytical estimate with units attached.
Roofline analysis
Compute versus memory bottlenecks, single-node latency and throughput.
Time to first token, inter-token latency, and KV-cache pressure. Llama 3 8B on an H100 with a 2,048-token prompt: 71 ms to first token, 5.2 ms per token after that.
Training memory breakdowns, serving replicas, and MoE routing imbalance. The same Llama 3 8B needs 15 GiB of weights plus 0.25 GiB of KV cache, out of 80 GiB on the H100.
The outputs are analytical estimates, not measurements. Use them to narrow the design space, expose assumptions, and choose the next experiment.
Check feasibility first. If memory, network, or data movement is infeasible analytically, benchmarking will not rescue the design.
Calibrate efficiency. Compute-heavy solvers expose an efficiency parameter. The defaults are literature-informed starting points; replace them with measured MFU or sustained throughput once those measurements exist.
Compare regimes. The most reliable conclusions are binding constraints, crossover points, and sensitivity rankings.
Escalate fidelity deliberately. Pick the few configurations worth validating with profiling, traces, or production load tests.
Build intuition for why ML systems behave as they do. Run roofline analysis, see the memory wall, and compute carbon footprints, all without GPU hardware.
Coursework, research, or infrastructure analysis that uses MLSys·im should cite it as shown below. The textbook has its own citation for work that draws on the book or the course materials.
@software{mlsysim2026, author = {Janapa Reddi, Vijay}, title = {{MLSys$\cdot$im}: First-Principles Infrastructure Modeling for Machine Learning Systems}, year = {2026}, url = {../mlsysim}, version = {0.3.1}, institution = {Harvard University}}
S. Williams, A. Waterman, and D. Patterson, “Roofline: An insightful visual performance model for multicore architectures,”Communications of the ACM, vol. 52, no. 4, pp. 65–76, 2009, doi: 10.1145/1498765.1498785.