See the previous published edition.
Welcome to the twenty-fourth issue of the MLIR (bi)Weekly, a newsletter covering developments in MLIR, and related projects in the ecosystem. MLIR (bi)Weekly is brought to you by a collective effort of contributors, we welcome your contributions!
Highlights
- Twice daily, automated preview releases of the MLIR and IREE Python API binaries (for Linux, MacOS, and Windows) enabled, illustrating the potential for some nice cross-ecosystem interop (JAX+XLA+MHLO+IREE, MLIR+MHLO+IREE, TFLite+TOSA). Several quality of life issues surfaced that will be addressed over the next couple of weeks.
- On LLVM-dev: [RFC] Modernize CMake LLVM “Components”/libLLVM Facility](https://lists.llvm.org/pipermail/llvm-dev/2021-January/147567.html) (spun off from [Meeting Notes] MLIR Build/Install and Shared Libraries)
MLIR Core
Infrastructure
- mlir-opt can now run the pipeline described by a pass manager reproducer.
- Several methods on
OpState
(the base class of each derived Op type) have been marked as deprecated as they are simple forwards to the same method onOperation
.- Uses of these methods should use
operator->
/getOperation()
instead.
- Uses of these methods should use
- Passes can now override an
initialize(MLIRContext *context)
hook that allows for initializing complex/heavy state before a pass pipeline is run.- This is useful for situations like PDL, where there is a large upfront initialization cost that should only be incurred once and then shared across all copies of the pass.
Table-driven Infrastructure
- The
getType
method of single result operations now has a more concrete return type, e.g.IntegerType
instead ofType
. -
removeAttr
methods are now generated that allow for removing an attribute from an operation. - TypeDef instances can now specify builders similarly to operations.
Optimizations and Code Generation
- Vectorization was added to linalg-on-tensor operations
- The LLVM dialect saw the [addition of fast-math flags]((https://github.com/llvm/llvm-project/commit/c1d58c2b0023)
- The sparse compiler continues to make progress: [mlir][sparse] adjust output shape inference to new tensor abstraction · llvm/llvm-project@8b124c1 · GitHub
SPIR-V
- @george has been submitting an [RFC] Converting multi-threaded SPIR-V to LLVM dialect: overview
-
spv.SpecConstantOperation
is supported in serialization and deserialzation. - SPIR-V dialect gains two new trait:
UsableInSpecConstantOp
andUnsignedOp
. -
SPIRVOpLowering
is replaced byOpConversionPattern
to rely more on core dialect conversion framework. - More refactoring changes have landed to improve SPIR-V deserialization code structure and compilation speed.
Other
The Python bindings continue to get more additions:
In the Ecosystem
mlir-npcomp: Prototype for compiling numpy programs
- npcomp deleted its original Python API and switched to the upstream MLIR Python API developed to replace it.
CIRCT : Circuit IR Compilers and Tools aka ‘MLIR for hardware’
- Initial documentation for FIRRTL, RTL/SV, and Handshake Dialect was started.
- In the Weekly discussion meeting on January 6, 2021, Mike presented slides on the proposed NPComp to Static Hardware pipeline.
- Verilog Emitter pass for FIRRTL dialect was introduced. This new -emit-firrtl-verilog pass is a clone of the existing -emit-verilog pass with all the RTL/SV support stripped out.
- FIRRTLToRTL gets lowering for reg, reginit, mem, skip, dshlw ops, file boilerplate macros, and a few related issues (364, 366, 367, 355, 373) were fixed by Chris Lattner.
- Struct support for RTL introduced four new Ops named struct_explode, struct_create, struct_inject, struct_extract.
- rtl.merge op was added to RTL dialect which merges signals together as if connected by a wire.
Recent Talks
- The slides and videos for the 6th LLVM Compiler Infrastructure in HPC workshop are online, including @joker-eph’s keynote MLIR: an Agile Infrastructure for Building a Compiler Ecosystem (video / slides).
See also a few talks about ML applied to compilers, as well as Hal Finkel’s talk on Really Embedding Domain-Specific Languages into C++: is there a connection to MLIR here? Could we plug DSLs in C++ and lower them to MLIR inside Clang?