How does the multiply-accumulate cost of a standard k×k convolution compare with that of a depthwise separable convolution (k×k depthwise followed by 1×1 pointwise), for an H×W output with Cin input and Cout output channels? What is the ratio for k=3 and Cout=256?

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 depthwise separablestandard=HWk2Cin+HWCinCoutHWk2CinCout=1Cout+1k2.

Steps

  1. Standard convolution: each of the HWCout outputs needs k2Cin MACs, so the total is HWk2CinCout.
  2. Depthwise step: one k×k filter per input channel, with no mixing across channels, so HWk2Cin.
  3. Pointwise step: a 1×1 convolution that mixes the channels, so HWCinCout.
  4. Ratio: 1Cout+1k2=1256+19≈0.0039+0.1111=0.115, about 8.7× fewer MACs. Parameter counts follow the same ratio (k2CinCout vs k2Cin+CinCout, ignoring biases).
  5. 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

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 [1,2,3,6] with γ=2, β=1 and ϵ≈0, 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 K classes, what is the target distribution, and what is the gradient of the cross-entropy loss with respect to the logits? For K=3, ϵ=0.1 and true class 2, what are the target vector and the logit gap the model is pushed towards?