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

Poetry seems to ignore dependencies of pytorch 2.0.1 but correctly installs them from local whl file #7902

Closed
twoertwein opened this issue May 11, 2023 · 11 comments
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged

Comments

@twoertwein
Copy link

  • Poetry version: 1.4.2
  • Python version: 3.11.3
  • OS version and name: Fedora 38

The following pyproject.toml does not install pytorch's dependecies. When manually downloading the whl from pipy, poetry correctly installs all dependecies.

[tool.poetry]
name = "foo"
version = "0.1.0"
description = ""
authors = ["Foo Bar <foo@bar.com>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.11"
torch = "2.0.1"  # does NOT install nvidia-cublas-cu11
# torch = { file = "path/to/torch-2.0.1-cp311-cp311-manylinux1_x86_64.whl"}  # installs nvidia-cublas-cu11


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

xref pytorch/pytorch#100974

@twoertwein twoertwein added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels May 11, 2023
@dimbleby
Copy link
Contributor

That's not one of pytorch's dependencies, according to:

$ curl -s https://pypi.org/pypi/torch/2.0.1/json | jq '.info.requires_dist'
[
  "filelock",
  "typing-extensions",
  "sympy",
  "networkx",
  "jinja2",
  "opt-einsum (>=3.3) ; extra == 'opt-einsum'"
]

Per many other issues: poetry builds cross-platform solutions and expects all distributions of a particular version of a package to have the same requirements, with per-platform variation encoded in pep508 markers.

Please close

@twoertwein
Copy link
Author

Thank you for the quick response!

@Queuecumber
Copy link

Hi @dimbleby I'm working with some pytorch people to try to fix this, would you know where I can get more information about how that json API works? We're not sure how to make sure it has the right information

@dimbleby
Copy link
Contributor

dimbleby commented Jun 8, 2023

As I understand it, dependencies on the JSON API are taken from the metadata in the first wheel that is uploaded.

But rather than relying on such wrinkles, it is better to put the same metadata in all uploaded distributions, and use markers for platform-specific variation

@Queuecumber
Copy link

Just wanted to give an update, this was supposed to be fixed in the latest pytorch release, but 2.1.0 just dropped and still has this issue so we need to loop back with Meta and figure out whats going wrong

@dimbleby
Copy link
Contributor

dimbleby commented Oct 4, 2023

it looks as though https://files.pythonhosted.org/packages/e1/24/f7fe3fe82583e6891cc3fceeb390f192f6c7f1d87e5a99a949ed33c96167/torch-2.1.0-cp38-cp38-manylinux1_x86_64.whl contains the cuda dependencies with platform-specific markers: but other wheels don't - and that one happens not to have been the first to be uploaded.

see #7902 (comment)

@MischaPanch
Copy link

@Queuecumber is there any issue in torch that is tracking this? It's a real bummer for all poetry-based projects

@Queuecumber
Copy link

Queuecumber commented Oct 9, 2023 via email

@MischaPanch
Copy link

Can we at least reopen this issue then @twoertwein ? It seems the only place to which one can link for describing this problem, and it's confusing that the issue is closed. I undestand that it's not an issue of poetry, but still it could be kept open until torch+nvidia resolve this in a new release

@dimbleby
Copy link
Contributor

dimbleby commented Oct 9, 2023

If you want to track a torch problem, then do it in the torch repository - ie open an issue there

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected status/triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants