core.extensions.transformer_engine_spec_provider#
Module Contents#
Classes#
Class adapter for TENorm with residual fusion enabled. |
|
A protocol for providing the submodules used in Spec building. |
API#
- class core.extensions.transformer_engine_spec_provider._TENormWithResidual#
Class adapter for TENorm with residual fusion enabled.
- __new__(*args, **kwargs)#
- class core.extensions.transformer_engine_spec_provider.TESpecProvider(
- use_te_op_fuser: bool = False,
- cross_entropy_loss_fusion: bool = False,
- cross_entropy_fusion_impl: str = 'native',
- cuda_graph_impl: Optional[str] = None,
Bases:
megatron.core.models.backends.BackendSpecProviderA protocol for providing the submodules used in Spec building.
Initialization
- REQUIRES#
‘transformer_engine’
- row_parallel_linear() type[megatron.core.extensions.transformer_engine.TERowParallelLinear]#
Which row parallel linear module TE backend uses
- fuse_layernorm_and_linear() bool#
TE backend chooses a single module for layernorm and linear
- column_parallel_layer_norm_linear() Optional[type]#
Which module for sequential layernorm and linear
- layer_norm(
- rms_norm: bool = False,
- for_qk: bool = False,
- has_residual: bool = False,
Which module to use for layer norm
- grouped_mlp_modules(
- moe_use_grouped_gemm: bool,
Which module and submodules to use for grouped mlp
- activation_func() megatron.core.transformer.mlp.TEActivationFunctionBuilder | None#
Which module to use for activation function
- mlp_module(grouped: bool = False) type#
The dense MLP block, fused into TE operations when the fuser is on.
- vocab_parallel_cross_entropy() megatron.core.models.backends.CrossEntropyTarget#
Which vocab-parallel cross entropy to use.
Which one depends on the config rather than on this being the TE provider, so the same settings give the same kernel whichever backend supplies the rest of the model.