AI Hardware & Software Stack
A matrix product followed by a bias add and a ReLU is fused from three separate kernels into one. What mainly decreases?
- AThe number of multiplications
- BThe amount of memory (HBM) traffic and the number of kernel launches
- CThe number of model weights
Show answer and explanation
Answer: B. The amount of memory (HBM) traffic and the number of kernel launches
With separate kernels, the matrix product writes its result to memory, the bias kernel reads and writes it, and the ReLU kernel reads and writes it again. Fused, the bias and ReLU are applied right where the product is computed and only the final result is written, eliminating two round trips of a large intermediate tensor and reducing launch overhead. The amount of computation itself is unchanged.
- A. The matrix product's multiplications are unchanged.
- B. Correct. The amount of computation is unchanged.
- C. The number of weights is unchanged.