Skip to content
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

[MISC] Use non-blocking transfer in prepare_input #7172

Merged
merged 2 commits into from
Aug 5, 2024

Conversation

comaniac
Copy link
Collaborator

@comaniac comaniac commented Aug 5, 2024

This PR uses non-blocking data transfer in prepare_input. This is beneficial because we transfer several tensors to GPU in prepare_input. Here are some benchmark results using Llama-3.1-8B-Instruct on 1xH100:

Batching

Command:

python3 benchmark_throughput.py \
    --model meta-llama/Meta-Llama-3.1-8B-Instruct \
    --backend vllm \
    --input-len 292 \
    --output-len 579 \
    --num-prompts 1000

Result (I observed some variants so if you ran this multiple times the throughput is actually ranging from 8.15~8.34).

Main:    Throughput: 8.12 requests/s, 7075.74 tokens/s
This PR: Throughput: 8.34 requests/s, 7266.01 tokens/s

Serving

I used a different benchmark framework so no commands here, but the settings are as follows:

  • Input / Output: 550 / 150
  • QPS: 8
  • Duration: 120 seconds
Main:    P90 Latency: TTFT 47.9ms, ITL 12.9ms, E2E 2.0s
This PR: P90 Latency: TTFT 44.8ms, ITL 11.5ms, E2E 1.8s

Reference: https://pytorch.org/tutorials/intermediate/pinmem_nonblock.html

cc @youkaichao

@comaniac comaniac marked this pull request as ready for review August 5, 2024 21:42
Copy link

github-actions bot commented Aug 5, 2024

👋 Hi! Thank you for contributing to the vLLM project.
Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which consists a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of default ones by unblocking the steps in your fast-check build on Buildkite UI.

Once the PR is approved and ready to go, please make sure to run full CI as it is required to merge (or just use auto-merge).

To run full CI, you can do one of these:

  • Comment /ready on the PR
  • Add ready label to the PR
  • Enable auto-merge.

🚀

Copy link
Collaborator

@Yard1 Yard1 left a comment

Choose a reason for hiding this comment

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

lgtm

vllm/attention/backends/flashinfer.py Outdated Show resolved Hide resolved
@comaniac comaniac added the ready ONLY add when PR is ready to merge/full CI is needed label Aug 5, 2024
@comaniac comaniac enabled auto-merge (squash) August 5, 2024 22:26
@comaniac comaniac merged commit ef527be into vllm-project:main Aug 5, 2024
65 checks passed
sfc-gh-mkeralapura pushed a commit to sfc-gh-mkeralapura/vllm that referenced this pull request Aug 12, 2024
kylesayrs pushed a commit to neuralmagic/vllm that referenced this pull request Aug 17, 2024
fialhocoelho pushed a commit to opendatahub-io/vllm that referenced this pull request Aug 22, 2024
Alvant pushed a commit to compressa-ai/vllm that referenced this pull request Oct 26, 2024
KuntaiDu pushed a commit to KuntaiDu/vllm that referenced this pull request Nov 20, 2024
@comaniac comaniac deleted the non-blocking branch January 3, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready ONLY add when PR is ready to merge/full CI is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants