MLIR News 71st Edition (3rd Nov 2024)

Welcome to the 71st issue of the MLIR Newsletter covering developments in MLIR, and related projects in the ecosystem. We welcome your contributions (contact: javed.absar@gmail.com). Click here to see previous editions.

Highlights, Discussions & RFCs

  • Renato initiated an [RFC] MLIR Project Charter and Restructuring – "In recent years we have discussed many changes to the MLIR infrastructure, dialects, conversions, representations, transforms and their future…We need to agree to a common charter, at both high level (what MLIR is and how it fulfils its purpose with lowest global cost) and low-level (dialect semantics and conversions, what does canonicalization means, type systems, etc). The proposed next steps are: (a) Reach a consensus in this RFC ; (b) Create a survey on dialects and gather feedback from all in the community; (c) Collect the survey’s results and publish a summary (End of Dec 2024); Create PRs with the proposed code move and ownership models after LLVM 20 branches off (End of Jan 2025) "

  • Another RFC by Renato on Op explosion in Linalg – “…move it out of OpDSL (Python, YAML), into ODS (table-gen, C++) so that we can common up implementation details (such as broadcast, transpose, quantize, loop order). …have a discussion on how to stop the op explosion and focus on a few operations that we agree is reasonable for such a core dialect?” [click here].

  • Matthias Springer put up an RFC for Merging 1:1 and 1:N Dialect Conversions – " There are currently two incompatible dialect conversion drivers is MLIR: the “default” driver and the 1:N dialect conversion driver . This RFC proposes: 1. Extending the default driver with full 1:N conversion support. 2. Deleting the 1:N driver". [click here for more information]

  • Maksim Levental has written an RFC: an incubator for language frontends (bindings)" The TL;DR can be gleaned from the presentation I gave at US LLVM Dev meeting just recently but basically there are a lot of language communities working to target MLIR and I think we should support them with first-class bindings."

  • [Question] How to raise `llvm` to `scf`? Or lower C code to `scf`?

  • Matthias Springer has been cleaning up code base to remove deprecated dialect-based bufferization and move everything to one-shot-buferizer.

MLIR Commits Recently:

  • Matthias added "support for bufferizing external functions that have no
    body. Such functions were previously rejected by One-Shot Bufferize if
    *they returned a tensor value. [click here].

  • Jakub added a fast walk-based pattern rewrite driver: walkAndApplyPatterns. It does not iterate until a fixpoint and does not perform folding or DCE. It should have much lower overhead than the greed pattern rewrite driver for simple pattern sets. [PR]

  • Lialan added VectorEmulateNarrowType to “support loading of unaligned vectors” [click here].

  • Andrzej split GenericPadOpVectorizationPattern into two patterns – "With this change, we gain the following: 1 a clear separation between pre-processing and vectorization transformations/stages; 2. a path to support masked vectorisation for tensor.insert_slice (with a dedicated pattern for vectorization, it is much easier to specify the input vector sizes used in masking); 3. more opportunities to vectorize tensor.insert_slice." [[click here]](Split GenericPadOpVectorizationPattern into two patterns).

  • This [commit] adds extra checks/assertions to the
    ConversionPatternRewriterImpl::notifyOpReplaced to improve its
    robustness. This change is in preparation of merging the 1:1 and 1:N dialect
    conversion drivers.

  • The 1:N type converter derived from the 1:1 type converter and extends it with 1:N target materializations. This [commit] merges the two type converters and stores 1:N target materializations in the 1:1 type converter. This is in preparation of merging the 1:1 and 1:N dialect conversion infrastructures.

  • [Commit] adds a canonicalization pattern for scf.forall that replaces constant induction variables with a constant index. There is a similar
    canonicalization that completely removes constant induction variables from the loop, but that pattern does not apply on foralls with mappings, so this one is necessary for those cases.

  • Shahid introduced transpose semantic to ‘linalg.matmul’ ops. [click here]. The main goal of this patch is to extend the semantic of ‘linalg.matmul’ named op to include per operand transpose semantic while also laying out a way to move ops definition from OpDSL to tablegen. Hence, it is implemented in tablegen.

Related Projects

Useful Links

2 Likes