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

Split affine.parallels such that we no longer need a nested affine.if #447

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ivanradanov
Copy link
Collaborator

@ivanradanov ivanradanov commented Mar 10, 2025

Strongly suggested that this pass gets used on func.func because otherwise there is a huge overhead

func.func(llvm-to-affine-access)

There seem to be some issues with it in the context of the entire pipeline which I am investigating now.

@ivanradanov ivanradanov requested a review from wsmoses March 10, 2025 03:49
@ivanradanov
Copy link
Collaborator Author

Regarding phase ordering. In theory we would like something like this:

func.func(affine-cfg{enable-parallel-if-split=true}),func.func(llvm-to-affine-access),...,affine-to-stablehlo,func.func(affine-cfg{enable-parallel-if-split-false}),affine-to-stablehlo

I still haven't introduced the enable-parallel-if-split option

the idea is that whatever we can raise to stablehlo with affine.ifs intact we should do so. (llvm-to-affine-access will only split the ifs that it needs to enable raising of llvm.{store,load})

Then for the remaining things which we werent able to raise , we want to split the parallel if iteration space for everything we can so that we can raise as much as possible to stablehlo

Not sure if stablehlo supports non-rectangular iteration spaces or tensors, @Pangoraw any input here?

cc @Pangoraw @wsmoses

Add if simplification

Working?

add test

cleanup test a bit
@ivanradanov ivanradanov force-pushed the ivan/parallel_if_split branch from 45823eb to a6deacb Compare March 11, 2025 00:40
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.

1 participant