-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[torch.compile] hide slicing under custom op for inductor #8384
New issue
Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “No 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? No Sign in to your account
Conversation
👋 Hi! Thank you for contributing to the vLLM project. 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:
🚀 |
cc @laithsakka |
after this pr, the major bug of inductor ( it tries to copy kvcache) should be fixed. however, there are still some inefficiencies w.r.t. inductor. it cannot deal with inplace custom op well. |
Thanks for finding and fixing this! |
This is fixed on pytorch 2.5 by setting TORCHDYNAMO_AUTO_FUNCTIONALIZED_V2=1 |
can you elaborate more on "there are still some inefficiencies w.r.t. inductor. it cannot deal with inplace custom op well." |
you can take a look at the log when you run with inductor:
when I turn on inductor, the blocks become smaller, which means inductor takes more memory and we have less memory for the kv cache. |
I see i will create an issue to revisit this, for the models i ran inductor on , it was slightly better than not using torch.compile. I will sync with you on that |
…ct#8384) Signed-off-by: Alvant <alvasian@yandex.ru>
…ct#8384) Signed-off-by: LeiWang1999 <leiwang1999@outlook.com>
see pytorch/pytorch#131192
when inductor sees a view being mutated, it will copy the tensor.
hiding the slicing operation under custom op solves the issue for inductor.