From 4d3a8c25d2c32bdf7cde9d9e671aa3f232480e9a Mon Sep 17 00:00:00 2001 From: William Falcon Date: Sat, 5 Oct 2019 14:13:55 -0400 Subject: [PATCH] cleaned up demos --- examples/README.md | 11 +++++++++ examples/basic_examples/README.md | 40 +++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 examples/README.md create mode 100644 examples/basic_examples/README.md diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000000..443a15f703 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,11 @@ +# Examples +This folder has 3 sections: + +### Domain templates +These are templates to show common approaches such as GANs and RL. + +### Basic examples +These show the most common use of Lightning for either CPU or GPU training. + +### Multi-node examples +These show how to run jobs on a GPU cluster using lightning. \ No newline at end of file diff --git a/examples/basic_examples/README.md b/examples/basic_examples/README.md new file mode 100644 index 0000000000..f23be2df43 --- /dev/null +++ b/examples/basic_examples/README.md @@ -0,0 +1,40 @@ +# Basic Examples +Use these examples to test how lightning works. + +### Test on CPU +```bash +python cpu_template.py +``` + +### Test on GPUs +This demo can train on a single GPU, multiple GPUs or multiple nodes by +passing in different flags. + +##### Train on a single GPU +```bash +python gpu_template.py --gpus 1 +``` + +--- +##### DataParallel (dp) +Train on multiple GPUs using DataParallel. + +```bash +python gpu_template.py --gpus 2 --distributed_backend dp +``` + +##### DistributedDataParallel (ddp) + +Train on multiple GPUs using DistributedDataParallel +```bash +python gpu_template.py --gpus 2 --distributed_backend ddp +``` + +##### DistributedDataParallel+DP (ddp2) + +Train on multiple GPUs using DistributedDataParallel + dataparallel. +On a single node, uses all GPUs for 1 model. Then shares gradient information +across nodes. +```bash +python gpu_template.py --gpus 2 --distributed_backend ddp2 +``` \ No newline at end of file