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

uv sometimes can't handle PyTorch nightly's cuda dependencies correctly. #10119

Open
YouJiacheng opened this issue Dec 23, 2024 · 1 comment
Open

Comments

@YouJiacheng
Copy link
Contributor

YouJiacheng commented Dec 23, 2024

my pyproject.toml

[project]
name = "modded-nanogpt"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
    "numpy>=2.1.3",
    "torch==2.6.0.dev20241222",
    "pytorch-triton>=3.2.0",
    "huggingface-hub>=0.26.2",
    "tqdm>=4.67.0",
]

[tool.uv]
environments = [
    "platform_system == 'Linux'",
]

[tool.uv.sources]
torch = [
    { index = "pytorch-nightly-cu126"},
]
pytorch-triton = [
    { index = "pytorch-nightly-cu126"},
]

[[tool.uv.index]]
name = "pytorch-nightly-cu126"
url = "https://download.pytorch.org/whl/nightly/cu126"
explicit = true

[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true

uv tree output after uv sync

Resolved 22 packages in 7ms
modded-nanogpt v0.1.0
├── huggingface-hub v0.27.0
│   ├── filelock v3.16.1
│   ├── fsspec v2024.10.0
│   ├── packaging v24.2
│   ├── pyyaml v6.0.2
│   ├── requests v2.32.3
│   │   ├── certifi v2024.12.14
│   │   ├── charset-normalizer v3.4.0
│   │   ├── idna v3.10
│   │   └── urllib3 v2.2.3
│   ├── tqdm v4.67.1
│   └── typing-extensions v4.12.2
├── numpy v2.2.0
├── pytorch-triton v3.2.0+git35c6c7c6
├── torch v2.6.0.dev20241222+cu126
│   ├── filelock v3.16.1
│   ├── fsspec v2024.10.0
│   ├── jinja2 v3.1.4
│   │   └── markupsafe v3.0.2
│   ├── networkx v3.4.2
│   ├── setuptools v75.6.0
│   ├── sympy v1.13.1
│   │   └── mpmath v1.3.0
│   └── typing-extensions v4.12.2
└── tqdm v4.67.1

In a new directory I run uv init uv venv then uv pip install torch --index-url https://download.pytorch.org/whl/nightly/cu126.
It can correctly install nvidia-*.

Resolved 24 packages in 2.83s
Installed 24 packages in 127ms
 + filelock==3.16.1
 + fsspec==2024.10.0
 + jinja2==3.1.4
 + markupsafe==2.1.5
 + mpmath==1.3.0
 + networkx==3.4.2
 + nvidia-cublas-cu12==12.6.4.1
 + nvidia-cuda-cupti-cu12==12.6.80
 + nvidia-cuda-nvrtc-cu12==12.6.77
 + nvidia-cuda-runtime-cu12==12.6.77
 + nvidia-cudnn-cu12==9.5.1.17
 + nvidia-cufft-cu12==11.3.0.4
 + nvidia-curand-cu12==10.3.7.77
 + nvidia-cusolver-cu12==11.7.1.2
 + nvidia-cusparse-cu12==12.5.4.2
 + nvidia-cusparselt-cu12==0.6.3
 + nvidia-nccl-cu12==2.21.5
 + nvidia-nvjitlink-cu12==12.6.85
 + nvidia-nvtx-cu12==12.6.77
 + pytorch-triton==3.2.0+git0d4682f0
 + setuptools==70.2.0
 + sympy==1.13.1
 + torch==2.6.0.dev20241222+cu126
 + typing-extensions==4.12.2

and uv pip tree gives

torch v2.6.0.dev20241222+cu126
├── filelock v3.16.1
├── fsspec v2024.10.0
├── jinja2 v3.1.4
│   └── markupsafe v2.1.5
├── networkx v3.4.2
├── nvidia-cublas-cu12 v12.6.4.1
├── nvidia-cuda-cupti-cu12 v12.6.80
├── nvidia-cuda-nvrtc-cu12 v12.6.77
├── nvidia-cuda-runtime-cu12 v12.6.77
├── nvidia-cudnn-cu12 v9.5.1.17
│   └── nvidia-cublas-cu12 v12.6.4.1
├── nvidia-cufft-cu12 v11.3.0.4
│   └── nvidia-nvjitlink-cu12 v12.6.85
├── nvidia-curand-cu12 v10.3.7.77
├── nvidia-cusolver-cu12 v11.7.1.2
│   ├── nvidia-cublas-cu12 v12.6.4.1
│   ├── nvidia-cusparse-cu12 v12.5.4.2
│   │   └── nvidia-nvjitlink-cu12 v12.6.85
│   └── nvidia-nvjitlink-cu12 v12.6.85
├── nvidia-cusparse-cu12 v12.5.4.2 (*)
├── nvidia-cusparselt-cu12 v0.6.3
├── nvidia-nccl-cu12 v2.21.5
├── nvidia-nvjitlink-cu12 v12.6.85
├── nvidia-nvtx-cu12 v12.6.77
├── pytorch-triton v3.2.0+git0d4682f0
├── setuptools v70.2.0
├── sympy v1.13.1
│   └── mpmath v1.3.0
└── typing-extensions v4.12.2
(*) Package tree already displayed

And torch==2.6.0.dev20241203+cu126 is okay:

Resolved 35 packages in 1.87s
Uninstalled 1 package in 139ms
Installed 14 packages in 132ms
 + nvidia-cublas-cu12==12.6.4.1
 + nvidia-cuda-cupti-cu12==12.6.80
 + nvidia-cuda-nvrtc-cu12==12.6.77
 + nvidia-cuda-runtime-cu12==12.6.77
 + nvidia-cudnn-cu12==9.5.1.17
 + nvidia-cufft-cu12==11.3.0.4
 + nvidia-curand-cu12==10.3.7.77
 + nvidia-cusolver-cu12==11.7.1.2
 + nvidia-cusparse-cu12==12.5.4.2
 + nvidia-cusparselt-cu12==0.6.3
 + nvidia-nccl-cu12==2.21.5
 + nvidia-nvjitlink-cu12==12.6.85
 + nvidia-nvtx-cu12==12.6.77
 - torch==2.6.0.dev20241222+cu126
 + torch==2.6.0.dev20241203+cu126
@YouJiacheng
Copy link
Contributor Author

there are these requirements in METADATA
Image

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

No branches or pull requests

1 participant