-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
[Kernel][Attention] Separate Attention.kv_scale
into k_scale
and v_scale
#6081
Merged
simon-mo
merged 13 commits into
vllm-project:main
from
neuralmagic:separate-key-value-scales
Jul 16, 2024
Merged
[Kernel][Attention] Separate Attention.kv_scale
into k_scale
and v_scale
#6081
simon-mo
merged 13 commits into
vllm-project:main
from
neuralmagic:separate-key-value-scales
Jul 16, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
comaniac
reviewed
Jul 3, 2024
mgoin
changed the title
[Kernel][Attention] Separate
[Kernel][Attention] Separate Jul 15, 2024
Attention.kv_scale
into key_scale
and value_scale
Attention.kv_scale
into k_scale
and v_scale
comaniac
reviewed
Jul 16, 2024
comaniac
approved these changes
Jul 16, 2024
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.
LGTM
dtrifiro
pushed a commit
to opendatahub-io/vllm
that referenced
this pull request
Jul 17, 2024
fialhocoelho
pushed a commit
to opendatahub-io/vllm
that referenced
this pull request
Jul 19, 2024
xjpang
pushed a commit
to xjpang/vllm
that referenced
this pull request
Jul 24, 2024
Alvant
pushed a commit
to compressa-ai/vllm
that referenced
this pull request
Oct 26, 2024
…`v_scale` (vllm-project#6081) Signed-off-by: Alvant <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since we already quantize
key_cache
andvalue_cache
separately in PagedAttention, there is "free accuracy on the table" for FP8 KV Cache quantization as we could use separate per-tensor scales for each.The FlashInfer FP8 attention kernel also uses separate
k_scale
andv_scale
values, so this PR is in preparation to enable that usage. Source: https://github.com/flashinfer-ai/flashinfer/blob/dc2c76f8577d8695112b61d1fd43ef88569272ef/python/flashinfer/decode.py#L98-L101This PR will maintain backwards compatibility with FP8 model checkpoints that currently use
kv_scale
and duplicates that scale for both key+value if that is all that is available. However if a checkpoint hask_scale
andv_scale
present on the attention module, we will prefer those values.