Skip to content
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

During BERT decoding, past_key_values is used to accelerate calculation. Do we have a similar implementation? #129

Open
etrigger opened this issue Aug 10, 2023 · 1 comment

Comments

@etrigger
Copy link

I did not find such a cached method using past_key_values in the SAT. Is it possible to add this?
Thanks.

@Sleepychord
Copy link
Contributor

Yes, but more simpler.
You can just do this model.add_mixin('auto-regressive', CachedAutoregressiveMixin()). You don't need to consider past_key_values when implementing model (In most cases), can this mixin and filling_sequence (autoregressive api) will save cache for it.

example see llama inference example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants