add version for CPU users (#4794)
This commit is contained in:
parent
500e2853f3
commit
b10b11deb0
|
@ -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
|
||||
|
|
10
setup.py
10
setup.py
|
@ -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 ...
|
||||
|
|
Loading…
Reference in New Issue