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 workshop slides now available online - eurollvm24_mlir_workshop.zip - Google Drive.
-
Discussions around semantics of named-ops - theory (what it should be) and practice (what is currently implicitly implied via implementation) - Notes from the MLIR Upstream Round Table @ EuroLLVM 2024
-
Some interesting discussions around a new ‘stack’ dialect and its semantics and lowering. Franceso’s goal is - “Being able to convert to and from a stack-based language and MLIR’s SSA-based semantics… to be used to model stack-based languages, such as CIL, JVM and Ethereum bytecode”. [RFC] New `stack` dialect
-
Interesting discussions on On Improving Arm SME Lowering Resilience in MLIR
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 asmath.round(arg)
, Sqrt asmath.sqrt(arg)
, Rsqrt asmath.rsqrt(arg)
,
Square asmath.powf(arg, 2)
, * TanH asmath.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 ofPadOp
to take transform params and handles for thepad_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. Enableforeach_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 intoTestOpDefs.cpp
, moves format custom directive parsers and printers intoTestFormatUtils
, 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
- Triton community meeting - https://www.youtube.com/watch?v=uRlqolhNbRk
- IREE community meeting - https://www.youtube.com/watch?v=b779to--7es
- OpenXLA community meeting - https://www.youtube.com/watch?v=YK1CLzIcsJ8&t=2s
Useful Links