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

[ Make FLAGS_einsum_opt as default ] Einsum memory optimization #43397

Merged
merged 18 commits into from
Jun 14, 2022

Conversation

2742195759
Copy link
Contributor

@2742195759 2742195759 commented Jun 10, 2022

PR types

Others

PR changes

Others

Describe

Others

TODO:

  1. Remove FLAGS in next PR.
  2. Remove useless yaml einsum_grad.
  3. Change name to x_name in EinsumOpMaker.

@paddle-bot-old
Copy link

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@Shixiaowei02
Copy link
Contributor

@2742195759
Copy link
Contributor Author

f9f692be0cd3815ae9955f7516aacbc0 https://github.com/PaddlePaddle/Paddle/wiki/OP-Input-Output-Attribute-Compatibility-Modification 请确认下 dispensable 是否可以设为 true

对 vector tensor 类型的输出,我设置为 dispensable 的话,动态图自动代码生成的接口会有问题,没法传入size作为参数。这个PR我已经验证过了,可以兼容运行 v2.3.0 和 develop 分支导出的program。

@Shixiaowei02
Copy link
Contributor

f9f692be0cd3815ae9955f7516aacbc0 https://github.com/PaddlePaddle/Paddle/wiki/OP-Input-Output-Attribute-Compatibility-Modification 请确认下 dispensable 是否可以设为 true

对 vector tensor 类型的输出,我设置为 dispensable 的话,动态图自动代码生成的接口会有问题,没法传入size作为参数。这个PR我已经验证过了,可以兼容运行 v2.3.0 和 develop 分支导出的program。

@jiweibo 也确认下吧

ctx->SetOutputsDim(x_grad_name, ctx->GetInputsDim(x_name));
ctx->ShareAllLoD(x_name, x_grad_name);
ctx->SetOutputsDim(x_grad_name, ctx->GetInputsDim("Operands"));
ctx->ShareAllLoD("Operands", x_grad_name);
Copy link
Contributor

Choose a reason for hiding this comment

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

这里为什么不直接用 x_name 了?

#func : UnchangedMultiInferMeta
#param : [x]
#kernel :
#func : einsum_grad
Copy link
Contributor

Choose a reason for hiding this comment

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

这部分注释代码删掉吧

@jiweibo
Copy link
Contributor

jiweibo commented Jun 14, 2022

看起来,AsIntermediate 也能保证向后兼容
https://github.com/PaddlePaddle/Paddle/blob/develop/paddle/fluid/operators/reshape_op.cc#L505

f9f692be0cd3815ae9955f7516aacbc0 https://github.com/PaddlePaddle/Paddle/wiki/OP-Input-Output-Attribute-Compatibility-Modification 请确认下 dispensable 是否可以设为 true

对 vector tensor 类型的输出,我设置为 dispensable 的话,动态图自动代码生成的接口会有问题,没法传入size作为参数。这个PR我已经验证过了,可以兼容运行 v2.3.0 和 develop 分支导出的program。

@jiweibo 也确认下吧

@2742195759 2742195759 merged commit 83abec6 into PaddlePaddle:develop Jun 14, 2022
@2742195759 2742195759 deleted the einsum_memory_opt branch June 14, 2022 09:48
2742195759 added a commit to 2742195759/Paddle that referenced this pull request Jun 15, 2022
phlrain pushed a commit that referenced this pull request Jun 20, 2022
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.

None yet

4 participants