[t5/t0/mt5 models] faster/leaner custom layer norm (#14656)

* [t5] faster/leaner custom layer norm

* wip

* apex.normalization.FusedRMSNorm

* cleanup

* cleanup

* add doc

* add catch all

* Trigger CI

* expand
This commit is contained in:
Stas Bekman
2022-02-15 16:49:57 -08:00
committed by GitHub
parent e3d1a8dabc
commit bee361c6f1
2 changed files with 26 additions and 2 deletions

View File

@@ -263,6 +263,11 @@ print(tokenizer.batch_decode(output_sequences, skip_special_tokens=True))
<a id='scripts'></a>
## Performance
If you'd like a faster training and inference performance, install [apex](https://github.com/NVIDIA/apex#quick-start) and then the model will automatically use `apex.normalization.FusedRMSNorm` instead of `T5LayerNorm`. The former uses an optimized fused kernel which is several times faster than the latter.
## Example scripts
T5 is supported by several example scripts, both for pre-training and fine-tuning.