-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[LANG] Generalize compute to tensor region #1476
Conversation
@ZihengJiang can you first open an RFC issue discussing the proposal and designs, examples, then link to the PR? |
We have some operators based on tensor op, also we've done lots of testing for this api, could this be merged into master ASAP? @tqchen @ZihengJiang |
@ZihengJiang could you please fix cpp lint first? |
27dbfbe
to
f892571
Compare
# test_tensor_reduce() | ||
test_tensor_tensor_op() | ||
# test_tensor_scan() | ||
# test_scan_multi_out() |
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.
you need to enable these cases
src/op/tensor_op.cc
Outdated
|
||
Operation TensorOpNode::make(std::string name, | ||
std::string tag, | ||
Array<IterVar> axis, |
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.
const reference?
35bdd6e
to
1dfa7b4
Compare
f176f43
to
cf0134d
Compare
@were @yzhliu @merrymercy can you help review this PR ? |
include/tvm/operation.h
Outdated
@@ -182,6 +182,80 @@ class PlaceholderOpNode : public OperationNode { | |||
TVM_DECLARE_NODE_TYPE_INFO(PlaceholderOpNode, OperationNode); | |||
}; | |||
|
|||
class TensorComputeOpNode : public OperationNode { | |||
public: | |||
Array<IterVar> axis; |
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.
document the fields
include/tvm/operation.h
Outdated
v->Visit("reduce_axis", &reduce_axis); | ||
v->Visit("sch_ndim", &sch_ndim); |
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.
schedulable_ndim is fine,
include/tvm/operation.h
Outdated
@@ -186,12 +186,14 @@ class TensorComputeOpNode : public OperationNode { | |||
public: | |||
Array<IterVar> axis; |
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.
again, document each field
@@ -154,6 +155,7 @@ def intrin_func(ins, outs): | |||
|
|||
s = tvm.create_schedule(C.op) | |||
stmt = tvm.lower(s, [A, B, C], simple_mode=True) | |||
print(stmt) |
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.
remove print
Thanks @ZihengJiang @xqdan @yzhliu @zhiics this is now merged |
Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from others in the community.
Another way for tensor intrinsic