-
Notifications
You must be signed in to change notification settings - Fork 796
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 noncontiguous binary op #9986
Conversation
…dev_transpose_add
…dev_transpose_add
Code got formatted by CI. Please request CI again if you still want to have this PR merged. If the PR is from a forked repo, please download the patch files from the GitHub Actions web page and apply them locally. |
…eflow into dev_transpose_add
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/9986/ |
Speed stats:
|
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/9986/ |
Speed stats:
|
.Broadcast(user_op::OpArg("lhs", 0)) | ||
.Broadcast(user_op::OpArg("rhs", 0)) | ||
.Broadcast(user_op::OpArg("y", 0)) |
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.
.Broadcast(user_op::OpArg("lhs", 0)) | |
.Broadcast(user_op::OpArg("rhs", 0)) | |
.Broadcast(user_op::OpArg("y", 0)) | |
.Broadcast(user_op::OpArg("x", 0)) | |
.Broadcast(user_op::OpArg("y", 0)) | |
.Broadcast(user_op::OpArg("z", 0)) |
namespace oneflow { | ||
|
||
/*static*/ Maybe<void> NonContiguousBinaryOp::GetSbp(user_op::SbpContext* ctx) { | ||
ctx->NewBuilder() |
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.
加个注释,只支持B
ctx->SetOutputShape("y", 0, lhs); | ||
const bool inplace = ctx->Attr<bool>("inplace"); | ||
if (inplace) | ||
ctx->SetOutputStride("y", 0, ctx->InputStride("lhs", 0)); |
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.
最好加个花括号
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/9986/ |
Speed stats:
|
Speed stats:
|
2 similar comments
Speed stats:
|
Speed stats:
|
Speed stats:
|
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/9986/ |
Speed stats:
|
This PR now support the basic binary operation(+,-,*,/) when inputs is/are not contiguous.
for example,
The nsys results below [green box for this pr and red box for oneflow naive implementation] show that we can effectively omit the


ToContiguous
stages.However, transpose the last dim is not good supported now, we will make this better soon.