Encountering Error in MetalPerformanceShaders: Assertion Failure in MPSNDArray.mm

Hello,

I'm currently facing an issue while working with MetalPerformanceShaders in testing a Python project.

Code: https://github.com/Thinklab- SJTU/Crossformer

Error Description:

/AppleInternal/Library/BuildRoots/4e1473ee-9f66-11ee-8daf-cedaeb4cabe2/Library/Caches/com.apple.xbs/Sources/MetalPerformanceShaders/MPSCore/Types/MPSNDArray.mm:126: failed assertion `[MPSNDArrayDescriptor sliceDimension:withSubrange:] error: the range subRange.start + subRange.length does not fit in dimension[2] (15)'

I've tried updating macOS to the latest version. Also, I've attempted running the code with MPS_NO_DEVICE_CHECK=1 to bypass device checks. But errors happened again.

I'm seeking insights or solutions to this problem and If anyone has encountered a similar issue or has suggestions on how to troubleshoot and resolve this assertion failure, I would greatly appreciate your help.

Project Details:

  • Language: Python
  • Environment: PyCharm CE
  • Relevant Technologies: MetalPerformanceShaders, MPSNDArray

Thank you for your time and assistance!

  • Like this, error happened:

    python main_crossformer.py --data ETTh1 --in_len 720 --out_len 336 --seg_len 24 --itr 1

    It's so weird,when using this below and the error would not occur.

    python main_crossformer.py --data ETTh1 --in_len 168 --out_len 24 --seg_len 6 --itr 1

Add a Comment