LLVM Discussion Forums

MLIR News, 7th edition (5/15/2020)

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!

Highlights

  • The mlir-npcomp project is iterating quickly on a prototype of what could lead to TCP upstream.

MLIR Core

Infrastructure

  • 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_BUILD_LLVM_DYLIB=ON and -DLLVM_LINK_LLVM_DYLIB=ON now 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

SPIR-V

  • 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.

Other

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.

Recent Talks

RISE: A Functional Pattern-based Dialect in MLIR (previously scheduled @ EuroLLVM)

1 Like