See the previous published edition.
Welcome to the seventh issue of the MLIR (bi)Weekly, a newsletter (published on Friday) 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!
- A new iterator allows to walk the operations in a region without recursing into nested regions
- NamedAttrList is a new wrapper around a vector of NamedAttributes that keeps track of whether the vector is sorted or not, making it more efficient to manipulate list of attributes.
- Unreachable code is now excused from meeting the SSA dominance requirement.
- Parsing is now performed in a single threaded context, to reduce unneeded synchronization overhead.
- The Loop dialect has been renamed to ‘SCF’
- CMake configuration options
-DLLVM_LINK_LLVM_DYLIB=ONnow results in a properly linked
libMLIR.so, which is useful for Linux distributions packaging.
- Compilation time of SPIR-V libraries was reduced by revisiting the auto-generated code and reducing it (templated functions for getting opcode of an SPIR-V operation and special casing the operand serialization code for the common case with no attributes).
Optimizations and Code Generation
- Identical blocks are now merged during canonicalization
- Affine.min and Affine.max can now be constant folded if only some inputs are constant.
- The standard dialect gained the “std.fptosi” operation, which can be lowered to LLVM and SPIRV.
- The Buffer Placement Pass is using the MemoryOpInterface to identify the operations allocating/deallocating memory, making it decoupled from the standard dialect operations and generically applicable.
- The Buffer Placement utility has been used to create a lowering pass to go from Linalg operations on tensors to operate on buffers.
- Loop unrolling support has been added for
- SPIR-V lowering now accounts for lowering loads/stores of smaller integer bitwidths not natively supported by the target environment, by emulating the smaller integer bitwidths with 32-bit integers.
- (De)serialization gains support for SPIR-V debug information, including variables and control flow ops.
- The Vulkan runtime dynamic library no longer depends on LLVM libraries. This avoids a symbol collision problem seen on Linux with Mesa Vulkan drivers, who also load LLVM dynamic libraries for shader compilation.
- An initial version of adding a complex number type and some related operations was added to the standard dialect, more operations are still added.
In the Ecosystem
IREE : An Experimental MLIR Execution Environment
- Continued progress on removing pipeline barriers by implementing timeline semaphores PR
- Additional HLO/std op coverage lowering to LLVM/SPIR-V (xla_hlo.toch_index_select, full support of xla_hlo.convert, new FPToSIOp, index_cast, emulated bitwidths in SPIR-V for i8/i16, tanh for LLVM)
- Additional TensorFlow op coverage/bug fixes (EmptyOp, InPlaceUpdate, ReverseV2, many folder/canonicalization impovements needed for optimizations)
- Starting work on LLVM-AOT backend (vs just jitting)
- Integrated the (fantastic) Tracy profiler to replace WTF and collected sufficient traces to scope work for optimizing ResNet inference
mlir-npcomp: Prototype for compiling numpy programs
- Sufficient numpy tracing to emit MLIR functions for python element-wise ops, np.dot, slices, np.transpose, and constant materialization (see samples)
- Created initial basicpy and numpy dialects
- Merged prototype TCF, TCP dialects.
- Extracted sufficient conversions from IREE, TensorFlow and elsewhere to have a (basic) e2e conversion path from TCP to LLVM.
- Near term goal continues to be an e2e scale model that we can use to design appropriate layerings for TCP and serving as a reference for interfacing to other similar frontends. Will present at an upcoming ODM once further in the curriculum to have ported all major concepts.