trinity.explorer package

Submodules

Module contents

class trinity.explorer.Explorer(config: Config)[source]

Bases: object

Responsible for exploring the taskset.

__init__(config: Config)[source]
async setup_weight_sync_group(master_address: str, master_port: int, state_dict_meta: List | None = None)[source]
async prepare() None[source]

Preparation before running.

async get_weight(name: str) Tensor[source]

Get the weight of the loaded model (For checkpoint weights update).

async explore() str[source]
The timeline of the exploration process:
<——————————— one period ————————————-> |
explorer | <—————- step_1 ————–> | |
| <—————- step_2 ————–> | |
… |
| <—————- step_n —————> | |
| <———————- eval ——————–> | <– sync –> |

|--------------------------------------------------------------------------------------|

trainer | <– idle –> | <– step_1 –> | <– step_2 –> | … | <– step_n –> | <– sync –> |

async explore_step() bool[source]
async need_sync() bool[source]
need_eval() bool[source]
async eval()[source]

Evaluation on all evaluation data samples.

async benchmark() bool[source]

Benchmark the model checkpoints.

async save_checkpoint(sync_weight: bool = False) None[source]
async sync_weight() None[source]

Synchronize model weights.

async shutdown() None[source]
async is_alive() bool[source]

Check if the explorer is alive.

classmethod get_actor(config: Config)[source]

Get a Ray actor for the explorer.