-
When checking whether a matrix is transposed the implementation in mlx/mlx/backend/metal/matmul.cpp Lines 93 to 94 in 9eb7d73 Shouldn't The mlx/mlx/backend/cpu/matmul.cpp Lines 20 to 21 in 9eb7d73 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
I think the function is poorly named for what it does. It really does a check + optional copy in certain cases. And those cases are different for the CPU and GPU since the GPU can support irregular strides for the last two dimensions (in some cases).
For the CPU there is no irregular stride support in either of the last two dimensions so we always do a copy if the basic conditions are not met. |
Beta Was this translation helpful? Give feedback.
I think the function is poorly named for what it does. It really does a check + optional copy in certain cases. And those cases are different for the CPU and GPU since the GPU can support irregular strides for the last two dimensions (in some cases).
stx == arr.shape(-1)
(for example) does not need to be satisfied for non-vectorsFor the CPU there is no irregular stride support in either of the last two dimensions so we always do a copy if the basic co…