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] benchmark_throughput : Add LoRA #11267

Merged

Conversation

varun-sundar-rabindranath
Copy link
Contributor

@varun-sundar-rabindranath varun-sundar-rabindranath commented Dec 17, 2024

Update benchmark_throughput.py to support LoRA benchmarking.

Examples:
Machine : 1xA100

python3 benchmarks/benchmark_throughput.py --model meta-llama/Llama-2-7b-hf --backend vllm --dataset ./ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts 1000

Throughput: 11.45 requests/s, 5509.93 total tokens/s, 2693.62 output tokens/s

python3 benchmarks/benchmark_throughput.py --model meta-llama/Llama-2-7b-hf --backend vllm --dataset ./ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts ${num_prompts} --max-loras 1 --max-lora-rank 8 --enable-lora --lora-path "yard1/llama-2-7b-sql-lora-test"

Throughput: 7.60 requests/s, 3656.98 total tokens/s, 1787.78 output tokens/s

python3 benchmarks/benchmark_throughput.py --model meta-llama/Llama-2-7b-hf --backend vllm --dataset ./ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts ${num_prompts} --max-loras 4 --max-lora-rank 8 --enable-lora --lora-path "yard1/llama-2-7b-sql-lora-test"

Throughput: 7.61 requests/s, 3664.67 total tokens/s, 1791.53 output tokens/s

python3 benchmarks/benchmark_throughput.py --model meta-llama/Llama-2-7b-hf --backend vllm --dataset ./ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts ${num_prompts} --async-engine

Throughput: 11.31 requests/s, 5441.21 total tokens/s, 2660.02 output tokens/s

python3 benchmarks/benchmark_throughput.py --model meta-llama/Llama-2-7b-hf --backend vllm --dataset ./ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts ${num_prompts} --async-engine --max-loras 1 --max-lora-rank 8 --enable-lora --lora-path "yard1/llama-2-7b-sql-lora-test"

Throughput: 7.59 requests/s, 3654.39 total tokens/s, 1786.51 output tokens/s

python3 benchmarks/benchmark_throughput.py --model meta-llama/Llama-2-7b-hf --backend vllm --dataset ./ShareGPT_V3_unfiltered_cleaned_split.json --num-prompts ${num_prompts} --async-engine --max-loras 4 --max-lora-rank 8 --enable-lora --lora-path "yard1/llama-2-7b-sql-lora-test"

Throughput: 7.55 requests/s, 3634.68 total tokens/s, 1776.87 output tokens/s

cc @mgoin @robertgshaw2-neuralmagic @jeejeelee

Varun Sundar Rabindranath added 3 commits December 17, 2024 17:37
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Copy link

👋 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 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 do one of these:

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

🚀

Varun Sundar Rabindranath added 3 commits December 17, 2024 20:08
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
# LoRA
parser.add_argument("--lora-path",
type=str,
default='yard1/llama-2-7b-sql-lora-test')
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not recommended to use default , as LoRA is strongly coupled bound to the model. We also need to add help to describe this arg

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct. I have removed the default 👍 Thanks !

request_tokenizer = tokenizer
if args.enable_lora:
lora_request, request_tokenizer = get_random_lora_request(args)

Copy link
Collaborator

Choose a reason for hiding this comment

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

There are too many LoRA weights that don't include tokenizer files, which leads to request_tokenizer being None. We need to consider this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch ! Added a fallback to use the base tokenizer.

Varun Sundar Rabindranath added 3 commits December 18, 2024 13:46
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Copy link
Collaborator

@jeejeelee jeejeelee left a comment

Choose a reason for hiding this comment

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

overall lgtm, thanks

@jeejeelee jeejeelee added the ready ONLY add when PR is ready to merge/full CI is needed label Dec 19, 2024
@DarkLight1337 DarkLight1337 merged commit 9835673 into vllm-project:main Dec 19, 2024
45 of 47 checks passed
BKitor pushed a commit to BKitor/vllm that referenced this pull request Dec 30, 2024
Signed-off-by: Varun Sundar Rabindranath <[email protected]>
Co-authored-by: Varun Sundar Rabindranath <[email protected]>
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