A decision guide for choosing the right MLSys·im analytical tool
MLSys·im provides specialized analytical resolvers for different classes of ML systems questions. This page maps each question to the right release-facing workflow and shows how to compose solvers for real-world analyses.
For the distinction between Engine, specialized solvers, and scenarios, start with Choosing a Python API.
Start With the Question
“How fast will my model run on this GPU?”
Use the SingleNodeModel. It applies the roofline model to determine whether the workload is compute-bound or memory-bound and returns latency, throughput, and bottleneck classification.
“How much memory and latency does group quantization or pruning save?”
Use the CompressionModel. It computes compressed weight bytes (including group-quantization scale metadata), effective speedup via Roofline analysis, and explicit accuracy trade-offs.
Use the ServingModel. It models the two distinct phases of single-device autoregressive inference: a compute-based prefill estimate (TTFT) and a decode estimate (ITL) that compares compute and memory bounds, plus KV-cache memory pressure, phase splitting, prompt caching, speculative decode, and an optional chunked-prefill stall proxy.
Use the TrainingMemoryModel. It separates weights, gradients, optimizer state, activations, and communication buffers so training memory is not confused with inference memory.
“How does performance scale across multiple GPUs?”
Use the DistributedModel. It decomposes workloads using 3D/4D parallelism (DP, TP, PP, EP) and calculates communication overhead, pipeline bubbles, and scaling efficiency.
Use the MoERoutingModel. It keeps MoE modeling first-order: total parameters set memory, active parameters set compute, and a routing-imbalance factor inflates expert-parallel all-to-all traffic.
Use the EconomicsModel. It calculates Total Cost of Ownership: CapEx (hardware purchase), OpEx (energy + maintenance), and total TCO over a specified duration.
Use the SustainabilityModel. It computes facility energy consumption (factoring in PUE), carbon emissions (using regional grid intensity), and on-site cooling water usage (\(E_{\text{IT}} \times \text{WUE}\)) across datacenter locations.
Use the ReliabilityModel. It estimates fleet-wide MTBF, failure probability for a given job duration, and the Young-Daly optimal checkpoint interval and waste fraction.
“What noise and step overhead does differential privacy add?”
Use the ResponsibleEngineeringModel. It computes the Gaussian mechanism noise multiplier (\(\sigma\)) and explicit per-sample gradient-clipping slowdown factor (\(1 + c_{\text{clip}}\)).
“Which multi-knob configuration satisfies my SLA?”
Code Examples
The examples below import solver classes from the canonical mlsysim.solvers namespace (from mlsysim.solvers import SingleNodeModel, or mlsysim.solvers.SingleNodeModel after import mlsysim).
Scaling efficiency: 56.0%
Bubble fraction: 15.8%
DP comm latency: 178.36 ms
Parameter sweeps
For multi-dimensional grid searches under explicit constraints, use DSE (see Design Space Exploration) or CompressionModel.sweep(). For quick one-parameter hardware comparisons, a plain Python loop keeps the analysis completely transparent:
NVIDIA T4 8.10 ms Compute
NVIDIA A100 1.70 ms Compute
NVIDIA H100 0.54 ms Compute
NVIDIA B200 0.24 ms Compute
Composing Solvers
Real-world questions often require chaining multiple solvers. The output of one solver feeds naturally into the next because all solvers share typed inputs and pint.Quantity-valued outputs.
How to Validate a Result
Use MLSys·im results in three passes:
Check feasibility first. Memory, KV cache, and checkpoint sizes are direct byte counts. If these say the configuration cannot fit, a benchmark will not make it fit.
Check the binding constraint. If the result is memory-bound, compare bandwidth-oriented alternatives; if it is compute-bound, compare FLOP/s and efficiency.
Calibrate before production commitments. For latency and throughput, measure one representative configuration, back-calculate efficiency, then reuse that calibrated value for sweeps. The default efficiency=0.5 is an informed starting point, not a universal constant.
Serving Llama-70B on H100s within budget
ServingModel / ServingCapacityModel: check single-GPU memory feasibility (e.g., INT4 on 1×H100) and size replica count for target QPS and P99 latency.
EconomicsModel: calculate the annual TCO of the resulting node fleet.
The most sustainable way to train GPT-3
DistributedModel: find the optimal parallelism configuration.
SustainabilityModel: compare carbon footprint across regions.
A100s or H100s for inference
SingleNodeModel on A100: get latency and bottleneck.
SingleNodeModel on H100: get latency and bottleneck.
EconomicsModel for each: compare cost per query.
Textbook Chapter Mapping
Each solver connects to canonical chapters, study sheets, and lecture decks in the Machine Learning Systems textbook (see the Cross-Volume Textbook Map for all chapters across Volumes I–IV).
Engine.solve() is a convenience shortcut that produces identical results to SingleNodeModel().solve(). Use Engine.solve() for quick single-node analysis. Use the individual solver classes (ServingModel, DistributedModel, etc.) for specialized analyses beyond the roofline.
Why Analytical Solvers
MLSys·im is not an empirical profiler (like PyTorch Profiler) or a cycle-accurate simulator (like gem5). It is an analytical modeling platform that computes performance bounds from specifications and first-order equations. This is a deliberate design choice:
Speed. Closed-form equations evaluate in microseconds. A sweep over thousands of hardware x model x parallelism configurations takes seconds, which is impossible with empirical profiling.
Intuition. By working from equations rather than opaque traces, students see exactly which physical quantity (bandwidth, compute, memory capacity) creates the bottleneck.
Accessibility. No hardware required. A laptop running pip install mlsysim produces the same analysis as a $50,000 GPU cluster.
Composability. Solvers can be chained because they share typed inputs/outputs. The output of one solver feeds naturally into the next.
Solver Architecture
Every solver follows the same three-step pattern:
Takes typed registry objects (HardwareNode, TransformerWorkload, Fleet, GridProfile) as input. These carry physical units (pint.Quantity), so dimensional errors are caught at runtime.
Returns typed results: frozen Pydantic result models (PerformanceProfile for SingleNodeModel, and domain *Result subclasses of AnalyticalResult for specialized solvers).
The key principle: every .solve() method is a pure function of its inputs. No hidden state, no side effects, no network calls.
Writing a Custom Solver
A custom solver subclasses ForwardModel and returns a frozen Pydantic result model so it composes cleanly with Pipeline, DSE, and differential explainers:
NVIDIA H100 1412.9 TFLOPs / kW / s
NVIDIA A100 780.0 TFLOPs / kW / s
NVIDIA T4 928.6 TFLOPs / kW / s
NVIDIA Jetson Orin NX 1000.0 TFLOPs / kW / s
Use pint.Quantity for all physical calculations so that unit errors are caught at runtime. For more complex solvers, inspect mlsysim/engine/solvers/ in the repository.