179 questions
No questions match those filters.
Your Triton softmax runs at 1.9 ms but torch.compile ac...
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 naive softmax implementation often uses two passes: one to find the maximum and another to compute the exponential and normalization. This results in redundant HBM reads. To close the performance gap, implement an online softmax. This technique tracks the running maximum (m) and running sum (d) as scalar accumulators across a loop over column tiles. At each new tile, you apply the correction term (emprev-mnew) to the accumulated sum before adding new terms, effectively reducing the operation to a single pass and significantly lowering HBM bandwidth requirements.