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

Add support for tiling of linalg.generic operations #609

Merged
merged 16 commits into from
Mar 14, 2024
Merged

Conversation

andidr
Copy link
Contributor

@andidr andidr commented Nov 7, 2023

No description provided.

@andidr andidr force-pushed the andi/tiling branch 3 times, most recently from 60482c3 to 9c6fd08 Compare February 23, 2024 15:17
@andidr andidr force-pushed the andi/tiling branch 3 times, most recently from 0991f1c to bc65d30 Compare March 7, 2024 10:56
…on MacOS

The tests `end_to_end_leveled.jit.loop_dagmulti.mul_eint_10bits.0` and
`end_to_end_leveled.jit.loop_dagmulti.signed_mul_eint_10bits.0`
reproducibly fail on the mac2.metal instance used by the CI due to
insufficient memory. This change disables all instances of these tests
with 10 or more bits of precision on MacOS.
…ics passes

This makes the trip counts of operations in the TFHE statistics pass
as well as the per-location memory usage statistics in the memory
usage statistics pass optional. These values are unset if the trip
count could not be determined statically.
…r operations

This adds a new pass that converts `scf.forall` loops into nested
`scf.for` operations. The conversion carries parallel output tensors
from the original loop as dependencies through the loop nest and
replaces any occurrence of `tensor.parallel_insert_slice` operations
in the `scf.forall.in_parallel` terminator with equivalent
`tensor.insert_slice` operations.
…alect

This adds an invocation of the `SCFForallToSCFFor` pass to the
compilation pipeline before lowering to the LLVM dialect as a
sequential fallback path to future passes exploiting the parallelism
of `scf.forall` further up in the pipeline.
This adds support for the tiling of `linalg.generic` operations that
have only parallel iterators or only parallel iterators and a single
reduction dimension via the linalg tiling infrastructure (i.e.,
`mlir::linalg::tileToForallOpUsingTileSizes()` and
`mlir::linalg::tileReductionUsingForall()`).

This allows for the tiling of FHELinalg operations by first replacing
them with appropriate `linalg.generic` oeprations and then invoking
the tiling pass in the pipeline. In order for the tiling to take
place, tile sizes must be specified using the `tile-sizes` operation
attribute, either directly for `linalg.generic` operations or
indirectly for the FHELinalg operation, e.g.,

  "FHELinalg.matmul_eint_int"(%a, %b) { "tile-sizes" = [0, 0, 7] } : ...

Tiling of operations with a reduction dimension is currently limited
to tiling of the reduction dimension, i.e., the tile sizes for the
parallel dimensions must be zero.
@andidr andidr merged commit 97292ed into main Mar 14, 2024
26 checks passed
@andidr andidr deleted the andi/tiling branch March 14, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants