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

[cherry-pick] Optimize performance of dygraph (#42196) #42329

Merged
merged 2 commits into from
Apr 28, 2022

Conversation

zyfncg
Copy link
Contributor

@zyfncg zyfncg commented Apr 27, 2022

PR types

Performance optimization

PR changes

Others

Describe

动态图调度性能优化:

  • 部分函数传入参数由普通对象调整为传对象引用,减少对象的拷贝开销。
  • 将部分较长的if-else判断改为switch-case
  • OperatorWithKernel类型转换由dynamic_cast改为static_cast
  • 使用类静态成员变量缓存全局单列,减少XXX::Instance()的调用次数
  • 移除TraceOp内RecordEvent使用的字符串拼接操作

* optimize performance of dygraph

* optimize performance of dygraph and elementwise_add

* optimize the trace op

* fix bug

* fix bug

* fix unittest bug

* fix code format
@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.

@phlrain phlrain merged commit 2ea56c9 into PaddlePaddle:release/2.3 Apr 28, 2022
@zyfncg zyfncg deleted the cherry_optimize branch April 28, 2022 09:34
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