-
Notifications
You must be signed in to change notification settings - Fork 59
Avoid installing CUDA related stuff #1246
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
base: main
Are you sure you want to change the base?
Conversation
QiliangCui
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoid installing CUDA will be great!!
Can we do this change after #1245 so that we can have a cleaner base to diff?
If I remember correctly, GitHub will update the diff in related PRs automatically if some commits in the PRs are already existed in target branch. Let's just wait another PR to be merged first. :D |
Seems that my understanding was wrong when the repo enable linear-history, it results in conflict state. |
e1d7815 to
48f2560
Compare
- Use PyTorch CPU version so we avoid installing CUDA. Signed-off-by: Weida Hong <[email protected]>
|
Fixes #921 |
|
No, this change does not fix #921, which requires the PyPI It's by design that there is and no way to propagate index url information through the standard Python package metadata *1, so even when we specify And for existing version (before this PR), users can install
*1: I may be wrong about this claim, maybe we need other experienced engineer to validate my conclusion here. To solve 921 completely, we probably need to push PyTorch to release something like |
|
Ah got it. Thanks for clarifying it! |
Description
Avoid installing CUDA related stuff
This modification keeps the functionality and reduce image size by about 7.7GB.
See official doc for recommended way to install CPU version of PyTorch.
The
pip listoutput before and after generate following diffWith
--extra-index-url,pipnow can see cuda version and cpu version,and the cpu version has higher priority.
torchpackage on Linux platform be the cuda-ready one,and put the cpu-ready version on https://download.pytorch.org/whl/cpu.
(this is not true on macOS and Windows)
--index-url,pipwill install the+cpuversion, since that the index urlis now the only search space for this
pipinvocation,+...is called the local version identifier.--extra-index-urlhere so that we can install torch+cpuversion while install otherpackages in the
requirements.txtfile in onepipinvocation Fortorchandtorchvision,we use packages from https://download.pytorch.org/whl/cpu, and for other packages, we use packages
from PyPI directly.
pipcan see PyTorch2.8.0and2.8.0+cpuat the same time, but because the one with local versiontag has higher priority,
2.8.0+cpuis installed.From PEP440
Tests
Build the image and run benchmarking in the container.
Checklist
Before submitting this PR, please make sure: