trinity.trainer package#
Subpackages#
- trinity.trainer.tinker package
- trinity.trainer.verl package
- Submodules
- trinity.trainer.verl.dp_actor module
- trinity.trainer.verl.fsdp_checkpoint_manager module
- trinity.trainer.verl.fsdp_workers module
- trinity.trainer.verl.megatron_actor module
- trinity.trainer.verl.megatron_checkpoint_manager module
- trinity.trainer.verl.megatron_workers module
- trinity.trainer.verl.utils module
- Module contents
- Submodules
Submodules#
- trinity.trainer.tinker_trainer module
- 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)[源代码]#
基类:
objectConsume the experience and train the model.
- async train_step(exps: List[Experience]) Dict[源代码]#
Train one step.
- 返回:
Whether to continue training. Dict: Metrics of the training step.
- 返回类型:
bool
- property train_step_num: int#
Get the current training step number.
- class trinity.trainer.TrainEngineWrapper[源代码]#
基类:
ABCA wrapper class to wrap various training engines.
- abstractmethod save_checkpoint(block_until_saved: bool = False, save_as_hf: bool = False) None[源代码]#
Save the checkpoint.
- abstractmethod async train_step(batch_exps: List[Experience]) Dict[源代码]#
Training one step.
- 参数:
batch_exps (List[Experience]) -- A batch of experiences to train.
- 返回:
Metrics of the training step.
- 返回类型:
Dict
- abstract property train_step_num: int#
Get the current training step number.
- trinity.trainer.get_trainer_wrapper(config: Config) TrainEngineWrapper[源代码]#
Get a trainer wrapper.