MLIR News, 65th edition (7th May 2024)

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

MLIR Commits Recently:

  • Jeremy Kun added a few basic polynomial ops (to Polynomial Dialect) e.g. monomial_mul, monomial (useful for lowering mul to standard MLIR) from_tensor, to_tensor, constant – [click here].

  • Alex introduced a new Transform dialect extension that uses IRDL op definitions as matcher descriptors. IRDL allows one to essentially define additional op constraits to be verified and, unlike PDL, does not assume rewriting will happen. Leverage IRDL verification capability to filter out ops that match an IRDL definition without actually registering the corresponding operation with the system – [click here].

  • Matthias Gehre, AMD, " We use PDLL a lot for pattern matching.One of the use cases is matching parts of the IR into hand-optimized kernels and configuring them appropriately. We are generally happy with its precise language and we have made heavy use of defining our own native constraints/rewrites to extend the capabilities of the language. …We propose to add arithmetic, logical and comparison operators with their usual representation into PDLL" [RFC] Add arithmetic, logical and comparison expressions into PDLL

  • Renato added a few more named-linalg-ops “all with the agreed semantics at the round table: no implicit broadcast/type cast” – : Reciprocal as arith.div(1,arg), Round as math.round(arg), Sqrt as math.sqrt(arg), Rsqrt as math.rsqrt(arg),
    Square as math.powf(arg, 2), * TanH as math.tanh(arg)[click here].

  • “This patch is a first pass at making consistent syntax across the LinalgTransformOps that use dynamic index lists for size parameters. Previously, there were two different forms: inline types in the list, or place them in the functional style tuple. This patch goes for the latter.” – [click here].

  • Rafael fixed an invalid behavior in pass --buffer-loop-hoisting. The pass is in charge of extracting buffer allocations (e.g., memref.alloca) from loop regions (e.g., scf.for) when possible. This works OK for looks with sequential execution
    semantics. However, a buffer allocated in the body of a parallel loop may be concurrently accessed by multiple thread to store its local data. Extracting such buffer from the loop causes all threads to wrongly share the same memory region.
    [click here]

  • ExtractStridedMetadataOpCollapseShapeFolder --This PR adds a new pattern to the set of patterns used to resolve the offset, sizes and stride of a memref. Similar to ExtractStridedMetadataOpSubviewFolder, the new pattern resolves strided_metadata(collapse_shape) directly, without introduce a reshape_cast op. – [click here].

  • Parsing support for floating point types was missing a few features: (1). Parsing floating point attributes from integer literals was supported only for types with bitwidth smaller or equal to 64. (2). Downstream users could not use AsmParser::parseFloat to parse float types which are printed as integer literals. [MLIR] fix _f64ElementsAttr in ir.py (#91176) · llvm/llvm-project@10ec0d2 · GitHub

  • Support added for transform.param pad multiples in PadOp (#90755) This patch modifies the definition of PadOp to take transform params and handles for the pad_to_multiple_of operand.

  • A. Varma added canonicalization pattern to fold away iter args of scf.forall if – a. The corresponding tied result has no use. b. It is not being modified within the loop. (#90189)

  • Alex added changes to make transform.foreach_match forward arguments – “It may be useful to have access to additional handles or parameters when performing matches and actions in foreach_match, for example, to parameterize the matcher by rank or restrict it in a non-trivial way. Enable foreach_match to forward additional handles from operands to matcher symbols and from action symbols to results.” – [click here]

  • “For all means and purposes llvm.mlir.addressof acts like a constant, and should be treated as such by passes. In particular, the operation should
    be propagated rather than passed whenever possible”, – [click here].

  • Mathias added more documentation for on-shot bufferizer – [click here].

  • Prashant Kumar enabled vectorization of unpack op in the case of unknown vector size. – [click here]

  • Ryan added runtime verification for linalg ops – [click here]]([mlir][linalg] Add runtime verification for linalg ops by ryan-holt-1 · Pull Request #89342 · llvm/llvm-project · GitHub).

  • Jeff, “this PR massively reorganizes the Test dialect’s source files. It moves
    manually-written op hooks into TestOpDefs.cpp, moves format custom directive parsers and printers into TestFormatUtils, adds missing comment blocks, and moves around where generated source files are included for types, attributes, enums, etc. into their own source file. This will hopefully help navigate the test dialect source code, but also speeds up compile time of the test dialect by putting generated source files into separate compilation units. This also sets up the test dialect to shard its op definitions, done in the next PR.” – [click here].

Related Projects

Useful Links

4 Likes