-
Notifications
You must be signed in to change notification settings - Fork 619
Improve torch.compile log message in compile_model #2777
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
Improve torch.compile log message in compile_model #2777
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/2777
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 1c2a0da with merge base 5ecae86 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Hi @Vasist10! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
Hi @Vasist10. Thank you for this contribution. I think this looks good, however, the test may be overkill here. If you could please remove the test I'm happy to merge this. We can also remove the extra log here, and in a similar place across a few of our other recipes. It seems like you mentioned this in your PR but didn't include the changes - could you take a pass at removing the additional logs in the recipes? |
Hi @SalmanMohammadi ,
Thank you |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2777 +/- ##
==========================================
- Coverage 62.93% 60.08% -2.85%
==========================================
Files 437 435 -2
Lines 26710 26742 +32
==========================================
- Hits 16809 16067 -742
- Misses 9901 10675 +774 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
@@ -8,7 +8,7 @@ | |||
import time | |||
|
|||
from functools import partial | |||
from typing import Any, Optional, Union | |||
from typing import Any, Optional, Union, Tuple |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need to update your pre-commit hooks as we have moved to PEP 585.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should i change it the previous version which was like this :
def _loss_step( self, batch: dict[str, torch.Tensor] ) -> (torch.Tensor, torch.Tensor):
or should i change it to this ? : def _loss_step( self, batch: dict[str, torch.Tensor] ) -> tuple[torch.Tensor, torch.Tensor]:
i just want to clarify it
Hey @SalmanMohammadi , Apologies for the failing check in Would you prefer I revert this change and switch it back to the older version? Let me know, and I’ll update it right away. Thanks again for your guidance! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Vasist10 No worries at all! This looks good to me pending green CI.
@Vasist10 Could you run the pre-commit hooks locally and ensure they pass? |
Context
What is the purpose of this PR? Is it to
Please link to any issues this PR addresses.
Closes #2717
Changelog
What are the changes made in this PR?
-Updated the log message in torchtune/utils/compile_model.py to read:
"Compiling model layers with torch.compile. Expect a relatively slower first step."
-Removed similar/sprinkled references elsewhere in the codebase to centralize this message.
Test plan
Please make sure to do each of the following if applicable to your PR. If you're unsure about any one of these just ask and we will happily help. We also have a contributing page for some guidance on contributing.
pre-commit install
)pytest tests
pytest tests -m integration_test
UX
If your function changed a public API, please add a dummy example of what the user experience will look like when calling it.
Here is a docstring example
and a tutorial example