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

H2O implementation #24

Open
gopikrishnajha opened this issue Oct 13, 2024 · 1 comment
Open

H2O implementation #24

gopikrishnajha opened this issue Oct 13, 2024 · 1 comment

Comments

@gopikrishnajha
Copy link

In the update_kv function of H2OKVCluster class, I see this code.

attn_weights = torch.matmul(query_states[..., -self.window_size:, :], key_states.transpose(2, 3)) / math.sqrt(head_dim)

As far as I know there is no concept of window in H2O. Shouldn't the entire query_states matrix be considered for attn_weights computation? Why are you only snipping out the window_size part from the query states to be considered for matrix multiplication here?

@Zefan-Cai
Copy link
Owner

Thank you for pointing out!
The current code is inconsistent with standard H2O as you mentioned. We have tested performance with or without the entire query_state to calculate the attention. We found that this has very limited influence on the performance. We will address this inconsistency in the updated code.

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