liveBook · Manning

Optimization

As explained in Machine Learning System Design

Optimization is the improvement of a system's performance or resource efficiency through changes to its models, serving process, code, or hardware.

Optimization improves system performance or resource efficiency by changing models, serving processes, code, or hardware. Start by measuring the whole system rather than assuming the model is the bottleneck. section 15.4.1

Use a practical sequence when improving a serving system:

  • Profile end-to-end performance and identify where time or resources are actually spent. section 15.4.1
  • Choose the most optimizable component, not automatically the slowest one. section 15.4.1
  • Prefer models and system designs that already fit requirements; use quantization, pruning, distillation, or scaling when justified. section 15.4.2
  • Match the effort to the situation: straightforward cloud scaling may suit an early product, while low-level optimization may pay off at large scale. section 15.4.2

A misleading latency target

A pipeline takes 200 ms: 120 ms comes from a highly optimized GPU model, while 80 ms comes from arbitrary Python preprocessing. Improving preprocessing is more promising than changing the model. In another pipeline, dozens of simple models spend only about 5% of runtime in inference, so batching fails to help; preprocessing improvements deliver a 40% speedup instead. section 15.4.1

How Machine Learning System Design covers it

How deep it goes
Explains profiling and design choices with timing examples, but stops short of implementation details for quantization, pruning, or distillation.
Examples
Uses 200-millisecond latency decomposition, sequential model pipelines, batching comparisons, preprocessing changes, and a 40% speedup.
What it assumes
Assumes familiarity with models, inference pipelines, latency, preprocessing, GPUs, and cloud resources while teaching profiling as the starting point.
What you can do after
Diagnose/debug with it by profiling end-to-end latency, selecting the most optimizable component, and matching effort to scale.
How it connects
Connects optimization to profiling, latency, data preprocessing, model selection, quantization, pruning, distillation, and cloud scaling.

Also explained in

Compare how 30 books explain optimization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.