179 questions
No questions match those filters.
Walk me through the roofline model for a LayerNorm kern...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansA LayerNorm kernel exhibits low arithmetic intensity, specifically around 3-7 scalar operations per element loaded. In the context of the roofline model, this places the kernel well to the left of the roofline ridge, indicating that performance is strictly limited by memory bandwidth rather than compute throughput. Because the kernel is memory-bound, the execution time is directly proportional to the amount of data moved. By switching to RMSNorm and eliminating the extra parameter-load pass associated with the bias term, the total memory traffic is reduced. This reduction in traffic translates to a proportional reduction in normalization wall time, which typically results in a 3-5% overall throughput gain for the model.