NVIDIA / TransformerEngine

A library for accelerating Transformer models on NVIDIA GPUs, including using 8-bit floating point (FP8) precision on Hopper and Ada GPUs, to provide better performance with lower memory utilization in both training and inference.
https://docs.nvidia.com/deeplearning/transformer-engine/user-guide/index.html
Apache License 2.0
1.6k stars 255 forks source link

[WIP] [PyTorch] Support dtype casting in fused adam #977

Open Wong4j opened 1 day ago

Wong4j commented 1 day ago

Description

FusedAdam updates the params in-place currently. This PR adds dtype casting in FusedAdam kernel, in addition to updating the master params in-place, but also can update extra model params. The extra params can be of bf16, fp16, fp8 type.

Fixes # (issue)

Type of change

Changes

Please list the changes introduced in this PR:

Checklist: