Distributed JACCL server crashes when two requests arrive concurrently
Summary
With a distributed mlx_lm.server deployment using the JACCL backend, a
single request completes successfully, but two HTTP requests submitted at the
same time cause both distributed ranks to terminate. The clients receive an
empty reply (curl 52/HTTP 000).
Environment
- macOS on two Apple Silicon hosts with unified memory
mlx==0.32.0
mlx-metal==0.32.0
mlx-lm==0.31.3
- Python 3.11
- Distributed launch via
mlx.launch with a two-host JACCL hostfile
- OpenAI-compatible HTTP server endpoint
Reproduction
- Start the distributed server with the JACCL backend and wait for
/v1/models to return HTTP 200.
- Submit one normal completion request; it returns HTTP 200.
- Submit two otherwise valid completion requests concurrently (for example,
two simultaneous POST /v1/chat/completions requests).
- Repeat with both requests using the same generation mode. The failure is
not specific to mixing reasoning/thinking modes.
Expected behavior
The server should serialize or safely schedule concurrent requests, or return
an explicit overload response without terminating either distributed rank.
Actual behavior
Both requests fail with an empty HTTP response. The distributed server logs
include messages equivalent to:
_pickle.UnpicklingError: invalid load key
[jaccl] Recv failed with error code -12
rank 0 exited with code 255
The peer rank exits as part of the same failure. After the crash, the server
endpoint is unavailable until restarted.
Additional observations
- A single request succeeds immediately before the concurrent pair.
- The failure reproduces with
thinking=false + thinking=false,
thinking=true + thinking=true, and mixed modes.
- The failure occurs in both supervised and manually launched server modes.
- Serializing admission at the HTTP boundary avoids the concurrent crash, but
that is only a workaround and removes parallel request handling.
Could the JACCL transport or distributed server path support concurrent
request admission? If concurrency is currently unsupported, an explicit
server-side queue/lock or a documented limitation would prevent a process-wide
crash.
Distributed JACCL server crashes when two requests arrive concurrently
Summary
With a distributed
mlx_lm.serverdeployment using the JACCL backend, asingle request completes successfully, but two HTTP requests submitted at the
same time cause both distributed ranks to terminate. The clients receive an
empty reply (
curl52/HTTP 000).Environment
mlx==0.32.0mlx-metal==0.32.0mlx-lm==0.31.3mlx.launchwith a two-host JACCL hostfileReproduction
/v1/modelsto return HTTP 200.two simultaneous
POST /v1/chat/completionsrequests).not specific to mixing reasoning/thinking modes.
Expected behavior
The server should serialize or safely schedule concurrent requests, or return
an explicit overload response without terminating either distributed rank.
Actual behavior
Both requests fail with an empty HTTP response. The distributed server logs
include messages equivalent to:
The peer rank exits as part of the same failure. After the crash, the server
endpoint is unavailable until restarted.
Additional observations
thinking=false+thinking=false,thinking=true+thinking=true, and mixed modes.that is only a workaround and removes parallel request handling.
Could the JACCL transport or distributed server path support concurrent
request admission? If concurrency is currently unsupported, an explicit
server-side queue/lock or a documented limitation would prevent a process-wide
crash.