Skip to content

Conversation

dzhwinter
Copy link
Contributor

@dzhwinter dzhwinter commented May 15, 2018

  • add reused attribute to OpProto.
  • change the related operator to use inplace attribute.

AddInput("X", "(vector<Tensor>) The input tensors of sum operator.")
.AsDuplicable();
AddOutput("Out", "(Tensor) The output tensor of sum operator.");
AddOutput("Out", "(Tensor) The output tensor of sum operator.").Reuse("X");
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this case, Out should reuse the first Tensor memory of X(vector ), but we didn't have the sub-variable name of X.

@dzhwinter dzhwinter changed the title Feature/inplace attr add inplace attribute to op_proto_maker May 17, 2018
@tonyyang-svail
Copy link

The test only covers OpMaker, please add a runtime test for this feature.

@tonyyang-svail
Copy link

there are already a bunch of in_place field on the python side. Not sure how to make them work together...

@dzhwinter
Copy link
Contributor Author

Have discussed this issue with @tonyyang-svail , we will move the in-place attribute into the ssa-graph framework. This PR is add an inplace attribute for every Operator in Python-side.

AddOutput("Moment2Out", "(Tensor) Output second moment");
AddOutput("ParamOut", "(Tensor) Output parameter").Reuse("Param");
AddOutput("Moment1Out", "(Tensor) Output first moment").Reuse("Moment1");
AddOutput("Moment2Out", "(Tensor) Output second moment").Reuse("Moment2");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is Moment2Out forced share memory with Moment2?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's not forced, is a suggestion will be get in memory optimizer in Python.

@dzhwinter dzhwinter merged commit bfa3fd6 into PaddlePaddle:develop Jun 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants