-
Notifications
You must be signed in to change notification settings - Fork 1.6k
update the params format, test=develop #4917
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
update the params format, test=develop #4917
Conversation
1ce988a
to
d804dbd
Compare
@@ -39,9 +39,35 @@ | |||
|
|||
namespace paddle { | |||
namespace lite { | |||
namespace model_parser { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
新增接口:
Buffer model_parser::LoadFile
void model_parser::SaveFile
只修改内部实现的:
LoadLoDTensor
LoadCombinedParamsPb
SaveModelNaive
#include <set> | ||
#include <string> | ||
#include <vector> | ||
#include "lite/core/scope.h" | ||
#include "lite/core/tensor.h" | ||
#include "lite/core/variable.h" | ||
#include "lite/model_parser/flatbuffers/param_desc.h" | ||
#include "lite/model_parser/flatbuffers/program_desc.h" | ||
|
||
namespace paddle { | ||
namespace lite { | ||
namespace fbs { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fbs::LoadFile
和fbs:: SaveFile
修改为
SetTensorWithParam
、SetParamWithTensor
ed49d77
to
5e1507d
Compare
fecd60a
to
7c17693
Compare
ca74b7b
to
1c87749
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
4e36175
to
70c510c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
0dd7da9
to
fb6ebce
Compare
fb6ebce
to
0cacb4d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
本提交更新了权重格式(如下图),支持顺序加载。
修改后,权重初始化的内存占用降低(50% 以上),时延有所下降(x86 测试提速约 30%,android 提速不明显),模型体积基本不变。