-
Notifications
You must be signed in to change notification settings - Fork 596
Qualcomm AI Engine Direct - Enable Lookahead Decoding #11437
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
Qualcomm AI Engine Direct - Enable Lookahead Decoding #11437
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11437
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 6bd4645 with merge base 56392aa ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
Hey can you add a read me to explain how this specific lookahead decoding work? Also, does 0/0/0 mean no lookahead decoding? |
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.
It looks great!
summary: - Add new eval_mode: lookahead - Add three arguments: ngram, window, gcap - Add lhd_token_generator
1bc9dcb
to
12e1ae5
Compare
Sure. Let me work on it.
|
@cccclai has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
## Summary: - Add new eval_mode: lookahead - Add three arguments: ngram, window, gcap - Add lhd_token_generator ## Command ``` python3 examples/qualcomm/oss_scripts/llama/llama.py -b build-android --checkpoint stories110M.pt --params params.json --tokenizer_model tokenizer.model --prompt "Once" --temperature 0 --tokenizer_bin tokenizer.bin --llama_model stories110m --model_mode lookahead --ptq 16a4w -m SM8650 -H ${host} -s ${device} -a ${artifacts} --max_seq_len 4096 --kv_updater smart_mask --prefill_ar_len 64 --ngram 3 --window 2 --gcap 2 ``` ## Test Results QNN SDK: 2.28 Device: SM8650 max_seq_len: 4096 ### Performance Improvement under different AR-N and different W/G/N Llama 3.2 3B  Llama 3.2 1B  Story Llama 110M  ### Performance Improvement under different prompt  ## Reference - https://lmsys.org/blog/2023-11-21-lookahead-decoding/ - https://github.com/hao-ai-lab/LookaheadDecoding/tree/main/lade - https://github.com/ggml-org/llama.cpp/blob/master/examples/lookahead/lookahead.cpp cc: @haowhsu-quic
Summary:
Command
Test Results
QNN SDK: 2.28
Device: SM8650
max_seq_len: 4096
Performance Improvement under different AR-N and different W/G/N
Llama 3.2 3B

Llama 3.2 1B

Story Llama 110M

Performance Improvement under different prompt
Reference
cc: @haowhsu-quic