pytorch-llama icon indicating copy to clipboard operation
pytorch-llama copied to clipboard

Can I turn off KV cache?

Open purejomo opened this issue 1 year ago • 2 comments

Hello,

Could you please advise me on how to disable the KV cache? I would also appreciate any guidance on how to implement this change in code.

Thank you for your assistance.

purejomo avatar May 25 '24 12:05 purejomo

You can refer to this: https://github.com/JAYANDJEAN/From_Transformer_to_GPTs/blob/main/04_llama2/llama.py I use use_cache to control whether to use the cache, because we don't need to use the cache during training.

JAYANDJEAN avatar May 31 '24 10:05 JAYANDJEAN

@JAYANDJEAN Thanks It means I can turn off caching by modifying codes?

purejomo avatar Aug 26 '24 13:08 purejomo