5.3.10 · D3MLOps & Deployment

Worked examples — Model serving frameworks (TorchServe, Triton)

2,371 words11 min readBack to topic

This page is the drill hall for Model serving frameworks (TorchServe, Triton). The parent gave you three formulas. Here we push each of them into every corner — every sign of the ratio , the zero cases, the infinite-batch limits, a word problem, and an exam trap.

Before touching a single number, let's re-anchor the three symbols so nobody uses a letter they haven't earned.

The single number that decides everything is the ratio . It answers: "how many samples' worth of compute does one door-opening cost?" Large → door is expensive → batching is a jackpot. Small → door is cheap → batching is pointless. Watch that ratio in every row below.


The scenario matrix

Every serving-math question you can be asked is one of these cells. The examples that follow are each tagged with the cell they cover.

Cell Regime / input What's special Example
A (large ) Overhead-bound → huge speedup Ex 1
B (small ) Compute-bound → batching flops Ex 2
C (r≈1) The "typical" middle Ex 3
D Limiting ceiling Ex 4
E Degenerate: no batch at all Ex 5
F Zero overhead → speedup is exactly 1 Ex 6
G Zero compute → division-by-zero danger Ex 6
H Throughput + concurrency Real capacity planning Ex 7
I Word problem: SLA vs delay budget under a p99 limit Ex 8
J Exam twist: find for target Invert the formula Ex 9

We visualise the whole landscape once, so every example lands on a curve you can see.

Figure — Model serving frameworks (TorchServe, Triton)

Look at the figure: three curves, one per regime. The magenta curve (overhead-bound) rockets up and flattens near a high ceiling. The orange curve (compute-bound) barely lifts off . The violet middle curve sits between. Every dashed horizontal line is that curve's ceiling . This is the mental picture behind all ten examples.


The worked examples


Recall Which single number predicts whether batching is worth it?

The ratio ::: overhead over marginal compute. Ceiling speedup is ; large → batch hard, small → don't bother (quantize instead).

Recall What is

when , and why? Exactly ::: a batch of one is serial — nothing is amortised, for any .

Recall Concurrency (

instances) vs batching — how do they combine in throughput? Multiply ::: batching sets per-instance throughput ; independent copies multiply it by until the GPU saturates.