-
Notifications
You must be signed in to change notification settings - Fork 17
[Dialect] [OneDNNGraph] Add onednn_graph ops for llama2 mlp #92
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
Conversation
21992a7
to
0781b4f
Compare
[SameOperandsAndResultElementType, InferTensorTypeAdaptor]> { | ||
let summary = [{ | ||
MatMul operation computes the product of two tensors with optional bias addition. | ||
}]; | ||
let description = [{ | ||
`https://oneapi-src.github.io/oneDNN/dev_guide_op_matmul.html` | ||
}]; | ||
|
||
let arguments = (ins OneDNNGraph_FloatTensor:$input_a, | ||
OneDNNGraph_FloatTensor:$input_b, | ||
Optional<OneDNNGraph_LogicalTensor>:$bias, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The optional bias here shall also be OneDNNGraph_FloatTensor
can you add some new ops in the test of |
https://github.com/intel/graph-compiler/blob/main/lib/gc/Dialect/OneDNNGraph/OneDNNGraphOps.cpp#L48 |
OP Lowering PR is WIP |
|
||
// CHECK-LABEL: @relu | ||
func.func @relu(%arg0: tensor<128x512xbf16>) -> tensor<128x512xbf16> { | ||
// CHECK: onednn_graph.relu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need these at all? What do they test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test for basic format, attrs, auto verify and canonicalize, etc. Similar to llvm-project/mlir/test/Dialect/Linalg/named-ops.mlir
Noted, added a TODO. Will fix this after issues resolved in lowering pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add llama2 mlp ops: sigmoid, type_cast, pow, mul, sub, div, reduce_sum, reduce_mean