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 nomp_contextbecause 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
ProcessPoolExecutorConfiginstead.Added in version 0.6.0.
Attributes
initargsPositional arguments passed to
initializer.initializerCallable run once in each worker before it processes any work.
max_workersNumber of workers.