-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ exception when reshaping after transposing on GPU #104
Comments
I doesn't reproduce for me on macOS Sonoma 14.4:
I will have to try it on Sequoia |
Seems related to ml-explore/mlx-c#30. I think we should wait until updating MLX Swift and MLX C to the latest MLX then try this again. MLX Core had a few updates to get it working with OS 15 ml-explore/mlx#1208 |
#101 puts mlx-swift on the latest mlx -- can you give this a try again? |
I'm still getting the same crash in Xcode 16 with error
Xcode 15 doesn't crash, but now shows the warnings, which wasn't the case before. |
Those are from the JIT compile and are not related. OK, so it is still failing this particular test on Sequoia (macOS 15) |
Yeah. Still throw the error after updating to the latest version 0.15.2 |
I tried this on the main and the latest tag of mlx-swift, and still getting the same crash. |
This might be related to ml-explore/mlx-examples#642 |
OK, I can reproduce this on macOS 15 with Xcode 16. I find that it reproduces with Debug builds but not Release. The problem is in:
The code executes the same way in Release but appears to silently pass when evaluating It doesn't crash in Release because this macro in vector is empty:
|
And this is turned on in Debug builds and appears to be new in macOS 15:
|
More info here in the Apple Xcode 16 C++ language support docs: |
Getting same error when calling:
Mac Version 15.0 Beta (24A5279h) |
Right, there is no fix yet, but we have a better handle on what is going on and why it shows up in macOS 15 |
Note: this is merged in the mlx core side but not picked up in mlx-swift yet. |
Any idea when this will be in mlx-swift? |
They just cut a release of the mlx core so I would need to integrate that. Hopefully next week. You can avoid the assertion by building Release, though that doesn't actually avoid the underlying bug that the new assertions picked up. |
This should be fixed once #115 merges |
Merged #115, please try this out |
This fixes the crash for me. |
It fixes for me too, thanks! |
The following code (or this sample project):
results in a c++ vector index out of bounds exception on the last reshape operation with the following backtrace:
Click to expand
Similar code in mlx python doesn't crash. When I do the same operation on the CPU, it doesn't crash.
I'm running this on Xcode 16 b1 with macOS Sequoia b1.
The text was updated successfully, but these errors were encountered: