Skip to content

mlir: run mincut for scf.if ops#2846

Open
pengmai wants to merge 1 commit into
mainfrom
jmp/mincut-if
Open

mlir: run mincut for scf.if ops#2846
pengmai wants to merge 1 commit into
mainfrom
jmp/mincut-if

Conversation

@pengmai
Copy link
Copy Markdown
Member

@pengmai pengmai commented Jun 1, 2026

No description provided.

@pengmai pengmai requested review from Pangoraw and wsmoses June 1, 2026 16:26
Copy link
Copy Markdown
Member

@wsmoses wsmoses left a comment

Choose a reason for hiding this comment

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

lgtm, but can we also do this for affineif as well?

Copy link
Copy Markdown
Collaborator

@Pangoraw Pangoraw left a comment

Choose a reason for hiding this comment

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

lgtm! we could potentially run mincut for every pairs of forward / reverse blocks as present in gutils->mapReverseModeBlocks (though nested ops don't populate the map rn)

@wsmoses
Copy link
Copy Markdown
Member

wsmoses commented Jun 5, 2026

@pengmai we have a conflict here rn if you can take a quick look [then we can merge, and address affine.if in follow ups]

@pengmai
Copy link
Copy Markdown
Member Author

pengmai commented Jun 5, 2026

@pengmai we have a conflict here rn if you can take a quick look [then we can merge, and address affine.if in follow ups]

Done. FYI it looks like we don't currently support differentiation of affine.if at all, but these changes are templated in an IfLike remover that should work with affine.if without modification when support for affine.if is added.

we could potentially run mincut for every pairs of forward / reverse blocks as present in gutils->mapReverseModeBlocks (though nested ops don't populate the map rn)

This would be interesting. We'd need to make sure it respects the preserve_cache attributes.

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