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

Relax protobuf version requirement for version below 4 #4535

Merged
merged 2 commits into from
Oct 1, 2022

Conversation

jcwchen
Copy link
Member

@jcwchen jcwchen commented Sep 22, 2022

Description

Protobuf now has 3.20.2. Using Protobuf<4 should be better.

Motivation and Context

Fixes #4532.

Signed-off-by: Chun-Wei Chen <jacky82226@gmail.com>
@jcwchen jcwchen added the dependencies Pull requests that update a dependency file label Sep 22, 2022
@jcwchen jcwchen requested a review from a team as a code owner September 22, 2022 15:11
@jcwchen jcwchen enabled auto-merge (squash) September 30, 2022 23:56
@jcwchen jcwchen merged commit e9fa40e into onnx:main Oct 1, 2022
@jcwchen jcwchen deleted the jcw/relax-protobuf branch October 1, 2022 15:57
@snnn
Copy link
Contributor

snnn commented Oct 29, 2022

But I found an interesting thing: ORT's Windows CI build pipelines build ONNX python package from source with protobuf 3.21.8. Then when ORT tries to run its python tests(which depends on protobuf and onnx python packages), then if the protobuf version is 3.18.3, the tests fail. However, if we uninstall protobuf and install onnx again, because onnx says the max supported protobuf version is 3.20.1, then pip will get that version, and it works!

@jcwchen
Copy link
Member Author

jcwchen commented Oct 29, 2022

Thanks for bringing this up. I bumped into similar issue before... I was considering to aggressively bump Protobuf version as 3.20 for building ONNX, but there were some test failures if the built ONNX played with Python Protobuf<=3.19. Therefore, if ONNX decides to bump its Protobuf version for building ONNX as 3.20, probably ONNX needs to upgrade its required Python Protobuf as protobuf >= 3.20, < 4 in https://github.com/onnx/onnx/blob/main/requirements.txt. The compatibility is kind of limited in that case.

Thus, I took a step back in next release: I decided to bump Protobuf version as 3.18.3 for building ONNX instead and so ONNX can preserve much broader compatibility for Python Protobuf version: #4544. Still, in the future while ONNX needs higher Protobuf version, this issue will hit us again anyway. We need to keep in mind about the limited compatibility issue for Protobuf>=3.20 or Protobuf>=3.21.

@snnn
Copy link
Contributor

snnn commented Oct 29, 2022

But they say 3.18.x releases are end of support? Should you use a newer one?

@jcwchen
Copy link
Member Author

jcwchen commented Oct 29, 2022

Good question. Protobuf 3.19.5 or 3.19.6 has another issue about fixed build_type in their build config. So the options we have here are 3.18.3 or 3.20.2+. I slightly prefer 3.18.3, because other ONNX related tools might have Protobuf version requirement and using Protobuf 3.20.2+ for building ONNX might break something, as your example above, if they really need lower Python Protobuf version (<3.20) somehow. In addition, we can add an announcement in next release and say in the following release ONNX will upgrade its Protobuf version to 3.20 for build and the minimum required Python Protobuf version will be 3.20, to let users be aware of it in advance.

IIRC, ONNX Runtime is using Protobuf 3.18.3 for build also. @snnn Are you planning to upgrade ORT's Protobuf version to 3.20+ soon? If yes, definitely we should re-evaluate if ONNX should upgrade its Protobuf version to 3.20, to prevent some conflict issue in the near future.

@jcwchen
Copy link
Member Author

jcwchen commented Oct 29, 2022

But they say 3.18.x releases are end of support?

Forgot to answer your question -- yes Protobuf people said 3.18.x are out of their support window, but 3.18.3 is a quite fresh patch they have released last month.

@snnn
Copy link
Contributor

snnn commented Oct 29, 2022

Are you planning to upgrade ORT's Protobuf version to 3.20+ soon?

yes. For this issue: microsoft/onnxruntime#13335

But the change won't be as trivial as before. It needs some code changes.

broune pushed a commit to broune/onnx that referenced this pull request May 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Relax the protobuf version requirement.
3 participants