-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
[TPU] optimize the all-reduce performance #15903
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
[TPU] optimize the all-reduce performance #15903
Conversation
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run 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 either: Add 🚀 |
I have two questions:
|
@yaochengji thanks for this important PR!
|
Thanks @alexm-redhat for your suggestion. Hi @youkaichao , do you have any suggestion on the dynamo custom op? |
My local experiments show that the throughput can improve from ~4.2 reqs/s to ~4.9reqs/s for Llama 70B on 8 v6e. |
|
||
if USE_RAY: | ||
from vllm.executor import ray_utils | ||
|
||
|
||
@torch.library.custom_op("tpu::all_reduce", mutates_args=()) |
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.
is it possible to use custom op call in vllm directly? e.g. extending this line
vllm/vllm/distributed/parallel_state.py
Line 222 in 44f9905
self.use_custom_op_call = current_platform.is_cuda_alike() |
i didn't do it initially, because i remember tpu has some custom dynamo-related logic.
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.
Thanks for you suggestion!
I removed the custom op in tpu_communicator.py
and made use of the custom op for TPU in parallel_state.py
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!
Signed-off-by: Chengji Yao <chengjiyao@google.com>
Signed-off-by: Chengji Yao <chengjiyao@google.com>
Head branch was pushed to by a user without write access
5edfa49
to
91628ee
Compare
Magical incantations! |
NOTE: V1 test failing fixed by #15969 |
Signed-off-by: Chengji Yao <chengjiyao@google.com> Signed-off-by: xinyuxiao <xinyuxiao2024@gmail.com>
Signed-off-by: Chengji Yao <chengjiyao@google.com> Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
Signed-off-by: Chengji Yao <chengjiyao@google.com>
Before the PR, the all-reduce performance is not optimal due to two reasons: