lightning/tests
thomas chaton 0066ff0129
Fault Tolerant Manual: Enable the feature (#10707)
2021-11-24 17:36:08 +00:00
..
accelerators Remove redundant fit call from accelerator connector test (#10626) 2021-11-19 12:19:52 +05:30
base Deprecate `DistributedType` in favor of `StrategyType` (#10505) 2021-11-15 17:10:08 +00:00
benchmarks Move benchmarks into the test directory (#10614) 2021-11-19 03:07:33 +01:00
callbacks Move Colab setup to ProgressBar (#10542) 2021-11-23 06:16:31 +00:00
checkpointing Support special test parametrizations (#10569) 2021-11-17 15:46:14 +00:00
core Respect the passed dtype with `self.log` (#10076) 2021-11-19 15:16:33 +00:00
deprecated_api Update `LightningDataModule` docs (#10678) 2021-11-24 11:31:03 +00:00
helpers MANIFEST.in and setup.py clean-up (#7614) 2021-11-19 15:38:42 +01:00
lite Support re-instantiation for custom DataLoader in Lightning (#10680) 2021-11-24 15:58:51 +01:00
loggers Fail the test when a `DeprecationWarning` is raised (#9940) 2021-11-17 23:41:50 +01:00
loops Fix batch size extraction when set by the user in `LightningModule.log` (#10408) 2021-11-19 16:48:26 +00:00
models Update `LightningModule` docs (#10637) 2021-11-23 01:02:04 +05:30
overrides Mark accelerator connector as protected (#10032) 2021-10-25 19:24:54 +00:00
plugins Remove the "_precision" suffix from some precision plugin files (#10052) 2021-11-19 17:37:39 +00:00
profiler Fail the test when a `DeprecationWarning` is raised (#9940) 2021-11-17 23:41:50 +01:00
trainer Support re-instantiation for custom DataLoader in Lightning (#10680) 2021-11-24 15:58:51 +01:00
tuner Update tests to avoid the deprecated `weights_summary` (#10446) 2021-11-11 18:15:18 +01:00
utilities Fault Tolerant Manual: Enable the feature (#10707) 2021-11-24 17:36:08 +00:00
README.md CI: add mdformat (#8673) 2021-08-03 18:19:09 +00:00
__init__.py Replace `yapf` with `black` (#7783) 2021-07-26 13:37:35 +02:00
conftest.py Support special test parametrizations (#10569) 2021-11-17 15:46:14 +00:00
mnode_tests.txt Mnodes (#5020) 2021-02-04 20:55:40 +01:00
special_tests.sh MANIFEST.in and setup.py clean-up (#7614) 2021-11-19 15:38:42 +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