-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[IR] Program & Parameter & PaddleDialect #53557
[IR] Program & Parameter & PaddleDialect #53557
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR types
New features
PR changes
Others
Description
1. Program
Program 是对模型结构的抽象,包括一个算子列表和参数哈希表,核心内容见:class Program。(在后续高阶特性阶段,会对控制流算子进行详细设计,并引入基本块、闭包、函数等概念,不断完善 Program对计算图的表示能力)
2. Parameter
参数(或权重)沿用 Paddle 之前的做法,将权重单独存储,在模型中通过参数名字对参数值进行获取、保存,核心数据结构见:class Parameter。
对于模型中参数的使用,定义了两个内置算子:GetParameterOp、SetParameterOp,见 builtin_op:
3. DialectInterface
Dialect Interface 通常适用于想要对一组 attribute/operation/type 进行分析或转换,这些 attribute/operation/type 可以在不同的 dialect 中定义。
这些 Interface 通常涉及所有种类的 Dialect,并且仅用于少数的分析或转换,在这些情况下,在每个 operation 上直接注册接口过于复杂和繁琐,因此定义了 DialecInterface 数据结构,按需注册到对应的 Dialect 中。
本 PR 实现了 Dialect Interface 核心功能,并在 Paddle Dialect 中定义及注册了 ParameterConvertInterface,用于实现 ir::Parameter 与 paddle::framework::Variable 之间的转换。
4. Paddle Dialect
核心内容包括:
Other
Pcard-67164