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.
Compute, 0.07 ms
MFU: 38.9%, Arithmetic Intensity: 84.55 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.
LLM Serving Analysis
The ServingModel models the two-phase LLM inference lifecycle (Vol I · Ch 13: Model Serving · Study sheet · Slides): compute-bound prefill and memory-bound autoregressive decoding on a single device.
ServingModel immediately flags that unquantized FP16 Llama-3.1-70B exceeds a single 80 GB H100 (Feasible: False), whereas INT4 quantization fits comfortably on one H100 (or FP16 can be sharded across a multi-GPU node).
Hardware Sweep Pattern
Compare devices programmatically instead of reading datasheets:
import mlsysimfrom mlsysim import Enginemodel = mlsysim.Models.Vision.ResNet50for hw in [mlsysim.Hardware.Cloud.H100, mlsysim.Hardware.Cloud.A100, mlsysim.Hardware.Cloud.T4, mlsysim.Hardware.Edge.JetsonOrinNX]: p = Engine.solve(model=model, hardware=hw, batch_size=32, precision="fp16")print(f"{hw.name:22s}{p.bottleneck:10s}{p.latency.to('ms'):>8.2f~}{p.throughput.to('1/s').magnitude:>8.0f} img/s")
NVIDIA H100 Compute 0.54 ms 59189 img/s
NVIDIA A100 Compute 1.70 ms 18856 img/s
NVIDIA T4 Compute 8.10 ms 3949 img/s
NVIDIA Jetson Orin NX Compute 21.19 ms 1510 img/s
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.