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

modify fetch logic, use D2H Stream #35191

Merged
merged 3 commits into from
Sep 1, 2021
Merged

modify fetch logic, use D2H Stream #35191

merged 3 commits into from
Sep 1, 2021

Conversation

wanghuancoder
Copy link
Contributor

@wanghuancoder wanghuancoder commented Aug 27, 2021

PR types

Others

PR changes

Others

Describe

修改Fetch逻辑。
不再使用单独的Stream执行Fetch。
将Fetch OP强制设置为CPU kernel。

  • 如果Fetch的Tensor在GPU上,由InterpreterCore默认插入D2H的Memcpy OP。此时,Fetch OP只需要ShareDataWith即可。
  • 如果Fetch的Tensor在CPU上,则做深拷贝。这里做深拷贝的原因是:给用户返回的数据不能是原始Tensor,防止用户篡改Tensor数据。

@paddle-bot-old
Copy link

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

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 for ShareDataWith

@wanghuancoder wanghuancoder merged commit c56d697 into PaddlePaddle:develop Sep 1, 2021
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