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

Support phi::DataType::UNDEFINED #1486

Merged
merged 2 commits into from
Jan 23, 2025

Conversation

0x3878f
Copy link
Contributor

@0x3878f 0x3878f commented Jan 23, 2025

The following error occured when convert models including FasterRCNN-ResNet101 FasterRCNN-ResNet50 MaskRCNN-ResNet50

Unsupported data type exists in PaddlePirParser::TransPirDataType2OnnxDataType.

Analysis: TransPirDataType2OnnxDataType doesnot support phi::DataType::UNDEFINED
Solution: Add mapping from phi::DataType::UNDEFINED to P2ODataType::UNDEFINED and mapping from P2ODataType::UNDEFINED to ONNX_NAMESPACE::TensorProto::UNDEFINED

Note

  1. 同时修改了PaddleDataTypeSize 函数,解除了paddle2onnx::framework::proto::VarType_TypeP2ODataType中定义的类型顺序强绑定,否则会导致权重文件的读取错误
  2. 为了兼容旧IR,旧IR下直接将paddle2onnx::framework::proto::VarType_Type 作为TensorInfo.dtype,而TensorInfo.dtype的设计初衷是使用P2ODataType,因此旧IR下``paddle2onnx::framework::proto::VarType_TypeP2ODataType`的类型顺序必须是强绑定的,不能在`P2ODataType` 中插入一个新的类型,目前解决方案是将`P2ODataType` 中的一个闲置的位置替换为UNDEFINED

Copy link

paddle-bot bot commented Jan 23, 2025

Thanks for your contribution!

@risemeup1 risemeup1 merged commit d36eac9 into PaddlePaddle:test_pir Jan 23, 2025
5 checks passed
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.

2 participants