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

Fixed gpu+cpu-based installation requirements #586

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tesfaldet
Copy link
Contributor

What does this PR do?

Fixes gpu+cpu-based installation requirements in environment.yaml (conda-based install) and requirements.txt (pip-based install). Specifically, a gpu+cpu-based installation is assumed as the default method, and so for environment.yaml the necessary channels are added as well as the pytorch-cuda package. There's also an option for a cpu-only install. Similarly for a pip-based install, requirements.txt has the --extra-index-url specifier for specifying a gpu+cpu-based install or a cpu-only install, as taken from https://pytorch.org/get-started/locally/.

Before submitting

  • Did you make sure title is self-explanatory and the description concisely explains the PR?
  • Did you make sure your PR does only one thing, instead of bundling different changes together?
  • Did you list all the breaking changes introduced by this pull request?
  • Did you test your PR locally with pytest command?
  • Did you run pre-commit hooks with pre-commit run -a command?

Did you have fun?

yus

@tesfaldet
Copy link
Contributor Author

Tests can be fixed from this PR #585

@codecov-commenter
Copy link

Codecov Report

Patch and project coverage have no change.

Comparison is base (9355a5d) 83.66% compared to head (9c4f7d4) 83.66%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #586   +/-   ##
=======================================
  Coverage   83.66%   83.66%           
=======================================
  Files          11       11           
  Lines         355      355           
=======================================
  Hits          297      297           
  Misses         58       58           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +4 to +5
--extra-index-url https://download.pytorch.org/whl/cu118 # gpu+cpu installation (comment this line if doing cpu-only)
# --extra-index-url https://download.pytorch.org/whl/cpu # cpu-only installation (uncomment line if doing cpu-only)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at the https://pytorch.org/get-started/locally/, only cuda 11.8 requires those lines, while 11.7 doesn't, and 11.7 is set as default when installing through normal pip install torch.

I think there's not much point in trying to maintain those instructions for requirements.txt as they seem to regulary change every couple of weeks/months. I would rather just leave this file simple and let people figure out what they need by themselves

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you're right. Perhaps I can add a comment that at least notifies the user of this, so it's not too painful for them to modify requirements.txt or environment.yaml

@ashleve ashleve added the dependencies Pull requests that update a dependency file label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants