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

[Paddle] Fix forward and backward logic of te.Linear(parallel_mode='column') to adapt DiT of PaddleMIX #963

Open yumin066 opened 1 week ago

yumin066 commented 1 week ago

Description

In the DiT of PaddleMIX, the Linear(parallel_mode='column') is not used in pairs with Linear(parallel_mode='row'). In order to use transformer engine backend in DiT, the output of te.Linear(parallel_mode='column') should to be all-gathered when forward and reduce-scattered when backward.

Fixes # (issue)

Type of change

Changes

Please list the changes introduced in this PR:

Checklist:

yumin066 commented 1 week ago

/te-ci paddle

zlsh80826 commented 1 week ago

/te-ci paddle

jeng1220 commented 6 days ago

LGTM