trinity.trainer package#
Subpackages#
Submodules#
- trinity.trainer.trainer module
- trinity.trainer.verl_trainer module
CheckpointMonitorCheckpointMonitor.__init__()CheckpointMonitor.update_latest_checkpoint_step()CheckpointMonitor.update_latest_state_dict_step()CheckpointMonitor.register_thread_count()CheckpointMonitor.monitor_step()CheckpointMonitor.notify_started()CheckpointMonitor.notify_finished()CheckpointMonitor.get_actor()
VerlPPOTrainerWrapperVerlPPOTrainerWrapper.__init__()VerlPPOTrainerWrapper.init_workers()VerlPPOTrainerWrapper.train_step_numVerlPPOTrainerWrapper.prepare()VerlPPOTrainerWrapper.save_state_dict()VerlPPOTrainerWrapper.upload_state_dict()VerlPPOTrainerWrapper.train_step()VerlPPOTrainerWrapper.save_checkpoint()VerlPPOTrainerWrapper.sync_weight()VerlPPOTrainerWrapper.post_process_batch()
Module contents#
- class trinity.trainer.Trainer(config: Config)[source]#
Bases:
objectConsume the experience and train the model.
- async train_step(exps: Experiences) Dict[source]#
Train one step.
- Returns:
Whether to continue training. Dict: Metrics of the training step.
- Return type:
bool
- property train_step_num: int#
Get the current training step number.
- class trinity.trainer.TrainEngineWrapper[source]#
Bases:
ABCA wrapper class to wrap various training engines.
- abstract property train_step_num: int#
Get the current training step number.
- abstract train_step(batch: Experiences) Dict[source]#
Training one step.
- Parameters:
batch (Experiences) – A batch of experiences to train.
- Returns:
Metrics of the training step.
- Return type:
Dict
- trinity.trainer.get_trainer_wrapper(config: Config) TrainEngineWrapper[source]#
Get a trainer wrapper.