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 (see MAIN_PROCESS).

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.

mp_context

Multiprocessing start method (e.g. "spawn", "fork", "forkserver"), as accepted by multiprocessing.get_context().

mp_context: str | None = None

Multiprocessing start method (e.g. "spawn", "fork", "forkserver"), as accepted by multiprocessing.get_context(). None uses the default context.