Unverified Commit 257345a5 authored by Xiaowei Ren's avatar Xiaowei Ren Committed by GitHub
Browse files

[PyTorch] Fix CP implementation with FP8 (#1483)



* commit some debug code
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* add more debug info
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* debug code commit and typo fix
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* a typo fix
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* remove debug info
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* do not return lse
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* add amax_per_step for quantizers of CP
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* fix FP8 + CP
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci



* bug fix
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* bug fix
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* dtype fix
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

* bug fix
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>

---------
Signed-off-by: default avatarXiaowei Ren <xren@nvidia.com>
Co-authored-by: default avatarpre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: default avatarXiaowei Ren <xren@login-preos01.a51.clusters.nvidia.com>
parent b612cdeb
This diff is collapsed.
...@@ -56,7 +56,7 @@ def get_fp8_torch_dtype(fp8_recipe: Recipe, fprop_tensor: bool = True) -> torch. ...@@ -56,7 +56,7 @@ def get_fp8_torch_dtype(fp8_recipe: Recipe, fprop_tensor: bool = True) -> torch.
fp8_recipe.fp8_format == Format.HYBRID and fprop_tensor fp8_recipe.fp8_format == Format.HYBRID and fprop_tensor
): ):
return torch.float8_e4m3fn return torch.float8_e4m3fn
return torch.float8_e5m2fn return torch.float8_e5m2
def get_fp8_te_dtype(fp8_recipe: Recipe, fprop_tensor: bool = True) -> tex.DType: def get_fp8_te_dtype(fp8_recipe: Recipe, fprop_tensor: bool = True) -> tex.DType:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment