-
Notifications
You must be signed in to change notification settings - Fork 995
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
Configuring accelerators with optional dependencies and PyPI #9295
Labels
bug
Something isn't working
Comments
I think I see why this happening, though it's fairly complicated. |
I think this might work? [project]
name = "project"
version = "0.1.0"
requires-python = ">=3.12.0"
dependencies = []
[project.optional-dependencies]
cpu = [
"torch===2.5.1 ; platform_system == 'Darwin'",
"torch==2.5.1+cpu ; platform_system != 'Darwin'",
"torchvision>=0.20.1",
]
cu124 = [
"torch>=2.5.1",
"torchvision>=0.20.1",
]
[tool.uv]
conflicts = [
[
{ extra = "cpu" },
{ extra = "cu124" },
],
]
[tool.uv.sources]
torch = [
{ index = "pytorch-cpu", extra = "cpu", marker = "platform_system != 'Darwin'" },
]
torchvision = [
{ index = "pytorch-cpu", extra = "cpu", marker = "platform_system != 'Darwin'" },
]
[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true |
But it should probably work as-is, with your configuration. |
Yes, that works (when leaving out torchvision or I guess doing the same there). But then only a single version can be specified. |
Yeah I gotta think on the right way to solve it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for the quick fix for #9259! I have one more issue, but not sure if it's user error in this case. I removed the custom
pytorch-cu214
index from the example at https://docs.astral.sh/uv/guides/integration/pytorch/#configuring-accelerators-with-optional-dependencies so that for thecu214
extra uv should just install whatever it gets from PyPI, i.e. CPU for Mac and Windows.Now running
uv sync --extra cpu
with uv 0.5.4 on Ubuntu results in:The text was updated successfully, but these errors were encountered: