Skip to content

Conversation

@Aurelius84
Copy link
Contributor

@Aurelius84 Aurelius84 commented Jun 16, 2021

PR types

Performance optimization

PR changes

Others

Describe

在 PR (#33335) 之后,paddle.to_tensor无论输入的类型是什么,都会触发copy操作。因此在 prepare函数中添加了 _equals(place)判断条件,只有在dst place 与 src place 不一致时,才会进行copy操作

基于benchmark平台测试:

模型 动态图 动转静(PR 前) 动转静(PR后) 提升(后 vs. 前)
MobileNetV1_bs128 1066.712 626.93 1040.565 65.9%
MobileNetV2_bs128 826.01 527.81 808.487 53.1%

@paddle-bot-old
Copy link

Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@Aurelius84 Aurelius84 requested review from zhhsplendid and zhiqiu June 16, 2021 03:30
Copy link
Contributor

@zhiqiu zhiqiu left a comment

Choose a reason for hiding this comment

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

LGTM

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.

2 participants