nemo_automodel.shared
nemo_automodel.shared
Submodules
nemo_automodel.shared.embedding_paddingnemo_automodel.shared.import_utilsnemo_automodel.shared.model_utilsnemo_automodel.shared.parameter_namesnemo_automodel.shared.retrieval_idsnemo_automodel.shared.te_patchesnemo_automodel.shared.tied_weightsnemo_automodel.shared.tokenizer_serializationnemo_automodel.shared.torch_patchesnemo_automodel.shared.tp_linearnemo_automodel.shared.transformers_patchesnemo_automodel.shared.utils
Package Contents
Functions
API
Translate a str val of a dtype into the corresponding torch.dtype Args: val (str): the dotted path of the dtype (e.g., “torch.bfloat16”).
Returns:
torch.dtype: the actual dtype (e.g., torch.bfloat16)
Replace apex’s FusedRMSNorm with a native T5LayerNorm in the T5 module.
Apex’s FusedRMSNorm doesn’t support bfloat16, but the native T5LayerNorm handles it correctly by upcasting to fp32 internally for numerical stability. This must be called before loading any T5 models.
This function is idempotent and safe to call multiple times.