FP8 backward: chunked expert dequant, skip autograd.Function at inference (#50117)
* Pass the input gradient through FP8 layers, so adapters can train on top of them
* Same backward for FP8GroupedLinear, with a contiguous gradient for the grouped matmul
* Dequantize in place in the FP8 backward
* Fit the EP sentinel comment in five lines
* FP8 backward: chunk expert dequant, broadcast scales, skip autograd.Function when no grad is needed
* Only chunk the FP8 grouped backward when the expert stack exceeds 1 GiB
* Free each dequantized expert chunk before the next one
* Update measured peak in comment
---------
Co-authored-by: Quentin Gallouédec <quentin.gallouedec@huggingface.co>
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
Co-authored-by: Cyril Vallez <cyril.vallez@huggingface.co>