ExecutorSpec¶
Bases: Serializable
Picklable recipe for building a fresh executor of a given backend.
A spec is plain data, built either from a live loky executor
(introspection, loky only) or by the submitit and mpi4py
constructors. Other backends still need an explicit factory.
An instance is itself a zero-argument factory (__call__ builds and
returns a new executor), so it satisfies the factory-callable
requirement ParallelStrategy has for shot_executor whenever
program_executor chunking is in play -- this is what lets a caller
hand ParallelStrategy an ordinary live executor directly (see
_introspect_executor_spec) instead of writing a factory function by
hand.
Attributes¶
| Name | Type | Value | Doc |
|---|---|---|---|
exec_backend |
str |
unset | |
kwargs |
dict[str, Any] |
unset |
decode¶
Inherited static method from Serializable.decode().
dump¶
Inherited method from Serializable.dump().
encode¶
Inherited static method from Serializable.encode().
load¶
Inherited class method from Serializable.load().
mpi4py
classmethod
¶
mpi4py(**kwargs: Any) -> ExecutorSpec
Spec for an mpi4py.futures.MPIPoolExecutor.
kwargs go to MPIPoolExecutor and must be data, so worker setup
such as initializer needs a factory.
read¶
Inherited class method from Serializable.read().
serialize_function¶
Inherited static method from Serializable.serialize_function().
submitit
classmethod
¶
submitit(folder: str | PathLike[str], cluster: str | None = None, **parameters: Any) -> ExecutorSpec
Spec for a submitit.AutoExecutor.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
folder
|
str | PathLike[str]
|
Log and job folder. Stored as an absolute path, so a resume from another directory writes to the same folder. |
required |
cluster
|
str | None
|
Submitit cluster name. |
None
|
**parameters
|
Any
|
Passed to |
{}
|
write¶
Inherited method from Serializable.write().