mythos.utils.scheduler
Scheduler hints for simulators and objectives.
This module provides the SchedulerHints dataclass and SchedulerUnit mixin for specifying resource requirements and scheduling options that can be translated to various execution engines (Ray, Dask, local, etc.).
Classes
Engine-agnostic scheduling hints for simulators and objectives. |
|
Mixin for classes that support scheduler hints. |
Module Contents
- class mythos.utils.scheduler.SchedulerHints[source]
Engine-agnostic scheduling hints for simulators and objectives.
These hints describe resource requirements and scheduling preferences that can be translated to engine-specific options at runtime.
- num_cpus
Number of CPUs required. None means unspecified (engine default).
- num_gpus
Number of GPUs required. Fractional values allowed for GPU sharing.
- mem_mb
Memory required in megabytes.
- max_retries
Maximum number of retries on failure.
- custom
Engine-specific options, structured as {“engine_name”: {“option”: value}}. For example: {“ray”: {“scheduling_strategy”: “SPREAD”}}.
- class mythos.utils.scheduler.SchedulerUnit[source]
Mixin for classes that support scheduler hints.
This mixin provides helper methods for accessing scheduler hints. Classes using this mixin must declare a scheduler_hints field:
scheduler_hints: SchedulerHints | None = None
Example
@chex.dataclass(frozen=True, kw_only=True) class MySimulator(Simulator, SchedulerUnit):
scheduler_hints: SchedulerHints | None = None
# … rest of simulator implementation
- scheduler_hints: SchedulerHints | None = None