-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[7/N] torch.compile, reduce compilation time #10460
Conversation
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
👋 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:
🚀 |
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
splitting_ops: List[str] = Field(default_factory=lambda: [ | ||
"vllm.unified_flash_attention", | ||
"vllm.unified_flash_infer", | ||
"vllm.unified_v1_flash_attention", | ||
]) |
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.
What are these default values for?
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.
they are the default splitting ops we know inductor cannot do any optimization, and they are good candidates to split the 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.
LGTM thank you
test errors are unrelated. merging. |
Signed-off-by: youkaichao <[email protected]> Signed-off-by: Tyler Michael Smith <[email protected]>
Signed-off-by: youkaichao <[email protected]> Signed-off-by: Clay <[email protected]>
Signed-off-by: youkaichao <[email protected]> Signed-off-by: Maxime Fournioux <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Normal run:
Run with inductor compiling the full graph:
Run with inductor compiling the piecewise graph:
Results show we can reduce both the inductor compilation time and the cudagraph capture time. Here I only compile one graph for symbolic shape. I don't know why it helps cudagraph capture time, it's just running the model for 2 warmup runs. Might be related to triton?
Note: need to get #10273 in so that inductor can cache the compilation. currently i just disable post grad custom pass to test it.
I think the compilation result should be the same, but in the full graph level, inductor needs to run the full passes at the full graph level, and can generate every triton kernels for every layer.