-
Notifications
You must be signed in to change notification settings - Fork 11
Enable prefill for running CausalLM using ET runtime #73
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
base: main
Are you sure you want to change the base?
Conversation
cc: @kimishpatel |
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
5f98c87
to
f735b5f
Compare
2cdae1e
to
c308c15
Compare
Kernel fixed from |
Some of the failures are due to quality degradation from the |
…missing cache_position support
Summary
Add support to utilize ExecuTorch runtime to prefill prompt tokens. This PR is enabling prefill via the HF's python API.
Size comparison:
There is no big impact on PTE file size given the upper bound size of 128 in this test.
Perf comparison:
time_to_first_token
is 20x faster. See details in the tests below:1. Generation with prefill enabled
The PTE is exported with dynamic shapes supported at the
seq_len
dim for bothinput_ids
andcache_position
.Time to first generated token
: 0.658000s2. Generation WITHOUT prefill
This is taking a PTE that is generated statically. The prompt tokens are processed sequentially.
Time to first generated token
: 15.547000s3. Generation WITHOUT prefill (backwards compatbility)
It's important to make sure compatibility. That is, the PTE is exported with dynamic shapes can still be loaded and run with the old code, it will just degrade to sequential processing as case 2.
Time to first generated token
: 15.818000s