Megatron-LM的工具
类 accelerate.utils.MegatronLMPlugin
< 源 >( tp_degree: int = None pp_degree: int = None num_micro_batches: int = None gradient_clipping: float = None sequence_parallelism: bool = None recompute_activations: bool = None use_distributed_optimizer: bool = None pipeline_model_parallel_split_rank: int = None num_layers_per_virtual_pipeline_stage: int = None is_train_batch_min: str = True train_iters: int = None train_samples: int = None weight_decay_incr_style: str = 'constant' start_weight_decay: float = None end_weight_decay: float = None lr_decay_style: str = 'linear' lr_decay_iters: int = None lr_decay_samples: int = None lr_warmup_iters: int = None lr_warmup_samples: int = None lr_warmup_fraction: float = None min_lr: float = 0 consumed_samples: List = None no_wd_decay_cond: Optional = None scale_lr_cond: Optional = None lr_mult: float = 1.0 megatron_dataset_flag: bool = False seq_length: int = None encoder_seq_length: int = None decoder_seq_length: int = None tensorboard_dir: str = None set_all_logging_options: bool = False eval_iters: int = 100 eval_interval: int = 1000 return_logits: bool = False custom_train_step_class: Optional = None custom_train_step_kwargs: Optional = None custom_model_provider_function: Optional = None custom_prepare_model_function: Optional = None custom_megatron_datasets_provider_function: Optional = None custom_get_batch_function: Optional = None custom_loss_function: Optional = None other_megatron_args: Optional = None )
用于Megatron-LM的插件,以实现张量、管道、序列和数据并行化。此外还可以实现选择性激活重新计算和优化的融合内核。
虚拟调度器展示模型参数或参数组,这主要是为了在 deepspeed 配置文件中指定调度器配置时遵循常规训练循环。
虚拟数据加载器提供模型参数或参数组,这主要用于遵循常规训练
用于批处理、前向传递和损失处理的抽象类。
类别 accelerate.utils.GPTTrainStep
< source >( accelerator args )
GPT 训练步骤类。
类 accelerate.utils.BertTrainStep
< 源代码 >( accelerator args )
Bert 训练步骤类。
类 accelerate.utils.T5TrainStep
< source >( accelerator args )
T5 训练步骤类。