-
Notifications
You must be signed in to change notification settings - Fork 127
Draft: Feat: Enable torch compile #496
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Jimmy Zhang <[email protected]>
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.
Could you add this key to all the configs/recipes
?
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.
Is this possible to unit test?
@jiemingz is the only thing blocking this PR the seq-packing change since we need static shapes for torch.compile? |
Dependent on #300 |
Dtensor sequence packing has been merged. @ahmadki to support max-padding packed sequences in DTensor to enable torch.compile (fixed seqlen). |
@@ -195,6 +196,9 @@ def __init__( | |||
custom_parallel_plan=self.cfg["dtensor_cfg"]["custom_parallel_plan"], | |||
) | |||
|
|||
if self.torch_compile: | |||
self.model = torch.compile(model) |
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.
Could you try model.compile()
instead? That should fix the _orig_mod
issue. This is also the recommended way of compiling a model now. We'll work on throwing warnings and publicizing to raise awareness on this.
What does this PR do ?
Add a one line overview of what this PR aims to accomplish.
Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use this
Before your PR is "Ready for review"
Pre checks:
Additional Information