-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support MLIR (first e2e) #1088
Closed
Closed
Support MLIR (first e2e) #1088
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@tucan9389 let's review and merge this once the scenario works E2E. |
tucan9389
changed the title
Add empty data structure for MLIR graph
Support MLIR (first e2e)
Apr 30, 2023
Thanks for waiting. I made the first e2e code. Please review and find some missing parts.
How it work
Note
Done
TODO
Detail cases of constant expression dialect by dialect// syntax group 1: the case containing the value in the constant operation itself
// Standard Dialect (std)
%std_const_i32 = constant 42 : i32
%std_const_f32 = constant 3.14 : f32
%std_const_vec = constant dense<[1, 2, 3, 4]> : vector<4xi32>
// Affine Dialect (affine)
%affine_const_i32 = affine.constant 42 : i32
%affine_const_i64 = affine.constant 42 : i64
// SPIR-V Dialect (spirv)
%spirv_const_i32 = spirv.constant 42 : i32
%spirv_const_f32 = spirv.constant 3.14 : f32
// GPU Dialect (gpu)
%gpu_const_i32 = gpu.constant 42 : i32
%gpu_const_f32 = gpu.constant 3.14 : f32
// syntax group 2: the case specifying the value by attribute
// TensorFlow Dialect (tf)
%tf_const_i32 = "tf.Const"() {value = dense<42> : tensor<i32>} : () -> tensor<i32>
%tf_const_f32 = "tf.Const"() {value = dense<3.14> : tensor<f32>} : () -> tensor<f32>
%tf_const_vec = "tf.Const"() {value = dense<[1, 2, 3, 4]> : tensor<4xi32>} : () -> tensor<4xi32>
// TOSA Dialect (tosa)
%tosa_const_f32 = "tosa.const"() {value = dense<3.14> : tensor<f32>} : () -> tensor<f32>
%tosa_const_vec = "tosa.const"() {value = dense<[1, 2, 3, 4]> : tensor<4xi32>} : () -> tensor<4xi32>
// ONNX Dialect (onnx)
%onnx_const_i32 = "onnx.Constant"() {value = dense<42> : tensor<i32>} : () -> tensor<i32>
%onnx_const_vec = "onnx.Constant"() {value = dense<[1, 2, 3, 4]> : tensor<4xi32>} : () -> tensor<4xi32>
// XLA HLO Dialect (mhlo)
%mhlo_const_i32 = "mhlo.const"() {value = dense<42> : tensor<i32>} : () -> tensor<i32>
%mhlo_const_f32 = "mhlo.const"() {value = dense<3.14> : tensor<f32>} : () -> tensor<f32>
%mhlo_const_vec = "mhlo.const"() {value = dense<[1, 2, 3, 4]> : tensor<4xi32>} : () -> tensor<4xi32>
// syntax group 3: the case specifying with function call format
%llvm_const_i32 = llvm.mlir.constant(42 : i32) : i32
%llvm_const_f32 = llvm.mlir.constant(3.14 : f32) : f32
%llvm_const_vec = llvm.mlir.constant(dense<[1, 2, 3, 4]> : vector<4xi32>) : !llvm<"<4 x i32>">
Please comment if you have any questions or feedback. |
Open
lutzroeder
force-pushed
the
main
branch
2 times, most recently
from
May 6, 2023 02:04
998aad7
to
b92461c
Compare
tucan9389
force-pushed
the
main
branch
2 times, most recently
from
May 7, 2023 10:04
d9f2932
to
7fac327
Compare
lutzroeder
added a commit
that referenced
this pull request
May 7, 2023
lutzroeder
added a commit
that referenced
this pull request
May 7, 2023
lutzroeder
added a commit
that referenced
this pull request
May 7, 2023
lutzroeder
added a commit
that referenced
this pull request
May 8, 2023
lutzroeder
added a commit
that referenced
this pull request
May 8, 2023
lutzroeder
added a commit
that referenced
this pull request
May 8, 2023
lutzroeder
added a commit
that referenced
this pull request
May 8, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#1044
mlir.Graph
mlir.Parameter
mlir.Argument
mlir.Node
mlir.Attributes
mlir.Tensor
mlir.TensorType
mlir.TensorShape