Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take token count quantization of fused attention into consideration for CP results correction #1396

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

xrennvidia
Copy link
Collaborator

@xrennvidia xrennvidia commented Jan 9, 2025

Description

Fused attention has token count quantization. This can make T of sfotmax_lse mismatch with Q and O. For example, both T=1000 and T=500 will create T=1024 in softmax_lse, so we cannot assume half of T will have 2x smaller shape of softmax_lse. Fix CP results correction by taking this quantization into consideration.

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 refractor

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 3 commits January 8, 2025 18:35
@xrennvidia xrennvidia changed the title Take sequence quantization of fused attention into consideration for CP results correction Take token count quantization of fused attention into consideration for CP results correction Jan 9, 2025
@xrennvidia
Copy link
Collaborator Author

/te-ci pytorch L1

@xrennvidia xrennvidia requested a review from cyanguwa January 9, 2025 19:16
Copy link
Collaborator

@cyanguwa cyanguwa left a comment

Choose a reason for hiding this comment

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

LGTM

@xrennvidia xrennvidia merged commit 7b861e7 into NVIDIA:main Jan 10, 2025
29 checks passed
@xrennvidia xrennvidia deleted the xren/cp_lse branch January 10, 2025 19:37
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.

2 participants