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
[pipeline] 3/4: Subinterpreter worker-pool backend for placement regions (#1586)
Part 3/4 of the `.to()` region API; see
#1584 for the overall
design. Adds the subinterpreter worker-pool backend so a region can run
in subinterpreters, not just subprocesses. Still no public surface —
dormant until markers exist.
- Factors the process-specific bits of `_SubprocessPipelinePool` behind
a small `_PoolBackend` seam (`make_queue`, `spawn`, `try_put_shutdown`,
`close_queue`) with two implementations: `_ProcessBackend` (existing
`multiprocessing` behavior, unchanged) and `_InterpreterBackend`
(`concurrent.interpreters`, Python 3.14+). The streaming protocol and
worker body (`_pipeline_worker_loop`) are backend-agnostic and
unchanged; the worker is spawned via `interp.call_in_thread` and reaped
by joining its thread (subinterpreters can't be force-killed, so
teardown relies on the broadcast `_POOL_SHUTDOWN` marker the worker loop
already honors).
- `_fuse.py` now selects the backend by region-spec type:
`ProcessPoolExecutorConfig` → process backend (with the fork+threads
warning); `InterpreterPoolExecutorConfig` → subinterpreter backend, or a
clear `RuntimeError` on Python < 3.14. Replaces the previous
`NotImplementedError`.
- `interpreters.Queue` transports items by pickling like `mp.Queue`, so
no queue-protocol changes were needed and unpicklable intermediates stay
in the worker.
0 commit comments