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

[PyTorch] Improve logging/messaging in attention #1074

Merged
merged 8 commits into from
Aug 6, 2024

Conversation

cyanguwa
Copy link
Collaborator

@cyanguwa cyanguwa commented Aug 2, 2024

Description

This PR

  • separates TE logging from upstream application's logging, if we are both using the logging package
  • improves the messaging in check_set_window_size to avoid warning when window_size is within the correct range
  • removes logging in fwd/bwd to reduce CPU overhead because they're called every iteration

Fixes #1064 and #1065.

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

Changes

Please list the changes introduced in this PR:

  • separates TE logging from upstream application's logging, if we are both using the logging package
  • improves the messaging in check_set_window_size to avoid warning when window_size is within the correct range
  • removes logging in fwd/bwd to reduce CPU overhead because they're called every iteration

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

cyanguwa and others added 7 commits August 1, 2024 00:43
Signed-off-by: Charlene Yang <8636796+cyanguwa@users.noreply.github.com>
Signed-off-by: Charlene Yang <8636796+cyanguwa@users.noreply.github.com>
Signed-off-by: Charlene Yang <8636796+cyanguwa@users.noreply.github.com>
Signed-off-by: Charlene Yang <8636796+cyanguwa@users.noreply.github.com>
Signed-off-by: Charlene Yang <8636796+cyanguwa@users.noreply.github.com>
@cyanguwa
Copy link
Collaborator Author

cyanguwa commented Aug 2, 2024

/te-ci pytorch

@Marks101
Copy link
Contributor

Marks101 commented Aug 5, 2024

Hi @cyanguwa, I just tested these changes and the logging is good now. Really great to have the possibility to enable logging for the attention backend selection now. This helps a lot!

Thanks for processing this so super quick! :D

@cyanguwa
Copy link
Collaborator Author

cyanguwa commented Aug 5, 2024

@Marks101 No worries! Would you be able to test the changes related to check_set_window_size as well? Thanks.

@cyanguwa cyanguwa requested a review from ksivaman August 5, 2024 19:02
Signed-off-by: Charlene Yang <8636796+cyanguwa@users.noreply.github.com>
@Marks101
Copy link
Contributor

Marks101 commented Aug 5, 2024

I already tested the warnings as well. All good from our side 👍

@cyanguwa
Copy link
Collaborator Author

cyanguwa commented Aug 5, 2024

/te-ci pytorch

Copy link
Member

@ksivaman ksivaman left a comment

Choose a reason for hiding this comment

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

LGTM

@cyanguwa cyanguwa merged commit 121ff62 into NVIDIA:main Aug 6, 2024
25 of 26 checks passed
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.

[Pytorch] Warnings in check_set_window_size() trigger always
3 participants