-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 5th No.112】move read_file to phi - part #59359
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
paddle/phi/api/yaml/ops.yaml
Outdated
- op : read_file | ||
args : (str filename = "", DataType dtype = DataType::UINT8, Place place = CPUPlace()) | ||
output : Tensor(out) | ||
infer_meta : | ||
func : ReadFileInferMeta | ||
param : [filename, dtype] | ||
kernel : | ||
func : read_file | ||
param : [filename, dtype] | ||
data_type : dtype | ||
backend : place | ||
|
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.
@@ -82,6 +82,7 @@ | |||
'layer_norm_act_xpu', | |||
'multi_encoder_xpu', | |||
'multihead_matmul', | |||
'read_file', |
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.
read_file不加到这个list里是会编译报错吗?
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.
这里可以参考#59363 的回复,不删除read_file_op.cc文件里的算子定义,这里之所以不建议删除的原因是,删除算子定义后,在ops.yaml里配置并添加额外参数会对op定义造成不兼容修改(ops.yaml会自动生成op定义,相当于把之前删除的算子定义自动生成出来了)。
这里依然建议是保留Op定义,配置legacy_ops.yaml文件(不会生成op定义,为动态图生成api),同时配置pir目录下的ops.yaml文件(paddle/fluid/pir/dialect/operator/ir/ops.yaml
,为新IR生成api)
PD_REGISTER_KERNEL(read_file, CPU, ALL_LAYOUT, phi::ReadFileKernel, uint8_t) { | ||
kernel->OutputAt(0).SetDataType(phi::DataType::UINT8); | ||
} |
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.
这个看起来只有cpu的kernel,建议按照phi规范将该文件挪到phi/kernels/cpu目录下
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.
Done
PR types
Others
PR changes
Others
Description
move read_file to phi
#57262