MLIR News, 68th edition (16th July 2024)

Welcome to the 68th 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 & RFCs

MLIR Commits Recently:

  • Matthias implemented the BufferizableOpInterface for linalg.softmax. The op is not a LinalgOp, so it is not covered by the “catch all” LinalgOp interface implementation. [click here].

  • Javed added a new mlir-opt pass --linalg-specialize-generic-ops which lifts generic, where possible, to linalg named ops. Much like -linalg-generalize-named-ops lowers named ops to linalg.generic . [click here].

  • Hsiangkai Wang implemented Conv2D using Winograd Conv2D algorithm. The implementation is based on the paper, Fast Algorithm for
    Convolutional Neural Networks. ([1509.09308] Fast Algorithms for Convolutional Neural Networks). [click here].

  • srcarroll introduced pattern rewrites for reducing the rank of named
    linalg contraction ops with unit spatial dim(s) to other named
    contraction ops. For example linalg.batch_matmul with batch size 1 →
    linalg.matmul and linalg.matmul with unit LHS spatial dim →
    linalg.vecmat, etc.[click here].

  • Quinn Dawkins landed diff which allows bubbling tensor.pack through tensor.pad when the pad has multiple uses. A new pad is created and a tensor.unpack is inserted to connect the packed pad with the new users. To keep the previous behavior, the layout propagation control function
    can be modified to disallow multi-use propagation. [click here].

  • Crash fixed in vector.insert. The InsertOpConstantFolder had assumed that whenever the destination can be folded to a constant attribute, that attribute must be a DenseElementsAttr. That is not necessarily the case always. [click here].

  • Han-Chung added Switch to use OpOperand* in ControlPropagationFn. It’s not easy to determine whether we want to propagate pack/unpack ops
    because we don’t know the (producer, consumer) information. This
    revisions switches it to OpOperand*, so the control function can capture
    the (producer, consumer) pair. [click here].

  • Felix fixed crashes in parser on linalg ops without operands. [click here].

  • Simplify bare pointer handling. Before this commit, there used to be a workaround in the func.func/gpu.func op lowering when the bare-pointer calling convention is enabled. This workaround “patched up” the argument materializations for memref arguments. This can be done directly in the argument materialization functions (as the TODOs in the code base indicate). This commit effectively reverts back to the old implementation [click here].

  • Srcarroll refactored LoopFuseSiblingOp and support for parallel fusion. The patch refactors code related to LoopFuseSiblingOp transform in attempt to reduce duplicate common code. The aim is to refactor as much as possible to a functions on LoopLikeOpInterface. A full refactor will require more additions to the LoopLikeOpInterface. [click here].

  • Donald Chen fixed bufferize deallocation error in nested symbols. [click here].

  • Renato removed linalg matmul unsigned. According to Renato, this is the first PR in a list of many that will simplify the linalg operations by using similar attributes. [RFC] Transpose attribute for Linalg matmul operations

  • Cullen Rhodes added a new vector.step operation to Vector dialect [click here].

  • Matthias fixed bug in bufferization of elementwise ops. There is an optimization in One-Shot Bufferize wrt. ops that bufferize to elementwise access. A copy can sometimes be avoided. [click here].

  • This diff generalizes DropUnitDimFromElementwiseOps to support inner unit dimensions. [click here]

Related Projects

Useful Links

1 Like