MLIR News, 64th edition (15th April 2024)

Welcome to the 64th 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 and Ecosystem:

  • Successful completion of Euro LLVM 2024 in Austria last week. Thanks to Tanya Lattner and the organizing committee for their efforts. Videos will be online soon - [accepted presentations].

  • Matthias added the BufferViewFlowOpInterface to the bufferization dialect. This interface can be implemented by ops that operate on buffers to indicate that a buffer op result and/or region entry block argument may be the same buffer as a buffer operand (or a view thereof). A series of improvements related to one-shot-bufferization have been added recently as well (see below).[buffer view op interface].

MLIR Commits Recently:

  • Diego Caballero, “The lowering of n-D vector.extract/insert ops to LLVM is not supported but if one of these accidentally reaches the vector-to-llvm conversion patterns, we end up with a kind of puzzling crash. This PR fixes that crash and gracefully bails out in those cases. [click here]”.

  • Rolf Morel added support for fusing two scf.for loops occurring in the same block.
    Uses the rudimentary checks already in place for scf.forall (like the target loop’s operands being dominated by the source loop). [click here].

  • Pablo Antonio Martinez added to Linalg-Tiling (transform dialect) - emit warning when tile_using_forall generates non thread safe code. [click here]. “It is the user’s responsibility to ensure that num_threads/tile_sizes is a valid tiling specification (i.e. that only tiles paralleldimensions, e.g. in the Linalg case). In other words, tiling a non-parallel dimension would generate code with data races which is not safe to parallelize!” [click here for diff].

  • A new public API to ValueBoundsOpInterface to compare values/dims. The new
    ValueBoundsOpInterface::compareAPI replaces and generalizesValueBoundsOpInterface::areEqual. Note: This commit refactors, generalizes and adds a public API for value/dim comparison. The comparison functionality itself was introduced in [#85895](https://github.com/llvm/llvm-project/pull/85895) and is already in use for analyzing scf.if. In the long term, this improvement will allow for a more powerful analysis of subset ops. A future commit will update areOverlappingSlices` to use the new comparison API. [click here].

  • This commit adds the BufferOriginAnalysis, which can be queried to
    check if two buffer SSA values originate from the same allocation. This
    new analysis is used in the buffer deallocation pass to fold away or
    simplify bufferization.dealloc ops more aggressively. [click here]. and [here].

  • This commit ports openxla/xla#10503 by @pearu. The new implementation matches mpmath’s results for most inputs, see caveats in the linked pull request. [click here],.

  • This commit adds the lower-vector-multi-reduction pass to lower the
    vector.multi_reduction operation. While the Transform Dialect includes an operation,
    transform.apply_patterns.vector.lower_multi_reduction, intended for a similar purpose, its utility is limited to projects that have adopted the Transform Dialect. Recognizing that not all projects are equipped to integrate this dialect, the proposed pass serves as a vital standalone alternative. It ensures that projects solely dependent on the traditional pass infrastructure can also benefit from the optimized lowering of multi_reduction operation. [click here].

  • Billy Zhu, " Following the discussion from [this thread], this PR adds support for recursive DITypes : (a) DIRecursiveTypeAttrInterface: An interface that DITypeAttrs can implement to indicate that it supports recursion. See full description in code.
    (b) Importer & exporter support (The only DITypeAttr that implements the interface is DICompositeTypeAttr, so the exporter is only implemented for composites too. There will be two methods that each llvm DI type that supports mutation needs to implement since there’s nothing general)." . [MLIR][LLVM] Support Recursive DITypes #80251. [click here].

  • This commit adds a ValueBoundsOpInterface implementation for arith.select. The implementation is almost identical to scf.if (#85895), but there is one special case: if the condition is a shaped value, the selection is applied element-wise and the result shape can be inferred from either operand. [click here].

  • Boian Petkantchin added implementation for Mesh’s ShardingInterface for Linalg ops. It allows linalg structured operations to be handled during spmdization and sharding propagation. There is only support for projected permutation indexing maps [click here].

Related Projects

Useful Links

3 Likes