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

Optimize performance of dygraph (v4) #42196

Merged
merged 11 commits into from
Apr 27, 2022
Merged

Conversation

zyfncg
Copy link
Contributor

@zyfncg zyfncg commented Apr 24, 2022

PR types

Performance optimization

PR changes

Others

Describe

动态图调度性能优化:

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

@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.

Copy link
Contributor

@ZzSean ZzSean left a comment

Choose a reason for hiding this comment

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

LGTM for OP-Benchmark

@zyfncg zyfncg merged commit 37e2f02 into PaddlePaddle:develop Apr 27, 2022
@zyfncg zyfncg deleted the perf_opt branch April 27, 2022 08:04
zyfncg added a commit to zyfncg/Paddle that referenced this pull request Apr 27, 2022
* 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
phlrain pushed a commit that referenced this pull request Apr 28, 2022
* Optimize performance of dygraph (v4)  (#42196)

* 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

* fix cherry-pick problem
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