-
-
Notifications
You must be signed in to change notification settings - Fork 11.7k
[Bugfix] Address #8009 and add model test for flashinfer fp8 kv cache. #8013
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
[Bugfix] Address #8009 and add model test for flashinfer fp8 kv cache. #8013
Conversation
|
👋 Hi! Thank you for contributing to the vLLM project. 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:
🚀 |
|
@youkaichao I identified the issue after the PR was merged. Please take a look and see. Is there any way you can manually trigger the test that's failing? I added a test in this PR that should run |
|
/ready |
|
@comaniac Requesting for your review again. Missed a replacement from yesterday's fix. This PR also adds an explicit test to check both auto and fp8 dtypes with flashinfer. |
comaniac
left a comment
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.
The change LGTM. The comments are for tests. Also cc @youkaichao
| # Note that the golden strings may not work for FLASHINFER Backend. | ||
| # The intention is to test the path |
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.
In this case I'd suggest compare the logprobs of a first few generated tokens. Otherwise this test will slowdown the CI due to relative large model (8B) and large max tokens.
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.
Can you please clarify? I am seeing no output for logprobs.
outputs=[CompletionOutput(index=0, text='LLaMA is a high-throughput and memory-efficient inference and serving engine for Large Language Models (', token_ids=array('l', [4178, 64, 4940, 374, 264, 1579, 43847, 631, 323, 5044, 73916, 45478, 323, 13788, 4817, 369, 20902, 11688, 27972, 320]), cumulative_logprob=None, logprobs=None, finish_reason=length, stop_reason=None)], finished=True, metrics=RequestMetrics(arrival_time=1725049625.3656614, last_token_time=1725049625.3656614, first_scheduled_time=1725049625.368224, first_token_time=1725049625.3892546, time_in_queue=0.0025625228881835938, finished_time=1725049625.5246484, scheduler_time=0.0011748597025871277, model_forward_time=None, model_execute_time=None), lora_request=None)
Do we have to explicitly enable or disable something in the generate call?
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.
Given that the test won't fail, we merge this PR to fix the CI first. I'll have a follow-up PR to improve this test next week.
|
I can run flashinfer fp8 with Ampere GPU(3090) using #7985. But I got dispatch error with this pr. Seems because of this? |
|
No. We only support fp8_e5m2 kv cache for Amper and all GPUs without native fp8 support. |
BatchPrefillWithPagedKVCacheWrapper natively supports fp8 for Ampere GPU, but BatchDecodeWithPagedKVCacheWrapper doesn't. So, is it possible to turn on fp8 kv cache at prefill stage and use fp16 at decode stage for old GPUs? |
Yes we could just dequantize fp8 kv cache back to fp16 before invoking the decoding kernel, although this brings additional latency overhead. |
…-project#8013) Signed-off-by: Alvant <[email protected]>
…-project#8013) Signed-off-by: LeiWang1999 <[email protected]>
This addresses the bug described in #8009. Fix is to consistently replace the fp8 type right before we call into Flashinfer API.
Please note that this test is disabled because FP8 numerics are resulting in slightly different strings each run. But can be evaluated that the strings are essentially the same in English.
PR Checklist (Click to Expand)
Thank you for your contribution to vLLM! Before submitting the pull request, please ensure the PR meets the following criteria. This helps vLLM maintain the code quality and improve the efficiency of the review process.
PR Title and Classification
Only specific types of PRs will be reviewed. The PR title is prefixed appropriately to indicate the type of change. Please use one of the following:
[Bugfix]for bug fixes.[CI/Build]for build or continuous integration improvements.[Doc]for documentation fixes and improvements.[Model]for adding a new model or improving an existing model. Model name should appear in the title.[Frontend]For changes on the vLLM frontend (e.g., OpenAI API server,LLMclass, etc.)[Kernel]for changes affecting CUDA kernels or other compute kernels.[Core]for changes in the core vLLM logic (e.g.,LLMEngine,AsyncLLMEngine,Scheduler, etc.)[Hardware][Vendor]for hardware-specific changes. Vendor name should appear in the prefix (e.g.,[Hardware][AMD]).[Misc]for PRs that do not fit the above categories. Please use this sparingly.Note: If the PR spans more than one category, please include all relevant prefixes.
Code Quality
The PR need to meet the following code quality standards:
format.shto format your code.docs/source/if the PR modifies the user-facing behaviors of vLLM. It helps vLLM user understand and utilize the new features or changes.Notes for Large Changes
Please keep the changes as concise as possible. For major architectural changes (>500 LOC excluding kernel/data/config/test), we would expect a GitHub issue (RFC) discussing the technical design and justification. Otherwise, we will tag it with
rfc-requiredand might not go through the PR.What to Expect for the Reviews
The goal of the vLLM team is to be a transparent reviewing machine. We would like to make the review process transparent and efficient and make sure no contributor feel confused or frustrated. However, the vLLM team is small, so we need to prioritize some PRs over others. Here is what you can expect from the review process:
action-requiredlabel on the PR if there are changes required. The contributor should address the comments and ping the reviewer to re-review the PR.Thank You
Finally, thank you for taking the time to read these guidelines and for your interest in contributing to vLLM. Your contributions make vLLM a great tool for everyone!