spdl.pipeline.defs.InterpreterPoolExecutorConfig

class InterpreterPoolExecutorConfig(max_workers: int | None = None, initializer: Callable[[...], object] | None = None, initargs: tuple[Any, ...] = ())[source]

[Experimental] A worker-pool executor backed by subinterpreters.

Like ProcessPoolExecutorConfig, but the workers are Python subinterpreters (concurrent.interpreters) sharing the process rather than separate processes. There is no mp_context because no new process is started.

Note

Requires Python 3.14 or later; using this target on an older interpreter is an error. NumPy and PyTorch cannot be imported inside a subinterpreter, so a region whose stages need them must use ProcessPoolExecutorConfig instead.

Added in version 0.6.0.

Attributes

initargs

Positional arguments passed to initializer.

initializer

Callable run once in each worker before it processes any work.

max_workers

Number of workers.