1. 16 Aug, 2019 1 commit
  2. 15 Aug, 2019 2 commits
  3. 14 Aug, 2019 2 commits
    • Diego Caballero's avatar
      [MLIR] Enable LLVM vectorization by initializing TTI (#3424) · 79283e3e
      Diego Caballero authored
      * [MLIR] Bump MLIR repo to commit c636f12, 08/09/2019
      
      MLIR Commit:
      commit c636f127ee412ef7279ec0d550f42740824cd9ea
      Author: Alex Zinenko <zinenko@google.com>
      Date:   Fri Aug 9 08:59:45 2019 -0700
      
          LLVM dialect and translation: support global strings
      
      LLVM Commit:
      commit c636f127ee412ef7279ec0d550f42740824cd9ea
      Author: Alex Zinenko <zinenko@google.com>
      Date:   Fri Aug 9 08:59:45 2019 -0700
      
          LLVM dialect and translation: support global strings
      
      * [MLIR] Set optimization level for LLVM optimizer and codegen
      
      Now both LLVM optimizer and codegen are aligned with
      "NGRAPH_MLIR_OPT_LEVEL" macro.
      
      * [MLIR] Enable LLVM vectorization by initializing TTI
      
      This is the final piece to enable LLVM vectorization for MLIR compiler.
      The PR refactors the creation of a target machine in MLIRCompiler so that
      we can use it to initialize TargetTransformInfo with the proper host
      features and LLVM Loop Vectorizer can get the right vector register
      information of the target CPU.
      79283e3e
    • Nagy Mostafa's avatar
      Enable floating point relu (#3436) · 17f6e08c
      Nagy Mostafa authored
      17f6e08c
  4. 13 Aug, 2019 1 commit
  5. 10 Aug, 2019 1 commit
    • Diego Caballero's avatar
      [MLIR] Bump MLIR repo to commit c636f12, 08/09/2019 (#3422) · c101dcce
      Diego Caballero authored
      MLIR Commit:
      commit c636f127ee412ef7279ec0d550f42740824cd9ea
      Author: Alex Zinenko <zinenko@google.com>
      Date:   Fri Aug 9 08:59:45 2019 -0700
      
          LLVM dialect and translation: support global strings
      
      LLVM Commit:
      commit c636f127ee412ef7279ec0d550f42740824cd9ea
      Author: Alex Zinenko <zinenko@google.com>
      Date:   Fri Aug 9 08:59:45 2019 -0700
      
          LLVM dialect and translation: support global strings
      c101dcce
  6. 09 Aug, 2019 2 commits
    • Nishant Patel's avatar
      [MLIR] Add unary op -- Negative (#3391) · 0273b716
      Nishant Patel authored
      * Add negative op
      
      * Add test case
      
      * Address feedback
      
      * Merge master
      
      * Consolidate to one routine for unary ops
      
      * Change from Negative to Neg
      0273b716
    • Diego Caballero's avatar
      [MLIR] Enable affine loop tiling (#3397) · 14624c03
      Diego Caballero authored
      * [MLIR] Enable affine loop tiling
      
      This PR enables loop tiling optimization in affine dialect. It
      introduces the following flags for configuration.
        - affine-loop-tile: enables/disables the optimization. Disabled by
          default.
        - loop-tile-cache-level: provides the cache level to which apply loop
          tiling to. Cache level size is obtained from LLVM's TTI.
        - loop-tile-cache-size: provides a cache level size that overrides
          cache information from TTI.
      
      The current use of TTI is a bit hacky since we have to pass a fake
      LLVM's function to make it work. However, this should be enough to get
      some basic target information until we have a target model in MLIR or
      find a better approach.
      
      * Address feedback
      
      * Rename flags
      14624c03
  7. 07 Aug, 2019 1 commit
  8. 01 Aug, 2019 1 commit
  9. 31 Jul, 2019 1 commit
  10. 30 Jul, 2019 1 commit
    • Diego Caballero's avatar
      [MLIR] Bump MLIR repo to commit 26c683c, 07/29/2019. (#3310) · 81597f3a
      Diego Caballero authored
      * [MLIR] Bump MLIR repo to commit 59167c2, 07/25/2019.
      
      MLIR commit:
      Author: River Riddle <riverriddle@google.com>
      Date:   Wed Jul 24 16:41:11 2019 -0700
      
          NFC: Use ValueOfRange instead of T in Diagnostic::appendRange.
      
              For iterator_range, T is often the name of another iterator type
              and not the the value of the range.
      
      LLVM commit:
      Author: Marshall Clow <mclow.lists@gmail.com>
      Date:   Thu Jul 25 03:26:05 2019 +0000
      
          Implement change #4 of P1466: Change weekday to accept both 0 and 7
          as Sunday. Add accessors 'c_encoding' and 'iso_encoding' to provide
          different interpretations of the weekday. Remove 'operator unsigned'
      
      * style
      
      * Move MLIR/LLVM repos a bit more forward
      81597f3a
  11. 29 Jul, 2019 2 commits
    • Diego Caballero's avatar
      [MLIR] Enable affine dialect loop fusion (#3290) · aedd8c2e
      Diego Caballero authored
      * [MLIR] Enable affine dialect loop fusion
      
      Enable affine dialect loop fusion in nGraph pipeline. It also adds an
      opt flag to enable/disable it when ngraph-opt is in place. Fusion seems
      to work for simple cases. It wasn't able to fuse dot + add, though, at
      least in my test case. One example that worked:
      
      Input:
        %6 = alloc() : memref<2500x2500xf32>
        affine.for %i3 = 0 to 2500 {
          affine.for %i4 = 0 to 2500 {
            %7 = load %arg0[%i3, %i4] : memref<2500x2500xf32>
            %8 = load %0[%i3, %i4] : memref<2500x2500xf32>
            %9 = addf %8, %7 : f32
            store %9, %6[%i3, %i4] : memref<2500x2500xf32>
          }
        }
        %10 = alloc() : memref<2500x2500xf32>
        affine.for %i5 = 0 to 2500 {
          affine.for %i6 = 0 to 2500 {
            %11 = load %arg2[%i5, %i6] : memref<2500x2500xf32>
            %12 = load %0[%i5, %i6] : memref<2500x2500xf32>
            %13 = addf %12, %11 : f32
            store %13, %10[%i5, %i6] : memref<2500x2500xf32>
          }
        }
        %14 = alloc() : memref<2500x2500xf32>
        affine.for %i7 = 0 to 2500 {
          affine.for %i8 = 0 to 2500 {
            %15 = load %10[%i7, %i8] : memref<2500x2500xf32>
            %16 = load %6[%i7, %i8] : memref<2500x2500xf32>
            %17 = addf %16, %15 : f32
            store %17, %14[%i7, %i8] : memref<2500x2500xf32>
          }
        }
      
      Output:
        %8 = alloc() : memref<2500x2500xf32>
        affine.for %i3 = 0 to 2500 {
          affine.for %i4 = 0 to 2500 {
            %9 = load %arg2[%i3, %i4] : memref<2500x2500xf32>
            %10 = load %2[%i3, %i4] : memref<2500x2500xf32>
            %11 = addf %10, %9 : f32
            %12 = affine.apply #map2(%i3, %i4, %i3, %i4)
            %13 = affine.apply #map3(%i3, %i4, %i3, %i4)
            store %11, %0[%12, %13] : memref<1x1xf32>
            %14 = load %arg0[%i3, %i4] : memref<2500x2500xf32>
            %15 = load %2[%i3, %i4] : memref<2500x2500xf32>
            %16 = addf %15, %14 : f32
            %17 = affine.apply #map2(%i3, %i4, %i3, %i4)
            %18 = affine.apply #map3(%i3, %i4, %i3, %i4)
            store %16, %1[%17, %18] : memref<1x1xf32>
            %19 = affine.apply #map2(%i3, %i4, %i3, %i4)
            %20 = affine.apply #map3(%i3, %i4, %i3, %i4)
            %21 = load %0[%19, %20] : memref<1x1xf32>
            %22 = affine.apply #map2(%i3, %i4, %i3, %i4)
            %23 = affine.apply #map3(%i3, %i4, %i3, %i4)
            %24 = load %1[%22, %23] : memref<1x1xf32>
            %25 = addf %24, %21 : f32
            store %25, %8[%i3, %i4] : memref<2500x2500xf32>
          }
        }
      
      * Rename MLIR_LLVM_OPTIONS to NGRAPH_MLIR_OPTIONS
      
      Something like this works now:
      NGRAPH_MLIR_OPTIONS="--enable-affine-loop-fusion=false"
      
      * Disable loop fusion by default and fix typo
      aedd8c2e
    • nmostafa's avatar
      Fix bad merge on 2 MLIR changes · c4dfca3b
      nmostafa authored
      c4dfca3b
  12. 26 Jul, 2019 4 commits
  13. 25 Jul, 2019 1 commit
    • Diego Caballero's avatar
      [MLIR] Fix naming convention in MLIR files (#3292) · a095c587
      Diego Caballero authored
      * [MLIR] Fix naming convention in MLIR files
      
      Add naming convention note per file to state which files should use
      nGraph naming convention and which MLIR naming convention and align
      naming convention in those files with such a note.
      
      * Remove m-prefix
      a095c587
  14. 24 Jul, 2019 3 commits
  15. 23 Jul, 2019 4 commits
  16. 22 Jul, 2019 1 commit
  17. 20 Jul, 2019 2 commits
  18. 19 Jul, 2019 1 commit
  19. 18 Jul, 2019 2 commits
    • nmostafa's avatar
      Refactor ng dialect compile · 3a9de1bb
      nmostafa authored
      3a9de1bb
    • Adam Procter's avatar
      [MLIR] Concat (#3225) · c5b976c8
      Adam Procter authored
      * WIP
      
      * All but two unit tests passing
      
      * Explanatory comment
      
      * Cleanup
      
      * A bit of cleanup stemming from review comments
      
      * Rewrite to use LoopNestBuilder
      
      * Remove unnecessary check from CompiledKernel
      
      * Removed some dead-ish code I missed
      
      * Switch to camelCase in lowerer.cpp
      
      * Fix assignment of resIndexHandles that was triggering an assert
      
      * Add in some safety checks
      
      * dyn_cast -> cast
      c5b976c8
  20. 17 Jul, 2019 3 commits
    • Diego Caballero's avatar
      [MLIR] Add llvm.noalias attribute to nGraph func args (#3232) · ac8e22d9
      Diego Caballero authored
      Aliasing prevents vectorization and other optimizations in LLVM (dot2d,
      for example). I found that LLVM dialect contemplates the possibility of
      previous dialects adding llvm.noalias attribute to function arguments so
      that the NoAlias attribute is generated in LLVM-IR. This should be good for
      now although we should discuss how to model this in Standard dialect and co.
      ac8e22d9
    • Pruthvi's avatar
      - MLIR Binary ElementWise Op (#3223) · 073db8fb
      Pruthvi authored
      * - templatize computing binary elementwise
      - added lowering support for Add, Sub, Multiply, Divide
      
      * - Added Support for Greater and less Op
      
      * -Add support for Minimum and Maximum
      
      * use edsc::intrinsics::select instead of terenary operator
      
      * Addressed PR comments
      
      * - return after the conditional check
      073db8fb
    • Nagy Mostafa's avatar
      [MLIR] Fix incorrect callback lookup (#3233) · 9b748d2c
      Nagy Mostafa authored
      * Fix incorrect callback lookup
      
      * Use std.AllocOp(malloc) for static tensor allocations
      
      * Clean up
      
      * revert getCallDecl change
      
      * style
      9b748d2c
  21. 16 Jul, 2019 1 commit
  22. 11 Jul, 2019 2 commits
    • Nagy Mostafa's avatar
      [MLIR] Add sub-graph extraction support (#3101) · f4b487a4
      Nagy Mostafa authored
      * Initial sub-graph extraction
      
      * Works without detaching input edges from sub-graph
      
      * Added removing input edges to graph
      
      * Works with whole func sub-graphs. Inputs edges to sub-graph are still there
      
      * Works on 2 exclusive sub-graphs. Still not on merged sub-graphs
      
      * Revert removing inputs to sub-graph. nGraph validation crashes
      
      * Added 3 sub-graph test. Remove compiled_kernel fusion pass. Comments
      
      * Revert some changes
      
      * Added cycle detection. Removed unit-tests to backend_mlir.in.cpp. Still not fully functional
      
      * Construct CK nodes after finding outputs to preserve the graph.
      
      * Fix topological sort. UTs pass.
      
      * Minor fixes
      
      * PR fixes
      
      * Enable mlir tests only when building with MLIR on
      f4b487a4
    • Nagy Mostafa's avatar
      [MLIR] Support MLIR lowering of Relu (#3197) · d1af0bb7
      Nagy Mostafa authored
      * Support MLIR lowering of Relu
      
      * Use EDSC comparison
      
      * style-apply
      
      * Use .inc file for Conversion classes list
      
      * Disable i32 Relu for plaidml
      d1af0bb7
  23. 02 Jul, 2019 1 commit