Crash when initializing MLXArray
Xcode 16.4 iOS 18.5 MacOS 15.6.1
Can you see what the error it is aborting on shows (frame 5 perhaps)?
Do you only see this when running tests? Are these tests hosted in an application?
Just shared the project for debugging, thanks!
Step: Run the app in simulator, and tap the "Run test" button, it would happen. @davidkoski
Ah, "Run the app in simulator" is the key.
- https://swiftpackageindex.com/ml-explore/mlx-swift/main/documentation/mlx/running-on-ios#Developing-for-iOS
This doesn't support the right class of GPU and can't run there.
Thank for helping me😜, I ran it on my device smoothly, but got another issue:
MLX error: float64 is not supported on the GPU at /Users/jeffrey/Library/Developer/Xcode/DerivedData/FSRS-swift-hdllzmbelgdqumagmcfkkezkpgrm/SourcePackages/checkouts/mlx-swift/Source/Cmlx/mlx-c/mlx/c/ops.cpp:643
OK, I think you have two choices:
- run the float64 part on the CPU
- don't use float64, use float32 or float16