AI Hardware & Software Stack
Why does increasing the batch size (the number of inputs processed together) tend to improve inference efficiency?
- AMore inputs reduce the computation per input
- BA larger batch reduces the number of weights
- CWeights read once serve several inputs, raising arithmetic intensity and keeping the arithmetic units busy
Show answer and explanation
Answer: C. Weights read once serve several inputs, raising arithmetic intensity and keeping the arithmetic units busy
With batch size B, multiplying the weight matrix by B vectors becomes a product of the weight matrix and a B-wide matrix. Weight reads stay the same while operations grow B-fold, so arithmetic intensity rises roughly B-fold and the workload moves from memory-bound toward compute-bound. Server inference uses GPUs efficiently by batching requests from many users together.
- A. Computation per input does not change.
- B. The number of weights does not change.
- C. Correct. Matrix-vector products become matrix-matrix products.