73cf47112e
* Gradient accumulation callback * little test case * typo * import fix * method name fix * fix epochs indexing from 1 * better code style * code style fix v2 :/ * change interface * fix Trainre new api in tests * trainer api bug fix * new raising error, new update method * extentions tests * a little better tests * typo fix * flack8 better * using scheduler for int and dict * typo * firs epoch bug fix * test update * empty dict exception * floats check * codestyle fix * grad counting test * someday, i will install normal linter * add more checks * Update test_models.py * Update test_models.py * Update test_models.py * Update test_models.py * Update test_models.py * Update test_models.py * Update test_models.py |
||
---|---|---|
.. | ||
README.md | ||
__init__.py | ||
debug.py | ||
requirements.txt | ||
test_models.py |
README.md
PyTorch-Lightning Tests
Running tests
The automatic travis tests ONLY run CPU-based tests. Although these cover most of the use cases, run on a 2-GPU machine to validate the full test-suite.
To run all tests do the following:
git clone https://github.com/williamFalcon/pytorch-lightning
cd pytorch-lightning
# install module locally
pip install -e .
# install dev deps
pip install -r requirements.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.
- NVIDIA-apex installed.
test_models.py
This file fits a tiny model on MNIST using these different set-ups.
- CPU only.
- Single GPU with DP.
- Multiple (2) GPUs using DP.
- Multiple (2) GPUs using DDP.
- Multiple (2) GPUs using DP + apex (for 16-bit precision).
- Multiple (2) GPUs using DDP + apex (for 16-bit precision).
For each set up it also tests:
- model saving.
- model loading.
- predicting with a loaded model.
- simulated save from HPC signal.
- simulated load from HPC signal.
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
pip install coverage
coverage run --source pytorch_lightning -m py.test pytorch_lightning tests examples -v --doctest-modules
# print coverage stats
coverage report -m
# exporting resulys
coverage xml
codecov -t 17327163-8cca-4a5d-86c8-ca5f2ef700bc -v