-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
The c++ compile cache should be thread safe -- whatever mutable state is behind mlx::core::detail::compile
should be thread safe so it can safely be called from multiple threads (common in Swift, maybe C++).
See also:
- CompiledFunction is not thread safe mlx-swift#226
- Crashes occur when running multiple LLMEvaluators. mlx-swift#225
To Reproduce
See:
Note that the fix for this was to protect the inner function that mutates the arguments (as that is where the crash was observed), during discussion with @awni we think that the cache of graphs also needs locking (or whatever technique is appropriate) as it is also mutable state.
Expected behavior
Inner state of mlx::core should be thread safe or documented as not (like MLXArray).
Desktop (please complete the following information):
- OS Version: macOS15
- Version 0.23.1
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working