add version for CPU users (#4794)

This commit is contained in:
Jirka Borovec 2020-11-20 21:32:13 +01:00 committed by GitHub
parent 500e2853f3
commit b10b11deb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View File

@ -115,6 +115,7 @@ Simple installation from PyPI
```bash
pip install pytorch-lightning
```
_To get full package experience you can install also all optional dependencies with `pytorch-lightning['extra']` or for CPU users with `pytorch-lightning['cpu-extra']`._
From Conda
```bash

View File

@ -73,6 +73,16 @@ extras = {
extras['dev'] = extras['extra'] + extras['loggers'] + extras['test']
extras['all'] = extras['dev'] + extras['examples'] # + extras['docs']
# These packages shall be installed only on GPU machines
PACKAGES_GPU_ONLY = (
'horovod',
)
# create a version for CPU machines
for ex in ('cpu', 'cpu-extra'):
kw = ex.split('-')[1] if '-' in ex else 'all'
# filter cpu only packages
extras[ex] = [pkg for pkg in extras[kw] if not any(pgpu.lower() in pkg.lower() for pgpu in PACKAGES_GPU_ONLY)]
# https://packaging.python.org/discussions/install-requires-vs-requirements /
# keep the meta-data here for simplicity in reading this file... it's not obvious
# what happens and to non-engineers they won't know to look in init ...