Skip to content

New class: op_version_registry, test=develop#26542

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

New class: op_version_registry, test=develop#26542
Shixiaowei02 merged 1 commit intoPaddlePaddle:developfrom
Shixiaowei02:dev/op_reg

Conversation

@Shixiaowei02
Copy link
Contributor

@Shixiaowei02 Shixiaowei02 commented Aug 21, 2020

PR types

New features

PR changes

Others

Description

new class: op_version_registry

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)

Update

The new API AddInput and AddOutput in PR2664

@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 21, 2020

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

@Shixiaowei02 Shixiaowei02 force-pushed the dev/op_reg branch 3 times, most recently from 7e7553c to b674f59 Compare August 21, 2020 11:04
@Shixiaowei02 Shixiaowei02 force-pushed the dev/op_reg branch 2 times, most recently from 4be3eac to fad0376 Compare August 21, 2020 11:26
@Shixiaowei02 Shixiaowei02 changed the title [Test] new class: op_version_registry, test=develop New class: op_version_registry, test=develop Aug 24, 2020
@Shixiaowei02 Shixiaowei02 requested a review from Superjomn August 24, 2020 02:34
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

@Shixiaowei02 Shixiaowei02 merged commit 656e60b into PaddlePaddle:develop Aug 24, 2020
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.

3 participants