Skip to content

[DispatchCreation] Remove k2 attention constraint from BubbleUpExpandShapes - #20006

Closed
IanWood1 wants to merge 2 commits into
iree-org:mainfrom
IanWood1:remove_k2_constraint
Closed

IanWood1 wants to merge 2 commits into
iree-org:mainfrom
IanWood1:remove_k2_constraint

Conversation

@IanWood1

Copy link
Copy Markdown
Member

This can be removed after #19654 landed and these dims can be collapsed. Also, I added some missing canonicalization patterns to fold away reshapes.

@Groverkss
Groverkss force-pushed the remove_k2_constraint branch from 4968a6b to 986ee8a Compare March 12, 2025 08:23
@Groverkss Groverkss changed the title [Dispatch] Remove k2 constraint from BubbleUpExpandShapes [DispatchCreation] Remove k2 attention constraint from BubbleUpExpandShapes Mar 12, 2025

@MaheshRavishankar MaheshRavishankar left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isnt this a bit dangerous with the backend not really supporting multiple k2 dims? We are basically assuming that every k2 dimension split is artificial and relying on collapsing folding it back again.
I dont have a strong opinion. Just asking question, because if indeed it isnt an artifact that gets folded away later, then it is a "true split" and will have to adapt the codegen to handle it. So I am OK with putting downward pressure on the rest of the stack.

@Groverkss

Copy link
Copy Markdown
Contributor

Isnt this a bit dangerous with the backend not really supporting multiple k2 dims? We are basically assuming that every k2 dimension split is artificial and relying on collapsing folding it back again. I dont have a strong opinion. Just asking question, because if indeed it isnt an artifact that gets folded away later, then it is a "true split" and will have to adapt the codegen to handle it. So I am OK with putting downward pressure on the rest of the stack.

We can support multiple k2 dims, but what we cannot support the inner k2 dim being very small. Realistically, that never happens in workloads today. We should work towards fixing it though (through packs), but we don't support this for matmul in VectorDistribute or TileAndFuse today (afaik).

@IanWood1

Copy link
Copy Markdown
Member Author

@Groverkss should I close this? I think I saw a PR that supersedes this one.

@Groverkss

Copy link
Copy Markdown
Contributor

@Groverkss should I close this? I think I saw a PR that supersedes this one.

oh i didnt know i sent one lol. Yeah, you can close this, there are some cpu failures that im fixing and then ill send this again.

@IanWood1 IanWood1 closed this Mar 13, 2025
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

Successfully merging this pull request may close these issues.

3 participants