David Koski
David Koski
These look a little different -- I think it might be an assertion failure inside the pthread mutex. Are you using threads or async?
If you have a snippet that can reproduce the error I can investigate it.
MLXArray is not thread safe -- you can't create one on one thread and evaluate it (e.g/ calling `item()`) on another. This includes loading models and doing inference on different...
```c++ throw std::invalid_argument( "[eval] Attempting to eval an array without a primitive."); ``` and I can reproduce that in python -- it looks like an issue in mlx.core.
Filed https://github.com/ml-explore/mlx/issues/1083.
Strange, there used to be a snippet of code in here! Anyway, per the discussion in the other issue, this is the problem: ```swift func foo(x: MLXArray) -> MLXArray {...
OK, that is trying to access memory that is not mapped. The most likely cause is out of bounds indexing: the underlying `mlx::core::array` does not do bounds checking. What does...
Well, running everything on the cpu probably isn't getting all the advantages of mlx :-) If you ever have a repo that can reproduce the issue I would be happy...
I will take a look -- I suspect the readout (asArray) is expecting contiguous memory but not getting it. asData may have the same issue.
I think the problem is that `mlx-swift` isn't a framework, it is a SPM library. I tried making a new framework in your Xcode project: I also switched `mlx-swift` to...