Skip to content

update op_version_registry, test=develop#26592

Merged
Shixiaowei02 merged 1 commit intoPaddlePaddle:developfrom
Shixiaowei02:dev/op_reg
Aug 24, 2020
Merged

update op_version_registry, test=develop#26592
Shixiaowei02 merged 1 commit intoPaddlePaddle:developfrom
Shixiaowei02:dev/op_reg

Conversation

@Shixiaowei02
Copy link
Contributor

@Shixiaowei02 Shixiaowei02 commented Aug 24, 2020

PR types

Bug fixes

PR changes

Others

Describe

NewAttr 添加默认值参数。

REGISTER_OP_VERSION(reshape)
    .AddCheckpoint(
        R"ROC(
      Upgrade reshape, modified one attribute [axis] and add a new attribute [size].
    )ROC",
        framework::compatible::OpVersionDesc()
            .ModifyAttr("axis",
                        "Increased from the original one method to two.", -1)
            .NewAttr("size",
                     "In order to represent a two-dimensional rectangle, the "
                     "parameter size is added.", 0))
    .AddCheckpoint(
        R"ROC(
      Add a new attribute [height]
    )ROC",
        framework::compatible::OpVersionDesc().NewAttr(
            "height",
            "In order to represent a two-dimensional rectangle, the "
            "parameter height is added.", 0));

核心接口:

AddCheckpoint(string summary, OpVersionDesc desc) 此方法会触发 Opversion++
OpVersionDesc ,用于注册本次升级对应的修改点
NewAttr(name, default_value) 表示增加了一个 attribute,并需要指定其向前兼容的默认值
ModifyAttr(name, default_value) 表示修改了 attribute 的行为,并需要指定其向前兼容的默认值
其他注册方法可以按需增加
全局的 op_capatible_info 会记录每个 Op 最新的版本号(version checkpoint 的次数),并通过 save_inference_model 存储到模型中。

其中记录的版本及描述,会帮助 InferenceLite 来对应升级策略;也可以自动搜集作为 Release Notes 的来源。

设计文档见 Agroup:Op 版本监控及兼容性识别设计(#3366223)

@paddle-bot-old
Copy link

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

@paddle-bot-old
Copy link

paddle-bot-old bot commented Aug 24, 2020

✅ This PR's description meets the template requirements!
Please wait for other CI results.

Copy link
Contributor

@Superjomn Superjomn 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants