Failed assertion `destination datatype must be fp32' when using PyTorch with Metal Performance Shaders on A14 devices

Hello Apple Developer Community,

I'm experiencing an issue when using PyTorch in combination with Metal Performance Shaders (MPS) on an A14 device. During the execution of the backward() function, I encounter the following error message:

/AppleInternal/Library/BuildRoots/9941690d-bcf7-11ed-a645-863efbbaf80d/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSNDArray/Kernels/MPSNDArrayConvolutionA14.mm:4332: failed assertion `destination datatype must be fp32'

I have already verified that both the input tensors and gradient tensors are of float32 datatype before the backward() function is called. However, the error seems to be originating from the MPS code, specifically within the MPSNDArrayConvolutionA14.mm file.

Could you provide any guidance or recommendations on how to resolve this issue? Is there any specific constraint or requirement that I should be aware of when using MPS with PyTorch on A14 devices? I would greatly appreciate any help or suggestions.

Thank you in advance for your support.

Best regards, kiyotaka86

Hi @kiyotaka86. Have you had any luck mitigating this problem, yet?

Failed assertion `destination datatype must be fp32' when using PyTorch with Metal Performance Shaders on A14 devices
 
 
Q