Dp default (#560)

* set auto dp if no backend

* fix imagenet example

* run flake8 first to fail build on syntax first
This commit is contained in:
William Falcon
2019-11-28 18:14:08 -05:00
committed by GitHub
parent d71556e7a1
commit 29122e4308
2 changed files with 9 additions and 5 deletions
+7 -3
View File
@@ -159,9 +159,13 @@ class TrainerDDPMixin(object):
self.use_ddp2 = distributed_backend == 'ddp2'
elif distributed_backend is None:
m = 'When using multiple GPUs set ' \
'Trainer(distributed_backend=dp) (or ddp)'
raise MisconfigurationException(m)
m = 'You requested multiple GPUs but did not specify a backend' \
'Trainer(distributed_backend=dp) (or ddp, ddp2)' \
'Setting distributed_backend=dp for you'
warnings.warn(m)
self.use_dp = True
self.use_ddp = False
self.use_ddp2 = False
# throw error to force user ddp or ddp2 choice
if nb_gpu_nodes > 1 and not (self.use_ddp2 or self.use_ddp): # pragma: no cover
+2 -2
View File
@@ -4,7 +4,7 @@
#
# - check-manifest
# confirm items checked into vcs are in your segdist
# - python setup.py check
# - python setup.py check
# confirm required package meta-data in setup.py
# - readme_renderer (when using a ReStructuredText README)
# confirms your long_description will render correctly on PyPI.
@@ -37,8 +37,8 @@ commands =
pip list
check-manifest --ignore requirements-ci.txt
python setup.py check --metadata --strict
coverage run --source pytorch_lightning -m py.test pytorch_lightning tests pl_examples -v --doctest-modules
flake8 .
coverage run --source pytorch_lightning -m py.test pytorch_lightning tests pl_examples -v --doctest-modules
python setup.py sdist
twine check dist/*