-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Polish jit.save/load design & remove paddle.SaveLoadConfig #27623
Polish jit.save/load design & remove paddle.SaveLoadConfig #27623
Conversation
Thanks for your contribution! |
… saveload/remove_save_load_config
(1) model_filename (string): The inference model file name of the paddle 1.x ``save_inference_model`` | ||
save format. Default file name is :code:`__model__` . | ||
(2) params_filename (string): The persistable variables file name of the paddle 1.x ``save_inference_model`` | ||
save format. No default file name, save variables separately by default. |
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.
we don't recommend users to use keep_name_table
, only keep it for debuging, so don't write its doc.
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
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
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
…dle#27623) * replace config by kwargs * change save path form dir to prefix * fix failed unittests * revert unittest name change * polish en docs * add more tests for coverage
PR types
Function optimization
PR changes
APIs
Describe
一、PR主要修改
根据预测接口paddle.static.save/load_inference_model的升级评审结论,对2.0主推的save/load接口进行了如下更改:
paddle.SaveLoadConfig
,对于paddle.jit.save/load, paddle.load
改为使用**kwargs
作为兼容参数paddle.jit.save/load
的路径参数model_path
改为path
,使其更加简洁并与paddle.save/load
保持一致paddle.jit.save/load
参数path
含义,原含义为【存储预测模型的目录】,更改后为【存储预测模型相关文件的前缀】二、2.0 Save/Load全局概览
本次升级的主要目的是统一paddle各存储接口存储结果的组织形式,具体地,统一了paddle框架中save接口在"存储得到多个结果"时的文件组织方式,由原先【增加后缀】与【创建目录】共存的方式,改为统一使用【增加paddle标准后缀】的方式。
具体变化见下图:
图1. paddle 2.0 save结果形式的合理化与简化
图2. paddle 2.0 save结果整体变化表
三、TODO事项
paddle.static.save/load_inference_model的升级评审在9.28才完成,时间较为仓促。
但本次升级涉及的改动比较大,为了避免2.0正式版和2.0-RC在主推save/load接口使用上存在不兼容问题,假期内加班完成了paddle主repo中的接口改动,该PR的工作需要争取在2.0-RC切分支之前合入,剩余关联的辅助工作适当延后安排,具体包括:
paddle.jit.save/load, paddle.load, paddle.SaveLoadConfig
的中文文档的对应修改paddle.jit.save/load, paddle.load
在处理各个场景时的报错提示更加友好完善四、英文文档预览