microsoft / microsoft/MInference
[Question]: when searching the best sparse attention type ,why to caculate the score just pick the 2500 cols?
Open
@iofu728 is already working on this.
Since Dec 12, 2024.
question
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 82
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 1
Description
Describe the issue
I hope this messages find u well!
def stream_llm(vertical_size, slash_size):
q_len = q.shape[2]
mask = torch.triu(torch.tril(torch.ones(q_len, q_len), 0), -slash_size).to(q)
mask[:,:vertical_size] = 1
mask = mask.unsqueeze(0).unsqueeze(1)
est_attn = torch.tril(mask)
attn_weights_x = attn_weights * est_attn
res3 = attn_weights_x[:,:,2500:].sum(-1).mean(-1).squeeze().float().detach().cpu().numpy()
return res3
why this only pick the 2500: columns? If the head is A-shape, this may lead to mis-classification to V-S type?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.