lightning/tests
Carlos Mocholí 3692eba807
Drop Python 3.6 support (#11117)
2021-12-21 17:06:15 +00:00
..
accelerators Rename `TPUSpawnPlugin` to `TPUSpawnStrategy` (#11190) 2021-12-21 16:36:16 +00:00
benchmarks Rename `DDPPlugin` to `DDPStrategy` (#11142) 2021-12-21 08:55:51 +00:00
callbacks Rename the `TrainingTypePlugin` base to `Strategy` (#11120) 2021-12-20 12:50:11 +00:00
checkpointing Add required states for resumed ModelCheckpoint GC (#10995) 2021-12-20 17:05:15 +01:00
core Rename the `TrainingTypePlugin` base to `Strategy` (#11120) 2021-12-20 12:50:11 +00:00
deprecated_api Deprecate `Trainer.verbose_evaluate` (#10931) 2021-12-17 19:26:32 +01:00
helpers Prune EvalModelTemplate (#11153) 2021-12-19 13:08:43 +00:00
lite Rename DeepSpeedPlugin to DeepSpeedStrategy (#11194) 2021-12-21 15:18:01 +00:00
loggers Fixed NeptuneLogger when using DDP (#11030) 2021-12-18 01:40:13 +00:00
loops Save the loop progress state by default (#10784) 2021-12-17 16:00:27 +00:00
models Rename `TPUSpawnPlugin` to `TPUSpawnStrategy` (#11190) 2021-12-21 16:36:16 +00:00
overrides Fix retrieval of batch indices when dataloader num_workers > 0 (#10870) 2021-12-02 10:36:10 +00:00
plugins Rename `TPUSpawnPlugin` to `TPUSpawnStrategy` (#11190) 2021-12-21 16:36:16 +00:00
profiler Rename `DDPPlugin` to `DDPStrategy` (#11142) 2021-12-21 08:55:51 +00:00
trainer Drop Python 3.6 support (#11117) 2021-12-21 17:06:15 +00:00
tuner Prune EvalModelTemplate (1/n) (#10969) 2021-12-07 18:04:06 +00:00
utilities Drop Python 3.6 support (#11117) 2021-12-21 17:06:15 +00:00
README.md
__init__.py
conftest.py Drop Python 3.6 support (#11117) 2021-12-21 17:06:15 +00:00
standalone_tests.sh Fix selection of standalone tests (#10857) 2021-12-01 09:48:37 +01:00

README.md

PyTorch-Lightning Tests

Most PL tests train a full MNIST model under various trainer conditions (ddp, ddp2+amp, etc...). This provides testing for most combinations of important settings. The tests expect the model to perform to a reasonable degree of testing accuracy to pass.

Running tests

git clone https://github.com/PyTorchLightning/pytorch-lightning
cd pytorch-lightning

# install dev deps
pip install -r requirements/devel.txt

# run tests
py.test -v

To test models that require GPU make sure to run the above command on a GPU machine. The GPU machine must have at least 2 GPUs to run distributed tests.

Note that this setup will not run tests that require specific packages installed such as Horovod, FairScale, NVIDIA/apex, NVIDIA/DALI, etc. You can rely on our CI to make sure all these tests pass.

Running Coverage

Make sure to run coverage on a GPU machine with at least 2 GPUs and NVIDIA apex installed.

cd pytorch-lightning

# generate coverage (coverage is also installed as part of dev dependencies under requirements/devel.txt)
coverage run --source pytorch_lightning -m py.test pytorch_lightning tests examples -v

# print coverage stats
coverage report -m

# exporting results
coverage xml

Building test image

You can build it on your own, note it takes lots of time, be prepared.

git clone <git-repository>
docker image build -t pytorch_lightning:devel-torch1.9 -f dockers/cuda-extras/Dockerfile --build-arg TORCH_VERSION=1.9 .

To build other versions, select different Dockerfile.

docker image list
docker run --rm -it pytorch_lightning:devel-torch1.9 bash
docker image rm pytorch_lightning:devel-torch1.9