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

How to select params for self extend? (llama3.1 and gemma2) #47

Open
hahmad2008 opened this issue Nov 20, 2024 · 0 comments
Open

How to select params for self extend? (llama3.1 and gemma2) #47

hahmad2008 opened this issue Nov 20, 2024 · 0 comments

Comments

@hahmad2008
Copy link

I need to extend the context length of llama3.1-8b from suppose the context length is 8k up to 128k. And the same for gemma2.
I see that the there is example for gemma2 here
However I don't know how to select these is there any formula to follow?

Gemma2:

original_gemma_forward = GemmaAttention.forward
self_extend_forward = partial(
    SE.Gemma.flash_self_extend_forward, group_size_1=8, group_size_2=1024
)

And for llama3.1:

window_size = 1024
group_size = 32
use_flash = True
SelfExtend.apply(model, group_size, window_size, enable_flash_attention=use_flash, flash_attention_impl="flash_attn") ## flash_attention_impl="triton" or "flash_attn"

btw what is the meaning of these logs Passkey?

#Tokens of Prompt: 9992 Passkey target: 58328

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