spdl.pipeline.defs.ProcessPoolExecutorConfig¶
- class ProcessPoolExecutorConfig(max_workers: int | None = None, initializer: Callable[[...], object] | None = None, initargs: tuple[Any, ...] = (), mp_context: str | None = None)[source]¶
[Experimental] A worker-pool executor backed by subprocesses.
Used as a
.to()target to run a region’s stages in a pool of worker processes as one nested pipeline — the op->op handoff stays in the worker, so intermediate values are not copied back to the main process and need not be picklable. The region ends at the next.to()target (seeMAIN_PROCESS).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.
Multiprocessing start method (e.g.
"spawn","fork","forkserver"), as accepted bymultiprocessing.get_context().- mp_context: str | None = None¶
Multiprocessing start method (e.g.
"spawn","fork","forkserver"), as accepted bymultiprocessing.get_context().Noneuses the default context.