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.monkey_patch module
- trinity.trainer.verl.utils module
- trinity.trainer.verl.verl_config module
- trinity.trainer.verl.verl_trainer module
- Module contents
- Submodules
Submodules#
Module contents#
- class trinity.trainer.Trainer(config: Config)[source]#
Bases:
objectConsume the experience and train the model.
- async train_step(exps: List[Experience]) 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.
- abstractmethod async save_checkpoint(block_until_saved: bool = False, save_as_hf: bool = False) None[source]#
Save the checkpoint.
- abstractmethod async save_state_dict() None[source]#
Only save the model state dict for Synchronizer.
- abstractmethod async train_step(batch_exps: List[Experience]) Dict[source]#
Training one step.
- Parameters:
batch_exps (List[Experience]) – A batch of experiences to train.
- Returns:
Metrics of the training step.
- Return type:
Dict
- abstract property train_step_num: int#
Get the current training step number.
- trinity.trainer.get_trainer_wrapper(config: Config) TrainEngineWrapper[source]#
Get a trainer wrapper.