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

如何添加 Oprs 文档一些可以改善的点 #229

Open
dc3671 opened this issue Aug 3, 2021 · 2 comments
Open

如何添加 Oprs 文档一些可以改善的点 #229

dc3671 opened this issue Aug 3, 2021 · 2 comments
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@dc3671
Copy link
Collaborator

dc3671 commented Aug 3, 2021

  • 在实际开发中,新的dnn kernel的执行过程很可能是复用已有kernel的实现,比如 RNN 理论上可以直接用 MatMul 实现,如何复用、有哪些细节要注意,可以写一下
  • dnn 里的 kernel 基本都有 exec、check_exec、deduce_layout、get_workspace_in_bytes,直觉上会以为都是 OperatorBase 这个公共基类的虚函数,但实际上全都不是
    • 其中 exec、get_workspace_in_bytes 是每个 kernel op 继承 OperatorBase 后自己定义的虚函数(只是约定俗成每个 op 都用这个名字),还需要每个平台的 Impl 类进一步实现,而 check_exec、deduce_layout 则是同一个 kernel op 在各个平台共用的
    • 原因应该是每个 op 的 exec 实际上接受的参数并不统一,并不是固定 input/output/workspace 三个值
    • 感觉这些细节可以再解释一下,不然不清楚哪些是自定义哪些是规定的
  • 另外还有一个小点,如何添加 DNN 算子里有提到一个 rep 函数,没有来源。实际上是一个宏,本质是一个循环,应该解释一下。
@dc3671 dc3671 added the documentation Improvements or additions to documentation label Aug 3, 2021
@cheekyshibe
Copy link
Contributor

🥰可以根据这个需求开个 PR 搞一下。

@cheekyshibe cheekyshibe added this to the v1.5 milestone Aug 4, 2021
@bealwang
Copy link

我感觉这些是不是有些太细节了,关于 get_workspace_in_bytes 这件事是不是对代码做一次重构更加合适?比如继承一个 OprWithWorkspace 的类。我的点在于文档不应该解决因为代码组织不合理导致的理解困难,这时候往往重构代码会来的更加直接一些。

@cheekyshibe cheekyshibe modified the milestones: v1.5, v1.7 Dec 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants