espnet2.train.deepspeed_trainer.DeepSpeedTrainerOptions
espnet2.train.deepspeed_trainer.DeepSpeedTrainerOptions
class espnet2.train.deepspeed_trainer.DeepSpeedTrainerOptions(resume: bool, seed: int, train_dtype: str | dtype, log_interval: int | None, output_dir: Path | str, max_epoch: int, deepspeed_config: Path | str)
Bases: object
DeepSpeed Trainer Options for configuring training with DeepSpeed.
This class holds the options required to set up the DeepSpeed trainer, including parameters for resuming training, setting seeds, data types, logging intervals, output directories, and maximum epochs.
resume
Whether to resume training from a checkpoint.
- Type: bool
seed
Seed for random number generation.
- Type: int
train_dtype
Data type for training (e.g., ‘fp16’).
- Type: Union[str, torch.dtype]
log_interval
Interval for logging training progress.
- Type: Optional[int]
output_dir
Directory for saving outputs and checkpoints.
- Type: Union[Path, str]
max_epoch
Maximum number of epochs for training.
- Type: int
deepspeed_config
Path to the DeepSpeed configuration file.
- Type: Union[Path, str]
Examples
>>> options = DeepSpeedTrainerOptions(
... resume=True,
... seed=42,
... train_dtype='fp16',
... log_interval=100,
... output_dir='./output',
... max_epoch=10,
... deepspeed_config='./deepspeed_config.json'
... )
>>> print(options)
DeepSpeedTrainerOptions(resume=True, seed=42, train_dtype='fp16',
... log_interval=100, output_dir=PosixPath('output'),
... max_epoch=10, deepspeed_config=PosixPath('deepspeed_config.json'))
deepspeed_config
log_interval
max_epoch
output_dir
resume
seed
train_dtype