You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix SIGABRT/SIGSEGV from concurrent mx::eval dispatch
MLX is not thread-safe (ml-explore/mlx#2133). The Metal
CommandEncoder is shared state — concurrent mx::eval calls from
different OS threads crash with "A command encoder is already
encoding to this command buffer" (SIGABRT) or SIGSEGV. The M14
soak tests were the first to exercise concurrent eval from
multiple dirty-CPU scheduler threads.
Fix:
- Add emily::safe_eval() with a static mutex serialising all
mx::eval calls (c_src/emily/tensor.hpp)
- Remove set_default_stream calls from with_stream/2 — the NIF
mutated MLX thread-local state which is unreliable under BEAM
process migration between OS threads
- Harden resolve_stream(-1) to avoid reading thread-local default
Also adds M15.5 milestone for building MLX from source once
upstream gains native thread-safety (0.32+).
0 commit comments