Skip to content

Commit

Permalink
fix: (csl) adjusted width and height of the PE (#3209)
Browse files Browse the repository at this point in the history
They need to be 2 greater than the dmp topology

@n-io Could you please let me know if this looks right?

---------

Co-authored-by: Nicolai Stawinoga <[email protected]>
  • Loading branch information
dk949 and n-io authored Sep 25, 2024
1 parent 5349938 commit 2916539
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/filecheck/transforms/csl-stencil-to-csl-wrapper.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func.func @gauss_seidel(%a : !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>,
func.return
}

// CHECK: "csl_wrapper.module"() <{"width" = 1022 : i16, "height" = 510 : i16, "params" = [#csl_wrapper.param<"z_dim" default=512 : i16>, #csl_wrapper.param<"pattern" default=2 : i16>, #csl_wrapper.param<"num_chunks" default=2 : i16>, #csl_wrapper.param<"chunk_size" default=255 : i16>, #csl_wrapper.param<"padded_z_dim" default=510 : i16>], "program_name" = "gauss_seidel"}> ({
// CHECK: "csl_wrapper.module"() <{"width" = 1024 : i16, "height" = 512 : i16, "params" = [#csl_wrapper.param<"z_dim" default=512 : i16>, #csl_wrapper.param<"pattern" default=2 : i16>, #csl_wrapper.param<"num_chunks" default=2 : i16>, #csl_wrapper.param<"chunk_size" default=255 : i16>, #csl_wrapper.param<"padded_z_dim" default=510 : i16>], "program_name" = "gauss_seidel"}> ({
// CHECK-NEXT: ^0(%0 : i16, %1 : i16, %2 : i16, %3 : i16, %4 : i16, %5 : i16, %6 : i16, %7 : i16, %8 : i16):
// CHECK-NEXT: %9 = arith.constant 0 : i16
// CHECK-NEXT: %10 = "csl.get_color"(%9) : (i16) -> !csl.color
Expand Down Expand Up @@ -124,7 +124,7 @@ func.func @bufferized(%arg0 : memref<512xf32>, %arg1 : memref<512xf32>) {
}


// CHECK: "csl_wrapper.module"() <{"width" = 1022 : i16, "height" = 510 : i16, "params" = [#csl_wrapper.param<"z_dim" default=512 : i16>, #csl_wrapper.param<"pattern" default=2 : i16>, #csl_wrapper.param<"num_chunks" default=2 : i16>, #csl_wrapper.param<"chunk_size" default=255 : i16>, #csl_wrapper.param<"padded_z_dim" default=510 : i16>], "program_name" = "bufferized"}> ({
// CHECK: "csl_wrapper.module"() <{"width" = 1024 : i16, "height" = 512 : i16, "params" = [#csl_wrapper.param<"z_dim" default=512 : i16>, #csl_wrapper.param<"pattern" default=2 : i16>, #csl_wrapper.param<"num_chunks" default=2 : i16>, #csl_wrapper.param<"chunk_size" default=255 : i16>, #csl_wrapper.param<"padded_z_dim" default=510 : i16>], "program_name" = "bufferized"}> ({
// CHECK-NEXT: ^2(%43 : i16, %44 : i16, %45 : i16, %46 : i16, %47 : i16, %48 : i16, %49 : i16, %50 : i16, %51 : i16):
// CHECK-NEXT: %52 = arith.constant 0 : i16
// CHECK-NEXT: %53 = "csl.get_color"(%52) : (i16) -> !csl.color
Expand Down
4 changes: 2 additions & 2 deletions xdsl/transforms/csl_stencil_to_csl_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def match_and_rewrite(self, op: func.FuncOp, rewriter: PatternRewriter, /):

# initialise module op
module_op = csl_wrapper.ModuleOp(
width=IntegerAttr(width, 16),
height=IntegerAttr(height, 16),
width=IntegerAttr(width + (max_distance * 2), 16),
height=IntegerAttr(height + (max_distance * 2), 16),
params={
"z_dim": IntegerAttr(z_dim, 16),
"pattern": IntegerAttr(max_distance + 1, 16),
Expand Down

0 comments on commit 2916539

Please sign in to comment.