LLVM Error on MPS


I’ve been tried to build SimSiam from scratch for rectangular input. However, I have the following error:

loc("mps_matmul"("(mpsFileLoc): /AppleInternal/Library/BuildRoots/b6051351-c030-11ec-96e9-3e7866fcf3a1/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm":28:0)): error: inner dimensions differ 512 & 2048
loc("mps_matmul"("(mpsFileLoc): /AppleInternal/Library/BuildRoots/b6051351-c030-11ec-96e9-3e7866fcf3a1/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShadersGraph/mpsgraph/MetalPerformanceShadersGraph/Core/Files/MPSGraphUtilities.mm":28:0)): error: invalid shape
LLVM ERROR: Failed to infer result type(s).

I’m using Mac M1 with MacOS 12.4, torch.__version__ = 1.13.0.dev20220614
I have never encountered this error before. Can you guys help me with it? Thank you!


I also got this error. Have you solved it?

@thainamhoang @Dolan
error: inner dimensions differ 512 & 2048 seems to be occurred in matrix multiplication.
I don’t use Mac OS but you need to check the dimension of each tensor.
Especially nn.Linear, torch.mul and so on.