CARVIEW |
Navigation Menu
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[PIR] Move ReifyInfershape into paddle dialect #59960
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
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
@@ -410,6 +419,15 @@ def __init__(self, op_yaml_item, op_compat_item): | |||
else: | |||
self.infer_meta_func = None | |||
|
|||
# print(self.op_yaml_item) |
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.
delete unused code
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.
多谢
@@ -1252,6 +1270,10 @@ def OpGenerator( | |||
if "paddle::dialect::ParseKernelKeyInterface" in op_interfaces: | |||
parse_kernel_key_str = parse_kernel_key_template | |||
|
|||
reify_infer_shape_str = "" | |||
if "paddle::dialect::ReifyInferShapeInterface" in op_interfaces: |
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.
没有看到那段逻辑将 ReifyInferShapeInterface 添加到 op_interfaces,当前是还未生效么?
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.
yaml 中先增加了 abs 的 ReifyInferShapeInterface,已经生效了
至于具体的逻辑,这部分的接口接入符号表达后,需要重新修改,因此暂时 注释掉了,后面和编译器敲定后,会重新写这部分的逻辑
bool AbsOpReifyInferShape( | ||
pir::Builder& builder, // NOLINT | ||
const std::vector<pir::OpOperand>& operands, | ||
std::vector<pir::Value>& reified_return_shapes); // NOLINT | ||
bool Abs_OpReifyInferShape( | ||
pir::Builder& builder, // NOLINT | ||
const std::vector<pir::OpOperand>& operands, | ||
std::vector<pir::Value>& reified_return_shapes); // NOLINT | ||
|
||
} // namespace paddle::dialect |
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.
这两个函数有什么差异,是否有冗余?
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.
这个 yaml 生成时会有两份AbsOp,暂时没办法去掉
parse_kernel_key_define_str = '' | ||
if "paddle::dialect::ParseKernelKeyInterface" in op_interfaces: | ||
parse_kernel_key_define_str = gen_parse_kernel_key_str( | ||
op_class_name | ||
) | ||
|
||
# generate op GetKernelKeyForVar function str |
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.
注释 GetKernelKeyForVar 好像不太对?
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.
复制的,忘记改动了,下个PR 修改
@@ -15,6 +15,7 @@ | |||
data_type : x | |||
inplace: (x -> out) | |||
backward : abs_grad | |||
interfaces : paddle::dialect::ReifyInferShapeInterface |
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.
- namespace
paddle::dialect::
感觉有些徒增字符串长度,Yaml里是否可以去掉? - Reify和Infer是两个动词,直接连起来从语义和语法上看都存在问题,这里的命名感觉需要再优化下
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.
- 目前参考其他 interface 的配置也会带 namespace,可以后面考虑一同去掉
- 经过讨论、统一使用 InferSymbolicShape 命名,后面统一修改
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
Others
PR changes
Others
Description
Pcard-67164
Move ReifyInferShapeInterface into paddle dialect
Note:Function signature of ReifyInferShape will be redefined later