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

[static op generation] tile #53317

Closed
wants to merge 10 commits into from
Closed

Conversation

gouzil
Copy link
Member

@gouzil gouzil commented Apr 25, 2023

PR types

Others

PR changes

Others

Description

相关链接

@paddle-bot
Copy link

paddle-bot bot commented Apr 25, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added contributor External developers status: proposed labels Apr 25, 2023
@paddle-bot
Copy link

paddle-bot bot commented Apr 25, 2023

❌ The PR is not created using PR's template. You can refer to this Demo.
Please use PR's template, it helps save our maintainers' time so that more developers get helped.

args : (Tensor x, IntArray repeat_times = {})
output : Tensor(out)
infer_meta :
func : TileInferMeta
Copy link
Contributor

Choose a reason for hiding this comment

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

op_compat.yaml中增加

manual_signature : [tile]

表示tile的signature保持手写,但是tle_grad和tile_double_grad不需要保持手写,所以需要删除paddle/phi/ops/compat/tile_sig.cc中grad的相关代码,保留tile的代码

Copy link
Member Author

Choose a reason for hiding this comment

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

应该写 manual_signature : [tile, tile_grad]吧, tle_grad 也需要保持手写

KernelSignature TileGradOpArgumentMapping(const ArgumentMappingContext& ctx) {

infer_meta :
func : TileInferMeta
kernel :
func : tile
Copy link
Contributor

Choose a reason for hiding this comment

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

增加data_type : x

AddAttr<std::vector<int>>("repeat_times",
"The number of repeat times for each dimension.")
.SetDefault({})
.SupportTensor();
Copy link
Contributor

Choose a reason for hiding this comment

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

目前看来这里存在一个特殊的情况,repeat_times这个attr既有SupportTensor属性,又支持RepeatTimesrepeat_times_tensor,极度不规范,这个PR暂时保持,不需要推进,后续清理后再修改。

Copy link
Member Author

Choose a reason for hiding this comment

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

确实, 如果在op_compat.yaml添加support_tensor : true

- op : tile
  backward : tile_grad, tile_double_grad
  inputs :
    x : X
  outputs :
    out : Out
  int_array:
    repeat_times :
      data_type : int
      tensor_name : RepeatTimes
      tensors_name : repeat_times_tensor
      support_tensor : true
  manual_signature : [tile, tile_grad]

将会变成

class TileOpMaker : public framework::OpProtoAndCheckerMaker {
 public:
  void Make() override {
    AddInput("X", "(Tensor), input 0 of tile op.");
    AddOutput("Out", "(Tensor), output 0 of tile op.");
    AddAttr<std::vector<int>>("repeat_times", "(std::vector<int>), attribute 0 for tile op.")
        .SetDefault({})
        .SupportTensor();
    AddComment(R"DOC(
TODO: Documentation of tile op.
)DOC");
  }
};

@paddle-ci-bot
Copy link

paddle-ci-bot bot commented May 4, 2023

Sorry to inform you that a24890d's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually.

@paddle-bot
Copy link

paddle-bot bot commented May 4, 2023

很抱歉,经过我们的反复讨论,你的PR暂未达到合入标准,请阅读飞桨原生算子开发规范,你可以重新提交新的PR,我们先将此PR关闭,感谢你的贡献。
Sorry to inform you that through our discussion, your PR fails to meet the merging standard (Reference: Paddle Custom Operator Design Doc). You can also submit an new one. Thank you.

@gouzil gouzil deleted the mv_tile_yml branch May 15, 2023 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants