-
Notifications
You must be signed in to change notification settings - Fork 1.8k
🧗 Add Ascend NPU support for vLLM server #3286
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
Conversation
@@ -114,7 +124,7 @@ def update_named_param(self, name: str, dtype: torch.dtype, shape: Sequence[int] | |||
weight = torch.empty(shape, dtype=dtype, device=self.device) | |||
|
|||
# Use NCCL to broadcast the updated weights from the client (src) to all workers. | |||
self.pynccl_comm.broadcast(weight, src=self.client_rank, stream=torch.cuda.current_stream()) |
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.
We don't need to explicitly pass the stream to pynccl_comm, as pynccl_comm will get the current stream internally
https://github.com/vllm-project/vllm/blob/68bb122eb458a42169dd9d1772a7b32b84b2be95/vllm/distributed/device_communicators/pynccl.py#L207
@@ -212,7 +215,7 @@ def init_communicator(self): | |||
|
|||
# Set up the communication group for weight broadcasting | |||
pg = StatelessProcessGroup.create(host=self.host, port=self.group_port, rank=self.rank, world_size=world_size) | |||
self.pynccl_comm = PyNcclCommunicator(pg, device="cuda:0") |
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.
Here we remove the hardcoded "cuda" to support third-party accelerators
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! I'm just running a few tests to ensure there is no regression with CUDA and we are good to merge
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
For the record: I can't test for Ascend NPU, but this PR introduces no regression for cuda |
Co-authored-by: Quentin Gallouédec <[email protected]>
What does this PR do?
closes #3211
Note: This PR needs to be used with the main branch of vllm and vllm-ascend to work properly
Before submitting
Pull Request section?
to it if that's the case.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.
cc @qgallouedec