3 ms·
Is transposition a common enough operation that it might be better to avoid it by having versions of the operations/functions that take matrices that do the nec
by asplake 4mo ago
Is transposition a common enough operation that it might be better to avoid it by having versions of the operations/functions that take matrices that do the necessary transpositions implicitly?
- threatripper 4mo agoThis is already done as much as possible by reordering and merging operations but transposition (explicit or implicit) is unavoidable for some operations.
- yccs27 4mo agoA good example for this is A + A^T; you can fuse the two operations but you cannot get around the access pattern of matrix transposition.
- rhdunn 4mo agoIIRC, libraries like numpy and pytorch can already do that as they store the matrices as 1D arrays with information on things like the stride length (advancing to the next row). That allows you to implement operations like transposition by editing the stride length and other parameters without manipulating the content of the matrix array.