-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
Some dependencies of pytorch missing from lockfile #18936
Comments
@gautiervarjo this is because torch has inconsistent metadata. I downloaded all 2.0.0 artifacts:
That's 4.2 GB worth:
And the deps are:
This presents an untenable situation for resolvers which must assume the requirement METADATA is accurate or be forced to download ~4GB of artifacts (per-version!) to do an accurate resolve. What torch should be doing is listing the same METADATA in each artifact and using environment markers to say when each applies: https://peps.python.org/pep-0508/#environment-markers They very nearly do this! I can only assume they are unaware of the damage they're doing in the real Python ecosystem that exists on the ground. Perhaps raise a voice over there? I don't see any viable path forward to solve this on the Pants / Pex end that is not extremely hacky / specialized to the torch case. |
@jsirois thanks for taking a look so quickly! Do you know offhand how pip ends up pulling those deps? Is it because the pip resolver picks 1 specific platform (x86 linux) immediately whereas Pex tries to build a multi-platform lockfile? I'll poke the pytorch people to see about getting this fixed. As for workarounds in my repo, I suppose the most straightforward way is to add those dependencies to my requirements and tell Pants torch depends on them. Previously I used torch wheels with statically-linked CUDA from the torch package index, but this no longer works in Pants for torch 2.0: I'm apparently hitting issue #13401 but when running tests (not just when building PEX files), which means the |
To chime in, it's quite dirty of torch to silently say if your platform happens to download the Linux x86_64 wheel, congrats you downloaded CUDA. |
@gautiervarjo exactly. |
Alright then, thanks again for your help! Closing this. |
Describe the bug
After adding
torch==2.0.0
to my python requirements and re-generating the lockfile, I encounter missing requirements in the PEX environment when running code or tests:Pants version
2.14
In the repro repository below I used
2.17.0.dev4
to check if this was fixed, but no luck.OS
Linux, Ubuntu 20.04.
Additional info
nvidia-XXX
requirements, so the error above seems to be a surface-level symptom.METADATA
file inside the downloaded wheel in the pants cache does list these requirements, so I'm not sure why they don't make it into the lockfile. Is it because of thoseplatform_system
andplatform_machine
attributes?torch==2.0.0
in a virtual environment with pip does pull all of thesenvidia-XXX
packages, so everything works.Apologies if this is a duplicate issue; I've found plenty of mentions of pytorch and of missing requirements, but nothing that seemed to match!
The text was updated successfully, but these errors were encountered: