-
Notifications
You must be signed in to change notification settings - Fork 111
try to debug CI failure in save to data #231
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
Conversation
This reverts commit 96d16eb.
That's an odd bug. Do you expect it's related to Swift? Otherwise we should investigate it on the C++ side 🤔 |
It looks like it is entirely on the C++ side, but it is a bit hard to say for sure debugging through CI runs. Curiously it doesn't happen when loading files from disk (and that seems to go through the same path). I printed the base64 of the file contents and manually examined and loaded them -- they were fine! |
I think it would require an older os/xcode to really debug it. Per circleCI here is what runs: Xcode 15.3 (15E204a) The former is probably the key part |
Switching to Xcode 16.0 "fixes" the issue. Same base64 data, but with that it doesn't hit an error -- that is why I suspect something in the toolchain. |
@@ -219,7 +219,7 @@ private func new_mlx_io_vtable_dataIO() -> mlx_io_vtable { | |||
let state = Unmanaged<IOState>.fromOpaque(ptr!).takeUnretainedValue() | |||
|
|||
if n + state.offset <= state.data.count { | |||
let _ = state.data.withContiguousStorageIfAvailable { buffer in | |||
_ = state.data.withUnsafeBytes { buffer in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it comes down to this -- for whatever reason the other method doesn't enter the closure with the older Xcode/swift.
There are no other uses of withContiguousStorageIfAvailable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!!
CI failing on main but not on branch merged. Also doesn't fail locally. Debugging
OK, clearly I am missing something with CI -- it does show as a failure when I go back to look at it:
The problem seems to be compiler/tools side -- I investigated the output of the saveToData and it was the correct format and worked when I injected it on my machine. It seemed to be something in the compile of this code:
anyway, a newer Xcode/compiler fixed it, so unless it is needed on older systems it is now marked as only available in a newer compiler.