Skip to content

Commit

Permalink
Merge branch 'main' into emilien/update-value-type
Browse files Browse the repository at this point in the history
  • Loading branch information
PapyChacal authored Aug 17, 2024
2 parents ad3e2c8 + b01afed commit d9dc196
Show file tree
Hide file tree
Showing 24 changed files with 472 additions and 279 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repos:
hooks:
- id: check-yaml
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.7
rev: v0.6.0
hooks:
- id: ruff
types_or: [ python, pyi, jupyter ]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dev = [
"lit<19.0.0",
"marimo==0.7.20",
"pre-commit==3.8.0",
"ruff==0.5.7",
"ruff==0.6.0",
"asv<0.7",
"nbconvert>=7.7.2,<8.0.0",
"textual-dev==1.5.1",
Expand Down
2 changes: 1 addition & 1 deletion tests/dialects/test_stencil.py
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ def module():
%9 = arith.addf %8, %7 : f32
stencil.return %9 : f32
}
stencil.store %3 to %1 (<[0], [6]>) : !stencil.temp<?xf32> to !stencil.field<[-1,7]xf32>
stencil.store %3 to %1(<[0], [6]>) : !stencil.temp<?xf32> to !stencil.field<[-1,7]xf32>
func.return
}
}
Expand Down
12 changes: 6 additions & 6 deletions tests/filecheck/dialects/csl/csl-stencil-canonicalize.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ builtin.module {
^0(%8 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %9 : tensor<510xf32>):
csl_stencil.yield %9 : tensor<510xf32>
})
stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>

%10 = tensor.empty() : tensor<510xf32>
%11 = csl_stencil.apply(%0 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %10 : tensor<510xf32>) -> (!stencil.temp<[0,1]x[0,1]xtensor<510xf32>>) <{"num_chunks" = 2, "topo" = #dmp.topo<1022x510>, "swaps" = [#csl_stencil.exchange<to [1, 0]>, #csl_stencil.exchange<to [-1, 0]>, #csl_stencil.exchange<to [0, 1]>, #csl_stencil.exchange<to [0, -1]>], "operandSegmentSizes" = array<i32: 1, 1, 0, 0>}> ({
Expand All @@ -27,7 +27,7 @@ builtin.module {
^0(%17 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %18 : tensor<510xf32>):
csl_stencil.yield %18 : tensor<510xf32>
})
stencil.store %11 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %11 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>

%19 = tensor.empty() : tensor<510xf32>
%20 = csl_stencil.apply(%0 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %19 : tensor<510xf32>) -> (!stencil.temp<[0,1]x[0,1]xtensor<510xf32>>) <{"num_chunks" = 2, "topo" = #dmp.topo<1022x510>, "swaps" = [#csl_stencil.exchange<to [1, 0]>, #csl_stencil.exchange<to [-1, 0]>, #csl_stencil.exchange<to [0, 1]>, #csl_stencil.exchange<to [0, -1]>], "operandSegmentSizes" = array<i32: 1, 1, 0, 0>}> ({
Expand All @@ -39,7 +39,7 @@ builtin.module {
^0(%26 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %27 : tensor<510xf32>):
csl_stencil.yield %27 : tensor<510xf32>
})
stencil.store %20 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %20 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
func.return
}
}
Expand All @@ -58,7 +58,7 @@ builtin.module {
// CHECK-NEXT: ^1(%8 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %9 : tensor<510xf32>):
// CHECK-NEXT: csl_stencil.yield %9 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: %3 = csl_stencil.apply(%0 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %1 : tensor<510xf32>) -> (!stencil.temp<[0,1]x[0,1]xtensor<510xf32>>) <{"num_chunks" = 2 : i64, "topo" = #dmp.topo<1022x510>, "swaps" = [#csl_stencil.exchange<to [1, 0]>, #csl_stencil.exchange<to [-1, 0]>, #csl_stencil.exchange<to [0, 1]>, #csl_stencil.exchange<to [0, -1]>], "operandSegmentSizes" = array<i32: 1, 1, 0, 0>}> ({
// CHECK-NEXT: ^0(%4 : tensor<4x255xf32>, %5 : index, %6 : tensor<510xf32>):
// CHECK-NEXT: %7 = csl_stencil.access %4[1, 0] : tensor<4x255xf32>
Expand All @@ -68,7 +68,7 @@ builtin.module {
// CHECK-NEXT: ^1(%9 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %10 : tensor<510xf32>):
// CHECK-NEXT: csl_stencil.yield %10 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %3 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %3 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: %4 = csl_stencil.apply(%0 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %1 : tensor<510xf32>) -> (!stencil.temp<[0,1]x[0,1]xtensor<510xf32>>) <{"num_chunks" = 2 : i64, "topo" = #dmp.topo<1022x510>, "swaps" = [#csl_stencil.exchange<to [1, 0]>, #csl_stencil.exchange<to [-1, 0]>, #csl_stencil.exchange<to [0, 1]>, #csl_stencil.exchange<to [0, -1]>], "operandSegmentSizes" = array<i32: 1, 1, 0, 0>}> ({
// CHECK-NEXT: ^0(%5 : tensor<4x255xf32>, %6 : index, %7 : tensor<510xf32>):
// CHECK-NEXT: %8 = csl_stencil.access %5[1, 0] : tensor<4x255xf32>
Expand All @@ -78,7 +78,7 @@ builtin.module {
// CHECK-NEXT: ^1(%10 : !stencil.temp<[-1,2]x[-1,2]xtensor<512xf32>>, %11 : tensor<510xf32>):
// CHECK-NEXT: csl_stencil.yield %11 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %4 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %4 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
// CHECK-NEXT: }
8 changes: 4 additions & 4 deletions tests/filecheck/dialects/csl/csl-stencil-ops.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ builtin.module {
%20 = arith.mulf %17, %19 : tensor<510xf32>
stencil.return %20 : tensor<510xf32>
}
stencil.store %1 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %1 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
func.return
}
}
Expand Down Expand Up @@ -54,7 +54,7 @@ builtin.module {
// CHECK-NEXT: %20 = arith.mulf %17, %19 : tensor<510xf32>
// CHECK-NEXT: stencil.return %20 : tensor<510xf32>
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %1 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %1 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
// CHECK-NEXT: }
Expand Down Expand Up @@ -133,7 +133,7 @@ builtin.module {
csl_stencil.yield %21 : tensor<510xf32>
})

stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
func.return
}
}
Expand Down Expand Up @@ -167,7 +167,7 @@ builtin.module {
// CHECK-NEXT: %21 = arith.mulf %17, %20 : tensor<510xf32>
// CHECK-NEXT: csl_stencil.yield %21 : tensor<510xf32>
// CHECK-NEXT: })
// CHECK-NEXT: stencil.store %2 to %b (<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: stencil.store %2 to %b(<[0, 0], [1, 1]>) : !stencil.temp<[0,1]x[0,1]xtensor<510xf32>> to !stencil.field<[-1,1023]x[-1,511]xtensor<512xf32>>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
// CHECK-NEXT: }
Expand Down
6 changes: 3 additions & 3 deletions tests/filecheck/dialects/stencil/canonicalize.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func.func @dup_operand(%f : !stencil.field<[0,64]xf64>, %of1 : !stencil.field<[0
// CHECK-NEXT: %0 = stencil.access %one[0] : !stencil.temp<?xf64>
// CHECK-NEXT: stencil.return %0, %0 : f64, f64
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %o1 to %of1 (<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: stencil.store %o2 to %of2 (<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: stencil.store %o1 to %of1(<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: stencil.store %o2 to %of2(<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }

Expand All @@ -44,6 +44,6 @@ func.func @unused_res(%f1 : !stencil.field<[0,64]xf64>, %f2 : !stencil.field<[0,
// CHECK-NEXT: %0 = stencil.access %one[0] : !stencil.temp<?xf64>
// CHECK-NEXT: stencil.return %0 : f64
// CHECK-NEXT: }
// CHECK-NEXT: stencil.store %o1 to %of (<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: stencil.store %o1 to %of(<[0], [64]>) : !stencil.temp<?xf64> to !stencil.field<[0,64]xf64>
// CHECK-NEXT: func.return
// CHECK-NEXT: }
Loading

0 comments on commit d9dc196

Please sign in to comment.