-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Pytorch downgrades to a lower version #6880
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
Comments
Example of downgrading torch (and installing cuda extensions which are not needed)
|
This doesn't work today with |
@charliermarsh how do I respect pyproject.toml and use project setup features? I thought of switching to uv as a project management tool (similar to poetry or rye if that matter). Will |
Yeah E.g., activate that virtual environment, then run |
@charliermarsh This doesn't work
It still installs torch==2.4.0 even though it's not in the dependencies of pyproject.toml I verified that inside this venv torch is installed |
@charliermarsh I have tried to set
but it can't be resolved
|
@thepowerfuldeez -- If you're trying to use packages from the system Python, you'll need to use |
@charliermarsh Thank you so much! It works now! So the solution is not using lockfile for now, right? |
Unfortunately yes. We'll need to think on how to solve this properly. |
I'm gonna leave the issue open but might tweak the title and add some more details on the underlying problem, if that's ok. |
I had the same issue with poetry some time ago: python-poetry/poetry#6035 (resolved by python-poetry/poetry#8359). Note |
@charliermarsh it seems like there might be a real issue to track here? |
Yeah. The system packages aren't taken into account. |
I think this is related to
Do we need to re-triage this or can we close in favor of the other issue? |
I think it's a bit different... We don't even provide a way for users to tell us to look at already-installed packages, much less system packages. Whereas #4466 is about respecting |
@charliermarsh Could you open an issue that describes what change would be needed for this issue? (even if it's brief) |
@zanieb would be great to have a solution for using existing docker images from nvidia (as it contains cuda, cudnn, flash_attn, triton, bitsandbytes, nccl, latest pytorch where some of such libraries need to be compiled from source) and still using lockfile with high level uv sync interface that would install dependencies on top of the existing system packages. |
@zanieb +1 to the suggestion by @thepowerfuldeez. Multiple software teams that I work with have this problem with NVIDIA containers, in particular the PyTorch one. As @thepowerfuldeez notes, these containers contain libraries that are compiled from source to ensure they are optimized for GPUs. Thus, installing a pip version of the same library should be avoided. |
Yeah we want to solve that problem, but it's not trivial. |
Just to chime in with a specific use case, we use |
Just to help ppl working with containers, here's the solution I found some time ago: |
Hi! Is there functionality to ignore dependencies if they are already exist in the system python?
I am using
nvcr.io/nvidia/pytorch:24.08-py3
docker image which haspytorch==2.5.0a0+872d972e41.nv24.08
installedI followed guide from here to enable system python via
UV_SYSTEM_PYTHON=1
and I havepyproject.toml
that includes packages that I've put from requirements.txt and madeuv lock
.But now I see that it's been resolved with
torch==2.4.0
and when I runuv sync
my pytorch gets downgraded to2.4.0
which is unexpected.I have tried to manually remove all pytorch dependencies from lockfile and run
uv sync
from that state, but for some reason now it suceeds with installing only 4 of 126 packages (and they are just file packagesfrom file://...
defined in pyproject.toml)I've tried using
uv sync --frozen
uv sync --locked
and tried creatinguv sync
with different variations but haven't suceeded yet. To be frankpip install -r requirements.txt
would also downgrade mytorch
unless I makepip freeze > requirements.txt
and install with-r --no-deps
but this is not favorable.I generally lack understanding of such intricacies and I've noticed that other people stumble with flash-attn installation or CUDA extensions. I wonder what's the best way to handle such conflicts?
Thank you very much for modern replacement of pip!
The text was updated successfully, but these errors were encountered: