lightning/tests
Carlos Mocholí 6ce77a102b
Set minimum PyTorch version to 1.6 (#8288)
Co-authored-by: Jirka <jirka.borovec@seznam.cz>
2021-07-13 17:12:49 +00:00
..
accelerators Add support for (accelerator='cpu'|'gpu'|'tpu'|'ipu'|'auto') (#7808) 2021-07-09 15:28:54 +00:00
base Merge pull request #7872 from PyTorchLightning/refactor/logger-poc-changes 2021-06-08 09:04:16 -04:00
callbacks Set minimum PyTorch version to 1.6 (#8288) 2021-07-13 17:12:49 +00:00
checkpointing Add `ModelCheckpoint(save_on_train_epoch_end)` (#8389) 2021-07-13 14:47:59 +00:00
core Add `ModelCheckpoint(save_on_train_epoch_end)` (#8389) 2021-07-13 14:47:59 +00:00
deprecated_api `every_n_val_epochs` -> `every_n_epochs` (#8383) 2021-07-13 01:20:20 +02:00
helpers Add the `on_before_backward` hook (#7865) 2021-07-09 06:15:57 +00:00
loggers Set minimum PyTorch version to 1.6 (#8288) 2021-07-13 17:12:49 +00:00
loops [Refactor] Improve loops API 1/n (#8334) 2021-07-12 11:13:50 +00:00
metrics Add missing logging tests (#8195) 2021-06-29 22:52:50 +00:00
models Set minimum PyTorch version to 1.6 (#8288) 2021-07-13 17:12:49 +00:00
overrides Remove unnecessary use of comprehension (#8149) 2021-06-27 10:00:02 +01:00
plugins Add LSF support (#5102) 2021-07-09 16:14:26 +02:00
profiler Set minimum PyTorch version to 1.6 (#8288) 2021-07-13 17:12:49 +00:00
trainer Set minimum PyTorch version to 1.6 (#8288) 2021-07-13 17:12:49 +00:00
tuner Remove unnecessary use of comprehension (#8149) 2021-06-27 10:00:02 +01:00
utilities Expose `extract_batch_size` method and add corresponding tests. (#8357) 2021-07-13 11:35:10 +00:00
README.md Set minimum PyTorch version to 1.6 (#8288) 2021-07-13 17:12:49 +00:00
__init__.py
collect_env_details.py
conftest.py Support `DDPPlugin` to be used on CPU (#6208) 2021-07-02 12:00:24 +01:00
mnode_tests.txt
special_tests.sh XLA Profiler integration (#8014) 2021-06-29 00:58:05 +05:30

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