Skip to content

change softmax_lse correction of CP to FP32 - #1546

Merged
xrennvidia merged 48 commits into
NVIDIA:mainfrom
xrennvidia:xren/cp_fp32_lse
Apr 29, 2025
Merged

xrennvidia merged 48 commits into
NVIDIA:mainfrom
xrennvidia:xren/cp_fp32_lse

Conversation

@xrennvidia

@xrennvidia xrennvidia commented Mar 7, 2025 •

Copy link
Copy Markdown
Collaborator

Description

  • softmax_lse correction is in FP64 now, we can lower it to FP32.
  • use log1p to be consistent with PR1401.

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

xrennvidia and others added 30 commits February 27, 2025 23:30
…nsformerEngine into xren/cp_fix_recompilation
Signed-off-by: Xiaowei Ren <[email protected]>
Signed-off-by: Xiaowei Ren <[email protected]>
…nsformerEngine into xren/cp_fix_recompilation
Signed-off-by: Xiaowei Ren <[email protected]>
Signed-off-by: Xiaowei Ren <[email protected]>
…nsformerEngine into xren/cp_fix_recompilation
Signed-off-by: Xiaowei Ren <[email protected]>
Signed-off-by: Xiaowei Ren <[email protected]>
Signed-off-by: Xiaowei Ren <[email protected]>
Signed-off-by: Xiaowei Ren <[email protected]>
Signed-off-by: Xiaowei Ren <[email protected]>
@xrennvidia

Copy link
Copy Markdown
Collaborator Author

/te-ci pytorch L1

@xrennvidia

Copy link
Copy Markdown
Collaborator Author

/te-ci pytorch L1

@xrennvidia

Copy link
Copy Markdown
Collaborator Author

/te-ci pytorch L1

@mgoldfarb-nvidia mgoldfarb-nvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cyanguwa

cyanguwa commented Apr 29, 2025 •

Copy link
Copy Markdown
Collaborator

CI failures are not related to this PR.

log1p(x) provides more accuracy when x is close to 0.

Downcasting softmax_lse from double to float because cuDNN softmax_lse is in FP32 and combination of multiple copies of them over CP ranks should still stay in the float limits (see here).

@xrennvidia
xrennvidia merged commit 21ec6e0 into NVIDIA:main Apr 29, 2025
@xrennvidia
xrennvidia deleted the xren/cp_fp32_lse branch April 29, 2025 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants