3 ms·
Do fused multiply-add operations for matrices really matter? There are two relevant cases I could come up with. 1. You have large matrices. In this case, I'd t
by johndough 3y ago
Do fused multiply-add operations for matrices really matter? There are two relevant cases I could come up with.
1. You have large matrices. In this case, I'd think that the O(n^2) addition can be ignored, because it gets dwarfed by the the O(n^3ish) multiplication.
2. You have small matrices. In this case, the computation is likely bound by memory bandwidth. Waiting for the matrices A and B takes most of the time. Then you multiply them, which should go quickly, since the matrices are small. Then you do the addition with the matrix C, but since the product AB is already in cache and since you'd have to wait for the matrix C anyway, there is not much to be gained with a fused multiply-add.