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 modify the attention map in the cross-attention during inference ? #52

Open
yuxinchen-210210203 opened this issue Jan 22, 2025 · 0 comments

Comments

@yuxinchen-210210203
Copy link

Thank you for your great job!
I want to modify the attention map in the cross-attention during inference, but I am unable to access the internals of the flash_attn_varlen_kvpacked_func function. Therefore, I implemented my own cross-attention function. However, I found that the output of my implementation differs from the output of flash_attn_varlen_kvpacked_func to some extent. Is there a better way to directly manipulate the attention map within flash_attn_varlen_kvpacked_func?
Or is it possible that there is an issue with the way I implemented the cross-attention calculation? The differences between my implementation and the data are shown in the figure below.

Image

Image

Image

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