Skip to content

Conversation

@shen-shanshan
Copy link
Contributor

@shen-shanshan shen-shanshan commented Mar 7, 2025

What does this PR do?

Add a __getitem__ method for Platform class.

When using cuda, current_platform['xxx'] is equal to torch.cuda.xxx, whereas when using npu, current_platform['xxx'] is equal to torch.npu.xxx. Thus, we do not need to abstract Stream or Event anymore.

@github-actions
Copy link

github-actions bot commented Mar 7, 2025

👋 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 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 either: Add ready label to the PR or enable auto-merge.

🚀

@shen-shanshan shen-shanshan changed the title [Misc] format [Misc] Add get_stream_cls() method for Platform class Mar 7, 2025
@wangxiyuan wangxiyuan mentioned this pull request Mar 7, 2025
1 task
@Selkh
Copy link

Selkh commented Mar 15, 2025

There 're also some "torch.cuda.Stream"s in vllm/distributed/parallel_state.py:graph_capture

@shen-shanshan shen-shanshan changed the title [Misc] Add get_stream_cls() method for Platform class [Misc] Refactor platform to get device specific stream and event Mar 19, 2025
Copy link
Member

@youkaichao youkaichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't create abstractions until many platforms need this.

@mergify
Copy link

mergify bot commented Apr 14, 2025

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

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 Apr 14, 2025
Signed-off-by: shen-shanshan <467638484@qq.com>
@shen-shanshan
Copy link
Contributor Author

@youkaichao I have updated a new version for this refactor. By directly adding __getattr__() method to Platform, all kinds of hardware can get their Stream, Event or other attribute without modification to vllm. I think this can make vllm more extensible. 😄

Copy link
Member

@youkaichao youkaichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, this looks better.

@youkaichao youkaichao merged commit 7272bfa into vllm-project:main Apr 21, 2025
21 checks passed
yangw-dev pushed a commit to yangw-dev/vllm that referenced this pull request Apr 21, 2025
…m-project#14411)

Signed-off-by: shen-shanshan <467638484@qq.com>
Signed-off-by: Yang Wang <elainewy@meta.com>
wangxiyuan pushed a commit to vllm-project/vllm-ascend that referenced this pull request Apr 22, 2025
### What this PR does / why we need it?
Remove some parts of metrics patch, since the `cuda` hard code has been
fixed by vllm-project/vllm#14411.

Signed-off-by: shen-shanshan <467638484@qq.com>
frieda-huang pushed a commit to frieda-huang/vllm that referenced this pull request Apr 23, 2025
…m-project#14411)

Signed-off-by: shen-shanshan <467638484@qq.com>
Signed-off-by: Frieda (Jingying) Huang <jingyingfhuang@gmail.com>
ttanzhiqiang pushed a commit to ttanzhiqiang/vllm-ascend that referenced this pull request Apr 27, 2025
### What this PR does / why we need it?
Remove some parts of metrics patch, since the `cuda` hard code has been
fixed by vllm-project/vllm#14411.

Signed-off-by: shen-shanshan <467638484@qq.com>
jikunshang pushed a commit to jikunshang/vllm that referenced this pull request Apr 29, 2025
lk-chen pushed a commit to lk-chen/vllm that referenced this pull request Apr 29, 2025
adobrzyn pushed a commit to HabanaAI/vllm-fork that referenced this pull request Apr 30, 2025
…m-project#14411)

Signed-off-by: shen-shanshan <467638484@qq.com>
Signed-off-by: Agata Dobrzyniewicz <adobrzyniewicz@habana.ai>
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
…m-project#14411)

Signed-off-by: shen-shanshan <467638484@qq.com>
Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
Angazenn pushed a commit to Angazenn/vllm-ascend that referenced this pull request Oct 21, 2025
### What this PR does / why we need it?
Remove some parts of metrics patch, since the `cuda` hard code has been
fixed by vllm-project/vllm#14411.

Signed-off-by: shen-shanshan <467638484@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants