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

[TKW] Modify Index Seq Analysis to handle "detours" #246

Open
raikonenfnu opened this issue Oct 29, 2024 · 0 comments
Open

[TKW] Modify Index Seq Analysis to handle "detours" #246

raikonenfnu opened this issue Oct 29, 2024 · 0 comments
Assignees

Comments

@raikonenfnu
Copy link
Contributor

Our current index_seq_analysis, does a backward pass on lhs, rhs, and acc, and then does a forward pass on it's consumers. This is working out OK for now, however for more complex cases we may need to modify it to also do detours. Consider this case:

lhs = read
rhs = read
bias = read
mma = mma(lhs, rhs)
res = mma + bias
write(res)

In the case above, if we want read of bias to also have the layouts from mma's acc, we'd need to do a detour during layout setting i.e
mma -> res -(detour)-> bias read.

This is actually also evident in the case of our attention kernel. Currently, we are manually setting vector_shapes for M and N on our attention kernel

vector_shapes={B: 0, M: 16, N: 16},
S.T the partial_sum/reduction of sum will have the correct expansion and indexing. In reality, we should be able to handle this by doing the detour.

@harsh-nod harsh-nod self-assigned this Oct 29, 2024
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