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

Why the updated cache is initialized with seqlen=256? #57

Open
pUmpKin-Co opened this issue Mar 27, 2024 · 0 comments
Open

Why the updated cache is initialized with seqlen=256? #57

pUmpKin-Co opened this issue Mar 27, 2024 · 0 comments

Comments

@pUmpKin-Co
Copy link

Hi~
I am currently following the hf version for exploration.
But find that when update KV cache in Llama (NousResearch/Yarn-Llama-2-7b-128k).
The updated empty caches' length is always 256 (line 528):

past_kv = torch.cat([past_kv, torch.empty(bsz, 256, 2, kv.size(3), kv.size(4), dtype=kv.dtype, device=kv.device)], 1)

I think it should be

past_kv = torch.cat([past_kv, torch.empty(bsz, kv.size(1), 2, kv.size(3), kv.size(4), dtype=kv.dtype, device=kv.device)], 1)

Is that right? Or I misunderstand this procedure?

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

1 participant