Skip to content

Migrate torchdynamo to torch.compile#20634

Merged
sgugger merged 4 commits into
mainfrom
torch_compile
Dec 8, 2022
Merged

Migrate torchdynamo to torch.compile#20634
sgugger merged 4 commits into
mainfrom
torch_compile

Conversation

@sgugger

@sgugger sgugger commented Dec 6, 2022

Copy link
Copy Markdown
Collaborator

What does this PR do?

This PR migrates the current integration with PyTorch 2.0 to use the entry point they introduced: torch.compile. As a consequence, the torchdynamo argument is deprecated to the profit of torch_compile_backend and torch_compile_mode. Setting either will trigger a model compilation.

@sgugger sgugger requested a review from LysandreJik December 6, 2022 21:13
@HuggingFaceDocBuilderDev

HuggingFaceDocBuilderDev commented Dec 6, 2022

Copy link
Copy Markdown

The documentation is not available anymore as the PR was closed or merged.

@LysandreJik LysandreJik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Very nice! Thanks @sgugger

@sgugger sgugger merged commit 9cc65f8 into main Dec 8, 2022
@sgugger sgugger deleted the torch_compile branch December 8, 2022 16:18
mpierrau pushed a commit to mpierrau/transformers that referenced this pull request Dec 15, 2022
* Migrate torchdynamo to torch.compile

* Add docstring and generic option

* Properly use the function...

* Reorg args
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