MLIR News, 4th edition (4/3/2020)

Welcome to the fourth 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!

See the previous published edition .

Highlights

MLIR Core

Infrastructure

  • mlir-print-op-on-diagnostic defaults to true now (fix pr44830: this addresses a common user trap to think that the location printed along with the diagnostic is the same as the current operation that caused the error.
  • Pass Infrastructure Refactoring: CRTP is being removed from the Pass hierarchy, making the class interface much cleaner.
  • Dominance gets a new utility function to find the nearest common dominator of two given blocks.
  • The dialect conversion infrastructure now supports block creation in ConversionPatternRewriter.
  • Documentation cleanup:
    • Dialect documentation now contains information on assembly format, successors, regions, and saw an overall cleanup.
    • Passes.md now includes all of the registered passes in MLIR (though many are unfortunately missing detailed descriptions)
    • The documentation on canonicalization now discusses the different canonicalization mechanisms and how to use them.
    • The MLIR website now supports .md includes, which allows to mix static doc with generated one. For example the SPIR-V dialect static .md source includes the generated documentation for the operations to produce a unified online doc. Other dialects are entirely generated from the ODS definition.

Table-driven Infrastructure

  • A new declarative pass specification(i.e. tablegen backend) is being added. Several revisions are still inflight and should land early next week. Having a declarative description for the passes provides multiple benefits:
    • We can generate the pass documentation for the command line and for website or any other medium from the same source.
    • We can generate the registration for the passes and we won’t have any static global constructor to manage pass registration anymore (porting MLIR pass options mechanism to LLVM would make some users happy I think).
    • The pass options being declaratively defined allows to generate a base class for each pass, it reduces the boilerplate for the user.
  • ODS now supports variadic regions

Code Generation & Optimizations

SPIR-V

In the Ecosystem

IREE : An Experimental MLIR Execution Environment

  • A new website and roadmap is getting started!
  • Improved “getting started” documentation pages.
  • Compiling with dynamic shapes:
    • First e2e compile and run of a simple computation with dynamic shapes (from Python/numpy).
    • Implemented dynamic dim and rank from custom ops, allowing a TF/Keras LSTM to compile for the first time (has some minor runtime bugs still in the list module)
    • Concluded a lot of misc work to get shape types plumbed through everything for the VMLA path. Next need to apply to LLVM/SPIR-V backends.
    • Working on model by model triage to source further gaps.
  • IRModelBuilder llvm.matrix intrinsic based benchmark makes proper use of LLVM function attribute passthrough = [["prefer-vector-width", "512"]]. Brings 50% improvements on the 16^3 case on skylake-avx512.

Recent Talks