Back-of-envelope estimates before provisioning hardware.
MLSys·im produces quick, type-safe analytical estimates for capacity planning, hardware selection, cost modeling, and sustainability analysis, in seconds and from specifications alone. Equations are documented and tied to the relevant literature; hardware registry specs come from datasheets where available.
Why Use Analytical Models
Before running expensive benchmarks or provisioning cloud instances, an engineer needs directional answers:
Will this model fit in GPU memory? Check before renting the GPU
Why does training fail when inference fits? Separate weights, gradients, optimizer state, and activations
What is the expected TTFT for my LLM? Estimate before building the serving stack
How many replicas do I need for a P99 target? Size serving capacity before benchmarking
What is the MoE routing tax? Sweep expert imbalance before choosing EP topology
How many H100s do I actually need? Model scaling efficiency before buying the cluster
What will this cost per year? TCO analysis before signing the contract
How often will my training job crash? Reliability modeling before committing to a 30-day run
What is the carbon footprint of this deployment? Quantify before the sustainability review
MLSys·im answers these in microseconds using first-order equations. It does not replace profiling, but it shows where to start profiling.
TipTheory Behind the Tools
Each solver implements equations from the Math Foundations page. For the full conceptual framework, see the companion slide decks linked in the Solver-to-Slides Map below.
Quick Start: Roofline Analysis
The Engine implements the Roofline Performance Model (Williams et al. 2009) to classify workloads as compute-bound or memory-bound.
Compute, 0.57 ms
MFU: 4.6%, Arithmetic Intensity: 145.84 flop / B
The returned PerformanceProfile reports latency, throughput, bottleneck classification, Model FLOPs Utilization (MFU), arithmetic intensity, energy, and a feasibility flag, which together support a first-pass hardware assessment.
All quantities are pint.Quantity objects. Unit conversions are explicit, and dimensional errors are caught at runtime:
import mlsysimhw = mlsysim.Hardware.Cloud.A100print(hw.compute.peak_flops.to("TFLOPs/s"))print(hw.memory.bandwidth.to("TB/s"))try: hw.memory.bandwidth.to("second")exceptExceptionas err:print(f"{type(err).__name__}: bytes per second can never become seconds")
312.0 TFLOPs/s
2.039 TB/s
DimensionalityError: bytes per second can never become seconds
Pint catches physical-dimension mismatches (bytes per second can never become seconds). Since 2026-06, compute work also has its own pint dimension, so a bare .to("flop/s") on a bandwidth raises DimensionalityError directly, as does adding a FLOP rate to a memory bandwidth:
Bytes, counts, parameters, and dollars remain dimensionless aliases, so MLSys·im additionally enforces unit-family checks at every schema boundary (require_unit_family in mlsysim.core.types) to keep those distinct. A field declared as memory bandwidth rejects a count rate, and vice versa.
Solver-to-Slides Map
Each MLSys·im solver maps to specific chapters and slide decks from the Machine Learning Systems textbook. Use these for the full theoretical grounding behind each solver.