Skip to content
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

gen_bw_fn return maybe #5454

Merged
merged 36 commits into from Jul 17, 2021
Merged

gen_bw_fn return maybe #5454

merged 36 commits into from Jul 17, 2021

Conversation

liufengwei0103
Copy link
Contributor

@liufengwei0103 liufengwei0103 commented Jul 10, 2021

gen_bw_fn_return_maybe
该pr 依赖#5453 , 先合入

oneflow/user/ops/layer_norm_op.cpp里
"""
int64_t ShiftNegativeAxisIfNeed(const Shape& shape, int64_t axis) {
const int64_t shifted = axis < 0 ? axis + shape.NumAxes() : axis;
CHECK_GE(shifted, 0);
CHECK_LT(shifted, shape.NumAxes());
return shifted;
}
"""
暂未修改
因为SetGenBackwardOpConfFn, SetTensorDescInferFn同时会用到ShiftNegativeAxisIfNeed,SetTensorDescInferFn在后面的pr里。此处若将ShiftNegativeAxisIfNeed改为Maybe将会涉及,同时修改SetTensorDescInferFn。
ShiftNegativeAxisIfNeed后面统一修改。

luqiang-guo and others added 17 commits July 1, 2021 19:58
…neflow-inc/oneflow into OutputArgModifier_return_maybe_part_1

Conflicts:
	oneflow/core/operator/operator.cpp
Base automatically changed from input_arg_modifier_return_maybe to master July 15, 2021 17:20
…gen_bw_fn_return_maybe

Conflicts:
	oneflow/core/job/job_build_and_infer_ctx.cpp
	oneflow/core/job/job_builder.cpp
	oneflow/core/job/job_builder.h
	oneflow/core/job_rewriter/autograd.cpp
	oneflow/core/job_rewriter/autotick.cpp
	oneflow/core/operator/operator.cpp
	oneflow/user/ops/model_update_ops.cpp
…outside function resulting in JUST failed in lambda
@@ -72,8 +72,8 @@ Maybe<void> InferDataType4Matmul(user_op::InferContext* ctx) {
return Maybe<void>::Ok();
}

void GenBackwardOpConf4Matmul(const std::string& op_type_name, const user_op::UserOpWrapper& op,
user_op::AddOpFn AddOp) {
Maybe<void> GenBackwardOpConf4Matmul(const std::string& op_type_name,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他位置的maybe,未来会传播到这里,提前把这个函数改成maybe的了。目前这个函数内没有check。

@liufengwei0103 liufengwei0103 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 16, 2021 07:38
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 16, 2021 15:23
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 16, 2021 17:14
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 16, 2021 18:43
@oneflow-ci-bot oneflow-ci-bot self-requested a review July 16, 2021 21:44
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 16, 2021 23:03
@oneflow-ci-bot oneflow-ci-bot requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 17, 2021 00:24
@oneflow-ci-bot oneflow-ci-bot removed their request for review July 17, 2021 01:28
@liufengwei0103 liufengwei0103 requested review from oneflow-ci-bot and removed request for oneflow-ci-bot July 17, 2021 11:36
@oneflow-ci-bot oneflow-ci-bot merged commit de29655 into master Jul 17, 2021
@oneflow-ci-bot oneflow-ci-bot deleted the gen_bw_fn_return_maybe branch July 17, 2021 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants