Commit 030c1b2
committed
[mlir][PartialReductionTilingInterface] Add support for
Following up from #143467,
this PR adds support for
`ReductionTilingStrategy::PartialReductionOuterParallel` to
`tileUsingSCF`. The implementation of
`PartialReductionTilingInterface` for `Linalg` ops has been updated to
support this strategy as well. This makes the `tileUsingSCF` come on
par with `linalg::tileReductionUsingForall` which will be deprecated
subsequently.
Changes summary
- `PartialReductionTilingInterface` changes :
- `tileToPartialReduction` method needed to get the induction
variables of the generated tile loops. This was needed to keep the
generated code similar to `linalg::tileReductionUsingForall`,
specifically to create a simplified access for slicing the
intermediate partial results tensor when tiled in `num_threads` mode.
- `getPartialResultTilePosition` methods needs the induction
varialbes for the generated tile loops for the same reason above,
and also needs the `tilingStrategy` to be passed in to generate
correct code.
The tests in `transform-tile-reduction.mlir` testing the
`linalg::tileReductionUsingForall` have been moved over to test
`scf::tileUsingSCF` with
`ReductionTilingStrategy::PartialReductionOuterParallel`
strategy. Some of the test that were doing further cyclic distribution
of the transformed code from tiling are removed. Those seem like two
separate transformation that were merged into one. Ideally that would
need to happen when resolving the `scf.forall` rather than during
tiling.
Signed-off-by: MaheshRavishankar <[email protected]>ReductionTilingStrategy::PartialReductionOuterParallel in tileUsingSCF.1 parent 97e8266 commit 030c1b2
File tree
9 files changed
+535
-265
lines changed- mlir
- include/mlir
- Dialect
- Linalg/TransformOps
- Utils
- Interfaces
- lib/Dialect
- Linalg
- TransformOps
- Transforms
- SCF/Transforms
- Tensor/IR
- Utils
- test/Dialect/Linalg
9 files changed
+535
-265
lines changedLines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2019 | 2019 | | |
2020 | 2020 | | |
2021 | 2021 | | |
| 2022 | + | |
2022 | 2023 | | |
2023 | 2024 | | |
2024 | 2025 | | |
| |||
2036 | 2037 | | |
2037 | 2038 | | |
2038 | 2039 | | |
| 2040 | + | |
2039 | 2041 | | |
2040 | 2042 | | |
2041 | | - | |
2042 | | - | |
| 2043 | + | |
| 2044 | + | |
2043 | 2045 | | |
2044 | 2046 | | |
2045 | 2047 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
159 | | - | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
372 | 377 | | |
373 | 378 | | |
374 | 379 | | |
375 | 380 | | |
376 | 381 | | |
377 | 382 | | |
378 | | - | |
| 383 | + | |
379 | 384 | | |
380 | 385 | | |
381 | 386 | | |
382 | 387 | | |
383 | 388 | | |
384 | 389 | | |
385 | 390 | | |
386 | | - | |
| 391 | + | |
387 | 392 | | |
388 | 393 | | |
389 | 394 | | |
| |||
396 | 401 | | |
397 | 402 | | |
398 | 403 | | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
399 | 409 | | |
400 | 410 | | |
401 | 411 | | |
| |||
406 | 416 | | |
407 | 417 | | |
408 | 418 | | |
409 | | - | |
| 419 | + | |
| 420 | + | |
410 | 421 | | |
411 | 422 | | |
412 | 423 | | |
| |||
436 | 447 | | |
437 | 448 | | |
438 | 449 | | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
439 | 455 | | |
440 | 456 | | |
441 | 457 | | |
442 | 458 | | |
443 | 459 | | |
444 | 460 | | |
| 461 | + | |
445 | 462 | | |
446 | 463 | | |
447 | 464 | | |
| 465 | + | |
448 | 466 | | |
449 | 467 | | |
450 | 468 | | |
| |||
Lines changed: 30 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3022 | 3022 | | |
3023 | 3023 | | |
3024 | 3024 | | |
| 3025 | + | |
3025 | 3026 | | |
3026 | 3027 | | |
3027 | 3028 | | |
| |||
3036 | 3037 | | |
3037 | 3038 | | |
3038 | 3039 | | |
3039 | | - | |
3040 | | - | |
3041 | | - | |
3042 | | - | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
| 3051 | + | |
| 3052 | + | |
| 3053 | + | |
| 3054 | + | |
| 3055 | + | |
| 3056 | + | |
| 3057 | + | |
| 3058 | + | |
| 3059 | + | |
| 3060 | + | |
| 3061 | + | |
| 3062 | + | |
| 3063 | + | |
| 3064 | + | |
3043 | 3065 | | |
3044 | 3066 | | |
3045 | 3067 | | |
3046 | | - | |
3047 | 3068 | | |
3048 | 3069 | | |
| 3070 | + | |
| 3071 | + | |
3049 | 3072 | | |
3050 | 3073 | | |
3051 | | - | |
| 3074 | + | |
3052 | 3075 | | |
3053 | 3076 | | |
3054 | 3077 | | |
3055 | | - | |
| 3078 | + | |
3056 | 3079 | | |
3057 | 3080 | | |
3058 | 3081 | | |
| |||
0 commit comments