mythos.utils.scheduler ====================== .. py:module:: mythos.utils.scheduler .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: mythos.utils.scheduler.SchedulerHints mythos.utils.scheduler.SchedulerUnit Module Contents --------------- .. py:class:: SchedulerHints 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. .. attribute:: num_cpus Number of CPUs required. None means unspecified (engine default). .. attribute:: num_gpus Number of GPUs required. Fractional values allowed for GPU sharing. .. attribute:: mem_mb Memory required in megabytes. .. attribute:: max_retries Maximum number of retries on failure. .. attribute:: custom Engine-specific options, structured as {"engine_name": {"option": value}}. For example: {"ray": {"scheduling_strategy": "SPREAD"}}. .. py:attribute:: num_cpus :type: int | None :value: None .. py:attribute:: num_gpus :type: float | None :value: None .. py:attribute:: mem_mb :type: int | None :value: None .. py:attribute:: max_retries :type: int | None :value: None .. py:attribute:: custom :type: dict[str, dict[str, Any]] .. py:method:: to_dict(engine: str, rewrite_options: dict[str, str] | None = None) -> dict[str, Any] Convert SchedulerHints to a dictionary. :param engine: The target execution engine (e.g., "ray", "dask"). :param rewrite_options: Optional str->str mapping to rename standard options for the target engine. .. py:class:: SchedulerUnit 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 .. rubric:: Example @chex.dataclass(frozen=True, kw_only=True) class MySimulator(Simulator, SchedulerUnit): scheduler_hints: SchedulerHints | None = None # ... rest of simulator implementation .. py:attribute:: scheduler_hints :type: SchedulerHints | None :value: None