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

Set experimental dynamo config for compile tests #1698

Conversation

BenjaminBossan
Copy link
Member

Right now, a lot of tests fail when applying torch.compile to PEFT models. One of the main reasons is that attribute checks (e.g. if self.foo) on nn.Modules are not correctly considered.

This PR sets an experimental flag that should fix this. However, this is not public PyTorch API (yet) and incurs a performance penalty. Still, it's interesting to see how this affects our tests.

More context:
pytorch/pytorch#124717 (comment)

Right now, a lot of tests fail when applying torch.compile to PEFT
models. One of the main reasons is that attribute checks (self.foo) on
nn.Modules are not correctly considered.

This PR sets an experimental flag that should fix this. However, this is
not public PyTorch API (yet) and incurs a performance penalty. Still,
it's interesting to see how this affects our tests.

More context:
pytorch/pytorch#124717 (comment)
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Nice, thanks ! Maybe we should add this trick somewhere in the docs (although might be not a good practice to publicise experimental features, so I would say good as is)

@BenjaminBossan
Copy link
Member Author

Yeah, let's first see how this affects the number of failing tests. Also, I have no idea how big the performance hit is, if it's slower than without compile there is little incentive to use it.

@BenjaminBossan BenjaminBossan merged commit 3edcebf into huggingface:main Apr 30, 2024
14 checks passed
@BenjaminBossan BenjaminBossan deleted the torch-compile-experimental-dynamo-config branch April 30, 2024 12:32
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