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

[WIP] experimental: c export of ModelProto in python package #4274

Closed
wants to merge 2 commits into from
Closed

[WIP] experimental: c export of ModelProto in python package #4274

wants to merge 2 commits into from

Conversation

xadupre
Copy link
Contributor

@xadupre xadupre commented Jun 14, 2022

Description
Many functions serialize a proto into bytes then deserialized in the C++ binding (checked, infershapes, ...) It could be faster by avoiding this step. This PR tries to make ModelProto and other available through pybind11.

Motivation and Context

  • Performance

Signed-off-by: sdpython <xavier.dupre@gmail.com>
@xadupre xadupre requested a review from a team as a code owner June 14, 2022 16:46
@xadupre xadupre mentioned this pull request Jun 14, 2022
Signed-off-by: sdpython <xavier.dupre@gmail.com>
@daquexian
Copy link
Member

daquexian commented Jun 21, 2022

It is the feature I've been looking forward to for a long time. Serializing and deserializing between c++ and python waste much time in onnx optimizer.

I have another idea to discuss: Why do we stick to protobuf and not switch to another more flexible format like flatbuffers? It is so strange that onnx, an op standard, compromises because of a replaceable storage format. But the fact is we even create a specific mechanism (external data) just to solve the problem of protobuf (cannot handle >2GB data).

cc @onnx/steering-committee @onnx/sig-archinfra

@xadupre
Copy link
Contributor Author

xadupre commented Jun 21, 2022

Thanks for the feedback. The other implementation I tried is #4281. However, depending on how protobuf 4 is integrated into onnx, this option may not be available anymore, see https://developers.google.com/protocol-buffers/docs/news/2022-05-06.

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.

None yet

3 participants