Code Monkey home page Code Monkey logo

Comments (2)

flaub avatar flaub commented on August 24, 2024

pmlc-jit can only operate on .mlir code that has been lowered to the LLVM dialect. So you'd need to run the entire pipeline before you can run pmlc-jit.

from plaidml.

alannair avatar alannair commented on August 24, 2024

Thank you for the response.
Could you, however, expand on it a little bit?
Based on my understanding, the 4-stage pipeline should be run on adding the pass --target-llvm-cpu
So I ran the above test as
pmlc-opt -split-input-file -x86-reorder-layouts -cse -convert-linalg-to-llvm -target-llvm_cpu reorder_layouts.mlir
and I get the following error [1], even though the source [2] uses linalg.yield .

I found a possibly relevant LLVM forum post which seems to suggest that linalg.generic does not properly lower to a library call.
If that is the case, then does that mean there is no way I can get pmlc/target/x86/tests/reorder_layouts.mlir lowered to LLVM dialect ?


[1] Error :

within split at pmlc/target/x86/tests/reorder_layouts.mlir:1 offset :27:8: error: 'linalg.generic' op expects regions to end with 'linalg.yield', found 'llvm.return'
  %2 = linalg.generic {
       ^
within split at pmlc/target/x86/tests/reorder_layouts.mlir:1 offset :27:8: note: see current operation: %8 = "linalg.generic"(%4, %6, %7) ( {
^bb0(%arg3: f32, %arg4: f32, %arg5: f32):  // no predecessors
  %12 = "std.mulf"(%arg3, %arg4) : (f32, f32) -> f32
  %13 = "std.addf"(%arg5, %12) : (f32, f32) -> f32
  "llvm.return"(%13) : (f32) -> ()
}) {indexing_maps = [affine_map<(d0, d1, d2, d3, d4, d5, d6, d7, d8) -> (d0, d8, d1 + d4, d2 + d5, d6)>, affine_map<(d0, d1, d2, d3, d4, d5, d6, d7, d8) -> (d8, d7, d4, d5, d6, d3)>, affine_map<(d0, d1, d2, d3, d4, d5, d6, d7, d8) -> (d0, d7, d1, d2, d3)>], iterator_types = ["parallel", "parallel", "parallel", "parallel", "reduction", "reduction", "reduction", "parallel", "reduction"], operand_segment_sizes = dense<[2, 1]> : vector<2xi32>} : (tensor<1x4x56x56x16xf32>, tensor<4x4x1x1x16x16xf32>, tensor<1x4x56x56x16xf32>) -> tensor<1x4x56x56x16xf32>
within split at pmlc/target/x86/tests/reorder_layouts.mlir:1 offset :27:8: note: in custom textual format, the absence of terminator implies 'linalg.yield'

[2] Source corresponding to error:

%2 = linalg.generic {
    indexing_maps = [#input, #filter, #output],
    iterator_types = ["parallel", "parallel", "parallel", "parallel", "reduction", "reduction", "reduction"]
  } ins(%arg0, %arg1 : tensor<1x56x56x64xf32>, tensor<1x1x64x64xf32>) outs(%1 : tensor<1x56x56x64xf32>) {
  ^bb0(%arg3: f32, %arg4: f32, %arg5: f32):  // no predecessors
    %5 = mulf %arg3, %arg4 : f32
    %6 = addf %arg5, %5 : f32
    linalg.yield %6 : f32
  } -> tensor<1x56x56x64xf32>

from plaidml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.