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

[torch.compile] PostGradPassManager, Inductor code caching fix, fix_functionalization pass refactor + tests #10273

Merged
merged 19 commits into from
Nov 21, 2024

Conversation

ProExpertProg
Copy link
Contributor

@ProExpertProg ProExpertProg commented Nov 12, 2024

This PR extracts the post_grad passes into PostGradPassManager. By overriding pickling of the class, we avoid failing to pickle custom passes, which is used in the code cache.

It also extracts pass config into PassConfig and adds an option to disable the reshapes pass. It adds utilities for registering custom inductor passes, and extracts fix_functionalization into a proper pass.

Copy link

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can do one of these:

  • Add ready label to the PR
  • Enable auto-merge.

🚀

@ProExpertProg ProExpertProg force-pushed the luka/fix-inductor-pickle branch 3 times, most recently from 48bd06a to 9f9aba5 Compare November 12, 2024 23:27
@ProExpertProg ProExpertProg changed the title Extract post grad passes into manager Extract post grad passes into manager & extract fix functionalization to pass Nov 12, 2024
@ProExpertProg ProExpertProg force-pushed the luka/fix-inductor-pickle branch from 9f9aba5 to b051eb2 Compare November 13, 2024 21:52
@ProExpertProg ProExpertProg changed the title Extract post grad passes into manager & extract fix functionalization to pass [torch.compile] Extract post grad passes into manager & extract fix functionalization to pass Nov 13, 2024
@ProExpertProg ProExpertProg changed the title [torch.compile] Extract post grad passes into manager & extract fix functionalization to pass [torch.compile] PostGradPassManager, Inductor code caching fix, fix_functionalization pass refactor + tests Nov 13, 2024
@ProExpertProg ProExpertProg force-pushed the luka/fix-inductor-pickle branch from af751fc to 234ea39 Compare November 14, 2024 16:01
@mgoin mgoin added the ready ONLY add when PR is ready to merge/full CI is needed label Nov 14, 2024
@ProExpertProg ProExpertProg force-pushed the luka/fix-inductor-pickle branch from bbb6300 to 5af5547 Compare November 14, 2024 19:15
vllm/compilation/config.py Outdated Show resolved Hide resolved
Copy link

mergify bot commented Nov 17, 2024

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @ProExpertProg.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Nov 17, 2024
@youkaichao
Copy link
Member

edge cases still:

image

@ProExpertProg
Copy link
Contributor Author

Huh, it worked for me, maybe I didn't check the final changes

@ProExpertProg ProExpertProg force-pushed the luka/fix-inductor-pickle branch 2 times, most recently from eecc7d3 to d0c0c45 Compare November 20, 2024 22:51
ProExpertProg and others added 19 commits November 20, 2024 17:52
Add config option to disable reshape pass.

Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
- rename functionalization.py
- add detailed comment about caching

Also:
- rename TODOs
- format

Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
… move VllmInductorPass into own file

Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
@ProExpertProg ProExpertProg force-pushed the luka/fix-inductor-pickle branch from d0c0c45 to ee289bc Compare November 20, 2024 22:52
@youkaichao youkaichao merged commit 8b0fe06 into vllm-project:main Nov 21, 2024
49 checks passed
@youkaichao youkaichao deleted the luka/fix-inductor-pickle branch November 21, 2024 05:45
@youkaichao
Copy link
Member

@ProExpertProg great job!

tlrmchlsmth pushed a commit to neuralmagic/vllm that referenced this pull request Nov 23, 2024
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: Tyler Michael Smith <[email protected]>
mfournioux pushed a commit to mfournioux/vllm that referenced this pull request Nov 28, 2024
Signed-off-by: luka <[email protected]>
Signed-off-by: Luka Govedic <[email protected]>
Signed-off-by: Maxime Fournioux <[email protected]>
sleepwalker2017 pushed a commit to sleepwalker2017/vllm that referenced this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants