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

【Hackathon No.77】为神经网络编译器 CINN 增加 squeeze 算子 #182

Merged
merged 6 commits into from
Jul 26, 2022

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Jul 12, 2022

No description provided.

@CLAassistant
Copy link

CLAassistant commented Jul 12, 2022

CLA assistant check
All committers have signed the CLA.

@paddle-bot
Copy link

paddle-bot bot commented Jul 12, 2022

你的PR提交成功,感谢你对开源项目的贡献!
请检查PR提交格式和内容是否完备,具体请参考示例模版
Your PR has been submitted. Thanks for your contribution!
Please check its format and content. For this, you can refer to Template and Demo.

@zhhsplendid
Copy link
Member

嗨,你好,对设计文档,建议补充:

  1. squeeze功能的解释(如数学公式、或简短伪代码、相关参数含义等),在深度学习中,有时有不同框架用同一个词,但表达不同数学计算算子,因此相关名词、功能确保在本次设计和开发的含义统一,是有意义的。请在背景、名词、功能目标等部分进行相关补充。
  2. TVM 下似乎有squeeze,参考文档可以在以下两个链接搜索squeeze,似乎与设计文档中描述TVM没有该API矛盾?能否进一步做更详细的业内方案调研?
    https://tvm.apache.org/docs/reference/api/python/topi.html
    https://tvm.apache.org/docs/reference/api/python/relay/index.html
  3. 设计方案的命名与参数设计中,squeeze似乎常常有指定axis,你的设计中如果没有,请给出理由。如果有,请补充
  4. API设计方案能否像代码设计一样,稍微更完整补充
  5. 测试中,除了demo,可否像软件行业中,也向CINN repo增加单元测试(unit test),并描述相关方案到设计文档?

@zrr1999
Copy link
Member Author

zrr1999 commented Jul 14, 2022

嗨,你好,对设计文档,建议补充:

  1. squeeze功能的解释(如数学公式、或简短伪代码、相关参数含义等),在深度学习中,有时有不同框架用同一个词,但表达不同数学计算算子,因此相关名词、功能确保在本次设计和开发的含义统一,是有意义的。请在背景、名词、功能目标等部分进行相关补充。
  2. TVM 下似乎有squeeze,参考文档可以在以下两个链接搜索squeeze,似乎与设计文档中描述TVM没有该API矛盾?能否进一步做更详细的业内方案调研?
    https://tvm.apache.org/docs/reference/api/python/topi.html
    https://tvm.apache.org/docs/reference/api/python/relay/index.html
  3. 设计方案的命名与参数设计中,squeeze似乎常常有指定axis,你的设计中如果没有,请给出理由。如果有,请补充
  4. API设计方案能否像代码设计一样,稍微更完整补充
  5. 测试中,除了demo,可否像软件行业中,也向CINN repo增加单元测试(unit test),并描述相关方案到设计文档?

好的,我已经按照要求优化了一下文档

Copy link
Member

@zhhsplendid zhhsplendid left a comment

Choose a reason for hiding this comment

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

总体没有什么问题了,请注意我comment的细节问题


## 1、相关背景

`squeeze` 是众多神经网络编译器中基础的算子,FQ,
Copy link
Member

Choose a reason for hiding this comment

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

FQ在这里是什么意思?是否可以删除?

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设计

1. 在 `cinn/hlir/pe/transform.cc` 里实现 `squeeze` 算子。
2. 在 `cinn/hlir/op/transform.h` 里声明相应的 `strategy`。
Copy link
Member

Choose a reason for hiding this comment

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

CINN最近会迁移新的IR schedule。所以我们未来会把旧的schedule放在cinn/hlir/pe/下,而新的compute和schedule都放在cinn/hlir/op下,所以麻烦更改算子的实现路径。更多信息可以到时直播贡献代码指南时讲解。

Copy link
Member Author

Choose a reason for hiding this comment

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

好的,后面我观看直播学习

Copy link
Member

@zhhsplendid zhhsplendid left a comment

Choose a reason for hiding this comment

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

LGTM

@zhhsplendid zhhsplendid merged commit c1c6a87 into PaddlePaddle:master Jul 26, 2022
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