Skip to content

Commit

Permalink
Integrate stencil collapse in MPI pipeline.
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal committed Oct 21, 2023
1 parent edf261e commit 45a574f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions devito/operator/xdsl_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

XDSL_CPU_PIPELINE = lambda tile_sizes, collapse: f'"stencil-shape-inference,convert-stencil-to-ll-mlir{{{"tile-sizes="+",".join(["128"]*tile_sizes) if tile_sizes > 0 else ""} collapse={collapse}}},printf-to-llvm"'
XDSL_GPU_PIPELINE = "stencil-shape-inference,convert-stencil-to-ll-mlir{target=gpu},reconcile-unrealized-casts,printf-to-llvm"
XDSL_MPI_PIPELINE = lambda decomp, nb_tiled_dims: f'"dmp-decompose-2d{decomp},canonicalize-dmp,convert-stencil-to-ll-mlir{{tile-sizes={",".join(["64"]*nb_tiled_dims)}}},dmp-to-mpi{{mpi_init=false}},lower-mpi,printf-to-llvm"'
XDSL_MPI_PIPELINE = lambda decomp, tile_sizes, collapse: f'"dmp-decompose-2d{decomp},canonicalize-dmp,convert-stencil-to-ll-mlir{{{"tile-sizes="+",".join(["128"]*tile_sizes) if tile_sizes > 0 else ""} collapse={collapse}}},dmp-to-mpi{{mpi_init=false}},lower-mpi,printf-to-llvm"'


class XDSLOperator(Operator):
Expand Down Expand Up @@ -136,7 +136,7 @@ def _jit_compile(self):
decomp = "2d-grid" if len(shape) == 2 else "3d-grid"

decomp = f"{{strategy={decomp} slices={slices} restrict_domain=false}}"
xdsl_pipeline = XDSL_MPI_PIPELINE(decomp, to_tile)
xdsl_pipeline = XDSL_MPI_PIPELINE(decomp, to_tile, to_tile)
elif is_gpu:
xdsl_pipeline = XDSL_GPU_PIPELINE
mlir_pipeline = MLIR_GPU_PIPELINE(block_sizes)
Expand Down

0 comments on commit 45a574f

Please sign in to comment.