trinity.explorer.workflow_runner module#

The Workflow Runner Module.

class trinity.explorer.workflow_runner.Status(completed_runs: int, total_runs: int, metrics: List[Dict[str, float]], message: str | None = None)[source]#

Bases: object

Status of the task running result.

completed_runs: int#
total_runs: int#
metrics: List[Dict[str, float]]#
message: str | None = None#
property ok: bool#
__init__(completed_runs: int, total_runs: int, metrics: List[Dict[str, float]], message: str | None = None) → None#
class trinity.explorer.workflow_runner.RunnerExecutionResult(status: Status, experiences: List[Experience])[source]#

Bases: object

Execution result for one runner task.

status: Status#
experiences: List[Experience]#
__init__(status: Status, experiences: List[Experience]) → None#
class trinity.explorer.workflow_runner.WorkflowRunner(config: Config, rollout_model_id: int, auxiliary_model_ids: List[int] | None = None, runner_id: int | None = None)[source]#

Bases: object

A Ray remote actor to run the workflow and generate experiences.

__init__(config: Config, rollout_model_id: int, auxiliary_model_ids: List[int] | None = None, runner_id: int | None = None) → None[source]#
async prepare() → None[source]#

Prepare the runner.

is_alive()[source]#
async get_runner_state() → Dict[source]#

Get the runner state.

async run_task(task: Task, batch_id: str, repeat_times: int = 1, run_id_base: int = 0, collect_partial_runs: bool = True) → Tuple[Status, bytes][source]#

Run the task and return the states.

class trinity.explorer.workflow_runner.DebugWorkflowRunner(config: Config, output_dir: str = 'debug_output', enable_profiling: bool = False, disable_overwrite: bool = False)[source]#

Bases: WorkflowRunner

A WorkflowRunner for debugging.

__init__(config: Config, output_dir: str = 'debug_output', enable_profiling: bool = False, disable_overwrite: bool = False) → None[source]#
async debug() → None[source]#

Run the debug workflow.