lightning/tests
Carlos Mocholí 368ac1c622
[CLI] Drop `ArgumentParser` when pickling and save before spawning (#8017)
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
2021-07-07 17:56:13 +00:00
..
accelerators [IPU] Allow poptorch.Options to override Trainer (#8233) 2021-07-05 13:42:00 +00:00
base Merge pull request #7872 from PyTorchLightning/refactor/logger-poc-changes 2021-06-08 09:04:16 -04:00
callbacks Default `EarlyStopping.check_on_train_epoch_end=True` (#8286) 2021-07-05 15:45:23 +02:00
checkpointing Remove magic monitor support for `ModelCheckpoint` (#8293) 2021-07-07 18:36:19 +01:00
core Enables reload of dataloaders on every n epochs from every epoch (#5043) 2021-07-07 13:10:08 +02:00
deprecated_api Remove magic monitor support for `ModelCheckpoint` (#8293) 2021-07-07 18:36:19 +01:00
helpers Nuke RPC (#8101) 2021-06-23 18:31:13 +00:00
loggers Remove magic monitor support for `ModelCheckpoint` (#8293) 2021-07-07 18:36:19 +01:00
loops Connect progress tracking dataclasses to loops (#8244) 2021-07-05 13:33:12 +02:00
metrics Add missing logging tests (#8195) 2021-06-29 22:52:50 +00:00
models Parametrize fit hook test with different precision plugins (#8070) 2021-07-05 10:50:01 +00:00
overrides Remove unnecessary use of comprehension (#8149) 2021-06-27 10:00:02 +01:00
plugins Fix `self.optimizers()` not returning a single `LightningOptimizer` (#8326) 2021-07-07 18:57:45 +02:00
profiler move profiler.step from training_step_and_backward to optimizer_step_… (#8224) 2021-07-06 13:22:10 +05:30
trainer Simplify logger connector access (#8318) 2021-07-07 14:13:30 +02:00
tuner Remove unnecessary use of comprehension (#8149) 2021-06-27 10:00:02 +01:00
utilities [CLI] Drop `ArgumentParser` when pickling and save before spawning (#8017) 2021-07-07 17:56:13 +00:00
README.md Delete unused CI scripts (#7152) 2021-04-22 03:07:48 +02:00
__init__.py fixing examples (#6600) 2021-03-20 18:58:59 +00:00
collect_env_details.py add copyright to tests (#5143) 2021-01-05 09:57:37 +01:00
conftest.py Support `DDPPlugin` to be used on CPU (#6208) 2021-07-02 12:00:24 +01:00
mnode_tests.txt Mnodes (#5020) 2021-02-04 20:55:40 +01:00
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.4 -f dockers/cuda-extras/Dockerfile --build-arg TORCH_VERSION=1.4 .

To build other versions, select different Dockerfile.

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