Skip to content
  1. Dec 02, 2020
  2. Nov 26, 2020
  3. Nov 25, 2020
    • Aart Bik's avatar
      [mlir][sparse] add parallelization strategies to sparse compiler · 5c4e397e
      Aart Bik authored
      This CL adds the ability to request different parallelization strategies
      for the generate code. Every "parallel" loop is a candidate, and converted
      to a parallel op if it is an actual for-loop (not a while) and the strategy
      allows dense/sparse outer/inner parallelization.
      
      This will connect directly with the work of @ezhulenev on parallel loops.
      
      Still TBD: vectorization strategy
      
      Reviewed By: penpornk
      
      Differential Revision: https://reviews.llvm.org/D91978
      5c4e397e
  4. Nov 24, 2020
  5. Nov 23, 2020
  6. Nov 21, 2020
  7. Nov 20, 2020
  8. Nov 19, 2020
  9. Nov 18, 2020
  10. Nov 17, 2020
  11. Nov 16, 2020
  12. Nov 14, 2020
  13. Nov 13, 2020
  14. Nov 12, 2020
    • Sean Silva's avatar
      [mlir] Bufferize tensor constant ops · faa66b1b
      Sean Silva authored
      We lower them to a std.global_memref (uniqued by constant value) + a
      std.get_global_memref to produce the corresponding memref value.
      This allows removing Linalg's somewhat hacky lowering of tensor
      constants, now that std properly supports this.
      
      Differential Revision: https://reviews.llvm.org/D91306
      faa66b1b
    • Sean Silva's avatar
      [mlir] Fix subtensor_insert bufferization. · ad2f9f67
      Sean Silva authored
      It was incorrect in the presence of a tensor argument with multiple
      uses.
      
      The bufferization of subtensor_insert was writing into a converted
      memref operand, but there is no guarantee that the converted memref for
      that operand is safe to write into. In this case, the same converted
      memref is written to in-place by the subtensor_insert bufferization,
      violating the tensor-level semantics.
      
      I left some comments in a TODO about ways forward on this. I will be
      working actively on this problem in the coming days.
      
      Differential Revision: https://reviews.llvm.org/D91371
      ad2f9f67
    • MaheshRavishankar's avatar
      [mlir][Linalg] Improve the logic to perform tile and fuse with better dependence tracking. · 5ca20851
      MaheshRavishankar authored
      This change does two main things
      1) An operation might have multiple dependences to the same
         producer. Not tracking them correctly can result in incorrect code
         generation with fusion. To rectify this the dependence tracking
         needs to also have the operand number in the consumer.
      2) Improve the logic used to find the fused loops making it easier to
         follow. The only constraint for fusion is that linalg ops (on
         buffers) have update semantics for the result. Fusion should be
         such that only one iteration of the fused loop (which is also a
         tiled loop) must touch only one (disjoint) tile of the output. This
         could be relaxed by allowing for recomputation that is the default
         when oeprands are tensors, or can be made legal with promotion of
         the fused view (in future).
      
      Differential Revision: https://reviews.llvm.org/D90579
      5ca20851
    • Aart Bik's avatar
      [mlir][sparse] integrate sparse annotation into generic linalg op · e1dbc25e
      Aart Bik authored
      This CL integrates the new sparse annotations (hereto merely added as fully
      transparent attributes) more tightly to the generic linalg op in order to add
      verification of the annotations' consistency as well as to make make other
      passes more aware of their presence (in the long run, rewriting rules must
      preserve the integrity of the annotations).
      
      Reviewed By: nicolasvasilache
      
      Differential Revision: https://reviews.llvm.org/D91224
      e1dbc25e
  15. Nov 10, 2020
    • Sean Silva's avatar
      [mlir] Add pass to convert elementwise ops to linalg. · 53a0d45d
      Sean Silva authored
      This patch converts elementwise ops on tensors to linalg.generic ops
      with the same elementwise op in the payload (except rewritten to
      operate on scalars, obviously). This is a great form for later fusion to
      clean up.
      
      E.g.
      
      ```
      // Compute: %arg0 + %arg1 - %arg2
      func @f(%arg0: tensor<?xf32>, %arg1: tensor<?xf32>, %arg2: tensor<?xf32>) -> tensor<?xf32> {
        %0 = addf %arg0, %arg1 : tensor<?xf32>
        %1 = subf %0, %arg2 : tensor<?xf32>
        return %1 : tensor<?xf32>
      }
      ```
      
      Running this through
      `mlir-opt -convert-std-to-linalg -linalg-fusion-for-tensor-ops` we get:
      
      ```
      func @f(%arg0: tensor<?xf32>, %arg1: tensor<?xf32>, %arg2: tensor<?xf32>) -> tensor<?xf32> {
        %0 = linalg.generic {indexing_maps = [#map0, #map0, #map0, #map0], iterator_types = ["parallel"]} ins(%arg0, %arg1, %arg2 : tensor<?xf32>, tensor<?xf32>, tensor<?xf32>) {
        ^bb0(%arg3: f32, %arg4: f32, %arg5: f32):  // no predecessors
          %1 = addf %arg3, %arg4 : f32
          %2 = subf %1, %arg5 : f32
          linalg.yield %2 : f32
        } -> tensor<?xf32>
        return %0 : tensor<?xf32>
      }
      ```
      
      So the elementwise ops on tensors have nicely collapsed into a single
      linalg.generic, which is the form we want for further transformations.
      
      Differential Revision: https://reviews.llvm.org/D90354
      53a0d45d
  16. Nov 09, 2020
  17. Nov 06, 2020
  18. Nov 05, 2020
    • Nicolas Vasilache's avatar
      [mlir][Linalg] Side effects interface for Linalg ops · ecca7852
      Nicolas Vasilache authored
      The LinalgDependenceGraph and alias analysis provide the necessary analysis for the Linalg fusion on buffers case.
      
      However this is not enough for linalg on tensors which require proper memory effects to play nicely with DCE and other transformations.
      This revision adds side effects to Linalg ops that were previously missing and has 2 consequences:
      1. one example in the copy removal pass now fails since the linalg.generic op has side effects and the pass does not perform alias analysis / distinguish between reads and writes.
      2. a few examples in fusion-tensor.mlir need to return the resulting tensor otherwise DCE automatically kicks in as part of greedy pattern application.
      
      Differential Revision: https://reviews.llvm.org/D90762
      ecca7852
Loading