pyepo.func.runtime¶
Framework-neutral runtime setup for differentiable optimization modules.
Attributes¶
Classes¶
Validated state shared by the Torch and JAX frontends. |
Functions¶
|
Attach validated runtime state to a frontend module. |
|
Validate and normalize a requested solver-process count. |
|
Create a worker pool, optionally tied to an owner's lifetime. |
|
Initialize a frontend-specific solution pool from an |
|
Validate common module arguments and initialize solver runtime state. |
Module Contents¶
- pyepo.func.runtime.Reduction¶
- pyepo.func.runtime.T¶
- class pyepo.func.runtime.RuntimeState¶
Validated state shared by the Torch and JAX frontends.
- optmodel: pyepo.model.opt.optModel¶
- branch_rng: numpy.random.RandomState¶
- pyepo.func.runtime.bind_runtime_state(owner: Any, runtime: RuntimeState) None¶
Attach validated runtime state to a frontend module.
- pyepo.func.runtime.normalize_processes(optmodel: pyepo.model.opt.optModel, processes: int, logger: logging.Logger) int¶
Validate and normalize a requested solver-process count.
- pyepo.func.runtime.create_solver_pool(optmodel: pyepo.model.opt.optModel, processes: int, *, owner=None) pathos.multiprocessing.ProcessingPool | None¶
Create a worker pool, optionally tied to an owner’s lifetime.
- pyepo.func.runtime.init_solution_pool(dataset: pyepo.data.dataset.optDataset | None, solve_ratio: float, require_solpool: bool, unique: Callable[[object], T]) T | None¶
Initialize a frontend-specific solution pool from an
optDatasetwhen needed.
- pyepo.func.runtime.init_runtime(owner, optmodel: pyepo.model.opt.optModel, processes: int, solve_ratio: float, reduction: str, seed: int | None, logger: logging.Logger) RuntimeState¶
Validate common module arguments and initialize solver runtime state.