feat(skip-softmax): Add skip-softmax support for KV-blocked attention#1009
Draft
vbaddi wants to merge 1 commit into
Draft
feat(skip-softmax): Add skip-softmax support for KV-blocked attention#1009vbaddi wants to merge 1 commit into
vbaddi wants to merge 1 commit into
Conversation
Signed-off-by: Onkar Chougule <ochougul@qti.qualcomm.com>
This file contains hidden or 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
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.
Summary
Adds BLASS-style skip-softmax support on top of KV-blocked attention.
Changes
skip_softmaxknobs to attention blocking config.lambda_eff = skip_softmax_scale / ctx_lenExample
KV-Blocking baseline:
python examples/text_generation/skip_softmax_kv_blocking_inference.py \ --model-name meta-llama/Llama-3.2-1B \ --prompt "Can you generate a detailed case study for Mumbai city?" \ --prefill-seq-len 1 \ --ctx-len 65536 \ --generation-len 64000 \ --num-kv-blocks 8 \ --no-skip-softmax \ --num-cores 16 \ --aic-hw-version ai100 \ --device-group '[0,1,2,3]' KV-Blocking + skip-softmax: python examples/text_generation/skip_softmax_kv_blocking_inference.py \ --model-name meta-llama/Llama-3.2-1B \ --prompt "Can you generate a detailed case study for Mumbai city?" \ --prefill-seq-len 1 \ --ctx-len 65536 \ --generation-len 64000 \ --num-kv-blocks 8 \ --skip-softmax \ --skip-softmax-decode-scale 16.0 \ --skip-softmax-prefill-scale 1.0 \ --skip-softmax-min-keep-blocks 1 \ --num-cores 16 \ --aic-hw-version ai100 \ --device-group '[0,1,2,3]'Validation
cc: @anujgupt-github @kdulla