Skip to content

Conversation

@lizexu123
Copy link
Contributor

PR Category

Inference

PR Types

New features

Description

card-71500
predictor support pir save.

@paddle-bot
Copy link

paddle-bot bot commented Jun 17, 2024

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@lizexu123 lizexu123 changed the title [Inference]Predictor support pir model save(.json) [Inference] Predictor support pir model save(.json) Jun 17, 2024
Copy link
Contributor

@xiaoguoguo626807 xiaoguoguo626807 left a comment

Choose a reason for hiding this comment

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

LGTM

pir::Type type_ = pir::GetDataTypeFromValue(value);
phi::DataType type_data = paddle::dialect::TransToPhiDataType(type_);
dev_ctx->Alloc(tensor_temp, type_data);
if (!value.type() || value.type().isa<pir::DenseTensorType>()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

if (!value.type()) 时会有问题

Copy link
Contributor Author

Choose a reason for hiding this comment

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

哦确实,那我只限定后面那个了

@yuanlehome yuanlehome merged commit f69296c into PaddlePaddle:develop Jun 19, 2024
co63oc pushed a commit to co63oc/Paddle that referenced this pull request Jun 25, 2024
* predictor save

* fix

* 删除value.type()

* pass优化后的不走pass了

* 根据旧ir use_optimized_model_写pir逻辑

* predictor support save optimized model(pir .json)

* optimized_model打印写错

* 加打印日志

---------

Co-authored-by: yuanlehome <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants