learning-at-home / hivemind

Decentralized deep learning in PyTorch. Built to train models on thousands of volunteers across the world.
MIT License
1.99k stars 157 forks source link

Mismatched protobuf versions in sub-dependencies #539

Open briansemrau opened 1 year ago

briansemrau commented 1 year ago

When installing hivemind (as a dependency of petals) using pipenv, pipenv failed to resolve a valid version for protobuf. Could not find a version that matches protobuf<4.0.0,<4.0dev,<5.0dev,>=3.12.2,>=3.20.3,>=4.21.6

Here's the trimmed dependency graph for hivemind to show the conflicts:

- hivemind [required: ==1.1.3, installed: 1.1.3]
  - grpcio-tools [required: >=1.33.2, installed: 1.51.1]
    - protobuf [required: <5.0dev,>=4.21.6, installed: 3.20.3]
  - protobuf [required: <4.0.0,>=3.12.2, installed: 3.20.3]

I haven't tested if this causes any actual issues, but it looks risky.

justheuristic commented 1 year ago

Thanks! I can attest that 3.20.x works fine, but I agree that this will eventually blow in our faces. One way we could handle that is by choosing an older grpcio version version that supports protobuf 3.20, but i'll first try to make it work with the newer protobuf.

mryab commented 1 year ago

I've investigated this issue a bit, and my findings are as follows:

Thus, I'm inclined to believe that the reported error is due to pipenv's dependency resolver and not a mismatch of our dependencies. @briansemrau what's your take on this, have I missed anything? Have you encountered similar issues with Poetry or pip's new resolver?

briansemrau commented 1 year ago

Interesting. Sounds like an issue with pipenv then. It looks like I should be able to constrain grpcio-tools<1.49.0 to give pipenv some help.

I can't speak to other tools, as I haven't used them.