Skip to content

Conversation

IanWood1
Copy link
Contributor

@IanWood1 IanWood1 commented Aug 6, 2025

Needs iree-org/iree@35a872c to ensure all conv kernels get fused to a single dispatch. Specifically, the pads need to be fused into the dispatches.

@IanWood1 IanWood1 force-pushed the remove_force_single_dispatch branch from 1f5fd69 to 526e900 Compare August 6, 2025 17:48
@IanWood1 IanWood1 requested a review from zjgarvey August 6, 2025 17:51
@IanWood1 IanWood1 marked this pull request as draft August 6, 2025 17:52
@IanWood1
Copy link
Contributor Author

IanWood1 commented Aug 6, 2025

Keeping this as a draft until IREE is updated

@IanWood1 IanWood1 force-pushed the remove_force_single_dispatch branch from 526e900 to 1cb0828 Compare August 19, 2025 16:52
@IanWood1 IanWood1 marked this pull request as ready for review August 19, 2025 16:56
@IanWood1 IanWood1 requested a review from rkayaith August 20, 2025 15:42
Copy link
Contributor

@zjgarvey zjgarvey left a comment

Choose a reason for hiding this comment

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

How do we know if this is working correctly? Can we add some tests to verify this doesn't regress, etc?

@ftynse
Copy link
Contributor

ftynse commented Sep 2, 2025

Can we rather plumb this through as a flag (defaulted to False if needed). There are cases for layer norm that are currently failing to distribute without forcing single dispatch, in particular when intermediate results are forwarded from forward to reverse mode since those results don't participate in the "main" reduction. See https://discord.com/channels/689900678990135345/689932666505920596/1412414159248691210 for some more context.

@zjgarvey
Copy link
Contributor

zjgarvey commented Sep 2, 2025

Can we rather plumb this through as a flag (defaulted to False if needed). There are cases for layer norm that are currently failing to distribute without forcing single dispatch, in particular when intermediate results are forwarded from forward to reverse mode since those results don't participate in the "main" reduction. See https://discord.com/channels/689900678990135345/689932666505920596/1412414159248691210 for some more context.

Yeah, I just noticed this too. We could maybe put it into the OpSignature class, or allow the layer norm regressions and try to address it in the compiler? @MaheshRavishankar do you have preferences on how we handle this?

@MaheshRavishankar
Copy link

Can we rather plumb this through as a flag (defaulted to False if needed). There are cases for layer norm that are currently failing to distribute without forcing single dispatch, in particular when intermediate results are forwarded from forward to reverse mode since those results don't participate in the "main" reduction. See https://discord.com/channels/689900678990135345/689932666505920596/1412414159248691210 for some more context.

We will have to fix that forward. Could you file an issue for what you are seeing?

@ftynse
Copy link
Contributor

ftynse commented Sep 3, 2025

Why the rush? Can't we just treat this as an optimization option?

@IanWood1 IanWood1 force-pushed the remove_force_single_dispatch branch from 1cb0828 to 2aae8c2 Compare September 4, 2025 18:30
@MaheshRavishankar
Copy link

Why the rush? Can't we just treat this as an optimization option?

We can keep it as an optimization option, but it would be better to keep it default off. The default on is breaking a lot of cases. The issue that you pointed to is triaged and I think there is a fix for that already.

@IanWood1
Copy link
Contributor Author

IanWood1 commented Sep 9, 2025

@ftynse do you have any ideas/preference on how this would be exposed as an optimization option?

IanWood1 and others added 2 commits September 9, 2025 09:25
Signed-off-by: Ian Wood <ianwood@u.northwestern.edu>
Signed-off-by: zjgarvey <zjgarvey@gmail.com>
@IanWood1 IanWood1 force-pushed the remove_force_single_dispatch branch from ab12df6 to e396140 Compare September 9, 2025 16:25
@IanWood1
Copy link
Contributor Author

IanWood1 commented Sep 9, 2025

@ftynse do you have any ideas/preference on how this would be exposed as an optimization option?

Nevermind I think the commit that @zjgarvey added should give you what you want.

@zjgarvey
Copy link
Contributor

zjgarvey commented Sep 9, 2025

Yeah, the change I made should work as a temporary workaround until something like #1134 lands (where the fusion spec for an op already determines whether it uses the attr).

Copy link
Contributor

@zjgarvey zjgarvey left a comment

Choose a reason for hiding this comment

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

LGTM

@zjgarvey zjgarvey merged commit aeb14c1 into iree-org:main Sep 9, 2025
8 checks passed
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.

4 participants