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

[Framework] Update set_model_from_buffer api #10026

Conversation

shentanyue
Copy link
Collaborator

@shentanyue shentanyue commented Feb 24, 2023

PR devices

Framework

PR types

Others

PR changes

API

Description

之前的 set_model_from_buffer 内部存储会使用 std::string 数据结构,会将传入的 buffer 再拷贝构造一份,造成内存上的重复消耗。
目前改为 const char* 进行数据传递,buffer 的内存释放由用户侧管理。

TODO: 清理LightPredictor读取pdmodel/pdiparams相关API和底层实现。

@paddle-bot
Copy link

paddle-bot bot commented Feb 24, 2023

Thanks for your contribution!

@PaddlePaddle PaddlePaddle locked and limited conversation to collaborators Feb 24, 2023
@PaddlePaddle PaddlePaddle unlocked this conversation Feb 24, 2023
@shentanyue shentanyue force-pushed the update_set_model_from_buffer_api_develop branch from f16f4ee to 14ee890 Compare February 24, 2023 10:23
lite/api/paddle_api.h Outdated Show resolved Hide resolved
lite/api/paddle_api.h Outdated Show resolved Hide resolved
hong19860320
hong19860320 previously approved these changes Feb 24, 2023
Copy link
Collaborator

@hong19860320 hong19860320 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@hong19860320 hong19860320 left a comment

Choose a reason for hiding this comment

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

LGTM

@shentanyue shentanyue merged commit 082b78e into PaddlePaddle:develop Feb 28, 2023
shentanyue added a commit to shentanyue/Paddle-Lite that referenced this pull request Feb 28, 2023
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