Skip to content

Conversation

@SnowCharmQ
Copy link
Contributor

@SnowCharmQ SnowCharmQ commented Apr 11, 2025

This PR enhances the performance of the method _prepare_inputs in gpu_model_runner.py by replacing the original Python loop implementation with map and numpy array operations.

On my clusters, it can achieve nearly a twofold performance improvement.

@github-actions
Copy link

👋 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.

🚀

@mergify mergify bot added the v1 label Apr 11, 2025
Signed-off-by: snowcharm <[email protected]>
Copy link
Member

@njhill njhill left a comment

Choose a reason for hiding this comment

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

Thanks @SnowCharmQ, this is great!

On my clusters, it can achieve nearly a twofold performance improvement.

Presumably you're referring to the improvement of this loop, not end-to-end? :)

@SnowCharmQ
Copy link
Contributor Author

Thanks @SnowCharmQ, this is great!

On my clusters, it can achieve nearly a twofold performance improvement.

Presumably you're referring to the improvement of this loop, not end-to-end? :)

Hi @njhill, the improvement refers to the loop exactly. Sorry for the confusion :)

Co-authored-by: Nick Hill <[email protected]>
@njhill njhill added ready ONLY add when PR is ready to merge/full CI is needed performance Performance-related issues labels Apr 11, 2025
@SnowCharmQ
Copy link
Contributor Author

Hi @njhill, I noticed an issue with the CI check. Do you have any idea what might be going wrong and how it can be resolved?

@DarkLight1337 DarkLight1337 merged commit 93e5f3c into vllm-project:main Apr 12, 2025
56 of 57 checks passed
@DarkLight1337
Copy link
Member

I retried the test and it passes now

@SnowCharmQ SnowCharmQ deleted the perf-runner branch April 19, 2025 08:44
yangw-dev pushed a commit to yangw-dev/vllm that referenced this pull request Apr 21, 2025
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
RichardoMrMu pushed a commit to RichardoMrMu/vllm that referenced this pull request May 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

performance Performance-related issues ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants