How does the multiply-accumulate cost of a standard convolution compare with that of a depthwise separable convolution ( depthwise followed by pointwise), for an output with input and output channels? What is the ratio for and ?
Deep learning, Convolutional networks
Level L3 Intermediate. Length Short. Nature Mat Mathematical.
What's being asked
Whether you can count the operations of each factorised step and simplify the ratio.
Key idea
A multiply-accumulate (MAC) is one multiplication added to a running sum. Counting MACs gives .
Steps
- Standard convolution: each of the outputs needs MACs, so the total is .
- Depthwise step: one filter per input channel, with no mixing across channels, so .
- Pointwise step: a convolution that mixes the channels, so .
- Ratio: , about fewer MACs. Parameter counts follow the same ratio ( vs , ignoring biases).
- Trade-off: spatial and channel mixing are split into separate steps, so each layer is less expressive. Depthwise convolutions also have low arithmetic intensity (little computation per byte read from memory), so the wall-clock speed-up on GPUs is smaller than the MAC ratio.
Common mistakes
- Giving the depthwise step a factor.
- Quoting the ratio as only.
- Assuming the MAC ratio equals the real speed-up.
How long your answer should be
4–5 lines; 2 minutes.
Last checked on 4 December 2026.
Read this
Previous in Deep learning: What is the batch normalisation forward pass for one feature? For a mini-batch of activations with , and , what are the outputs? What changes at inference time, and why do transformers use layer normalisation instead?
Next in Deep learning: With label smoothing on classes, what is the target distribution, and what is the gradient of the cross-entropy loss with respect to the logits? For , and true class 2, what are the target vector and the logit gap the model is pushed towards?