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

Unhack stencil.store result through bufferization #118

Merged
merged 15 commits into from
Aug 30, 2024

Conversation

PapyChacal
Copy link
Collaborator

@PapyChacal PapyChacal commented Aug 19, 2024

Instead of using a hacked result on stencil.store, use a stencil.store and then restencil.load.

Use meanwhile added xDSL stuff and update pipelines and tests accordingly!

Filechecks have changed a lot since the pipeline is updated. I took the chance to add more xDSL canonicalization and CSE steps now that it's performing there too!

@PapyChacal PapyChacal self-assigned this Aug 19, 2024
@PapyChacal PapyChacal force-pushed the emilien/coming-soon branch 2 times, most recently from c3b7786 to a3e3002 Compare August 20, 2024 16:23
@PapyChacal PapyChacal changed the title [TEASER] Unhack stencil.store result through bufferization Unhack stencil.store result through bufferization Aug 20, 2024
Copy link
Collaborator

@georgebisbas georgebisbas left a comment

Choose a reason for hiding this comment

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

Looks great from a first pass! Lemme know when it will not be a DRAFT!

@PapyChacal PapyChacal marked this pull request as ready for review August 21, 2024 11:04
devito/xdsl_core/xdsl_cpu.py Show resolved Hide resolved
devito/ir/xdsl_iet/cluster_to_ssa.py Show resolved Hide resolved
devito/xdsl_core/xdsl_cpu.py Show resolved Hide resolved
devito/xdsl_core/xdsl_gpu.py Show resolved Hide resolved
@@ -1,4 +1,4 @@
// RUN: xdsl-opt -p "distribute-stencil{strategy=3d-grid slices=2,1,1 restrict_domain=false},canonicalize-dmp,convert-stencil-to-ll-mlir" %s | filecheck %s
// RUN: xdsl-opt -p "canonicalize,cse,distribute-stencil{strategy=3d-grid slices=2,1,1 restrict_domain=false},shape-inference,canonicalize-dmp,stencil-bufferize,dmp-to-mpi{mpi_init=false},convert-stencil-to-ll-mlir,canonicalize,cse" %s | filecheck %s
Copy link
Collaborator

Choose a reason for hiding this comment

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

This test is doing more than the original one; I think it is stronger, and this is good.
Is there a reason behind that?

Copy link
Collaborator Author

@PapyChacal PapyChacal Aug 29, 2024

Choose a reason for hiding this comment

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

IIRC, canonicalization gets rid of some useless stencil generated operations, that make my bufferization ungracefully fail. (As-in, bufferization expects a canonicalized input)
It could arguably be handled differently but figured might as well add those generic optimizations everywhere; they help with the code and just remove work for heavier optimization passes!

Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for the reply, can you add this (your reply's useful info) as a comment/info/doc in some place you consider it appropriate?

tests/filecheck/xdsl_mpi_pipeline_d.mlir Outdated Show resolved Hide resolved
tests/filecheck/xdsl_pipeline_openmp.mlir Outdated Show resolved Hide resolved
@georgebisbas georgebisbas merged commit 261b3b6 into master Aug 30, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants