Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 2, 2021
1 parent bba9679 commit 960646c
Show file tree
Hide file tree
Showing 7 changed files with 486 additions and 531 deletions.
20 changes: 10 additions & 10 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ about: Create a report to help us improve
title: ''
labels: bug / fix, help wanted
assignees: ''

---

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->
Expand Down Expand Up @@ -46,15 +46,15 @@ python collect_env_details.py
You can also fill out the list below manually.
-->

- PyTorch Lightning Version (e.g., 1.3.0):
- PyTorch Version (e.g., 1.8)
- Python version:
- OS (e.g., Linux):
- CUDA/cuDNN version:
- GPU models and configuration:
- How you installed PyTorch (`conda`, `pip`, source):
- If compiling from source, the output of `torch.__config__.show()`:
- Any other relevant information:
- PyTorch Lightning Version (e.g., 1.3.0):
- PyTorch Version (e.g., 1.8)
- Python version:
- OS (e.g., Linux):
- CUDA/cuDNN version:
- GPU models and configuration:
- How you installed PyTorch (`conda`, `pip`, source):
- If compiling from source, the output of `torch.__config__.show()`:
- Any other relevant information:

### Additional context

Expand Down
3 changes: 1 addition & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: enhancement, help wanted
assignees: ''

---

## 🚀 Feature
Expand All @@ -27,7 +26,7 @@ assignees: ''

<!-- Add any other context or screenshots about the feature request here. -->

---
______________________________________________________________________

#### If you enjoy Lightning, check out our other projects! ⚡

Expand Down
918 changes: 424 additions & 494 deletions CHANGELOG.md

Large diffs are not rendered by default.

31 changes: 17 additions & 14 deletions dockers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ docker image build \
--build-arg PYTORCH_VERSION=1.8 \
.
```

or nightly version from Conda

```bash
git clone <git-repository>
docker image build \
Expand Down Expand Up @@ -48,6 +50,7 @@ docker image rm pytorch-lightning:latest
## Run docker image with GPUs

To run docker image with access to you GPUs you need to install

```bash
# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
Expand All @@ -69,17 +72,17 @@ docker run --rm -it --gpus all pytorchlightning/pytorch_lightning:base-cuda-py3.
Inspiration comes from https://u.group/thinking/how-to-put-jupyter-notebooks-in-a-dockerfile

1. Build the docker image:
```bash
docker image build \
-t pytorch-lightning:v1.3.1 \
-f dockers/nvidia/Dockerfile \
--build-arg LIGHTNING_VERSION=1.3.1 \
.
```
2. start the server and map ports:
```bash
docker run --rm -it --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all -p 8888:8888 pytorch-lightning:v1.3.1
```
3. Connect in local browser:
- copy the generated path e.g. `http://hostname:8888/?token=0719fa7e1729778b0cec363541a608d5003e26d4910983c6`
- replace the `hostname` by `localhost`
```bash
docker image build \
-t pytorch-lightning:v1.3.1 \
-f dockers/nvidia/Dockerfile \
--build-arg LIGHTNING_VERSION=1.3.1 \
.
```
1. start the server and map ports:
```bash
docker run --rm -it --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=all -p 8888:8888 pytorch-lightning:v1.3.1
```
1. Connect in local browser:
- copy the generated path e.g. `http://hostname:8888/?token=0719fa7e1729778b0cec363541a608d5003e26d4910983c6`
- replace the `hostname` by `localhost`
13 changes: 8 additions & 5 deletions pl_examples/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
# Examples

Our most robust examples showing all sorts of implementations
can be found in our sister library [lightning-bolts](https://lightning-bolts.readthedocs.io/en/latest/convolutional.html#gpt-2).

---
______________________________________________________________________

## Basic examples

In this folder we add 3 simple examples:

* [MNIST Classifier](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/basic_examples/simple_image_classifier.py) (defines the model inside the `LightningModule`).
* [Image Classifier](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/basic_examples/backbone_image_classifier.py) (trains arbitrary datasets with arbitrary backbones).
* [Autoencoder](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/basic_examples/autoencoder.py) (shows how the `LightningModule` can be used as a system)
- [MNIST Classifier](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/basic_examples/simple_image_classifier.py) (defines the model inside the `LightningModule`).
- [Image Classifier](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/basic_examples/backbone_image_classifier.py) (trains arbitrary datasets with arbitrary backbones).
- [Autoencoder](https://github.com/PyTorchLightning/pytorch-lightning/blob/master/pl_examples/basic_examples/autoencoder.py) (shows how the `LightningModule` can be used as a system)

---
______________________________________________________________________

## Domain examples

This folder contains older examples. You should instead use the examples
in [lightning-bolts](https://lightning-bolts.readthedocs.io/en/latest/convolutional.html#gpt-2)
for advanced use cases.
26 changes: 20 additions & 6 deletions pl_examples/basic_examples/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
## Basic Examples

Use these examples to test how lightning works.

#### MNIST

Trains MNIST where the model is defined inside the `LightningModule`.

```bash
# cpu
python simple_image_classifier.py
Expand All @@ -14,17 +17,23 @@ python simple_image_classifier.py --trainer.gpus 2
python simple_image_classifier.py --trainer.gpus 2 --trainer.accelerator 'dp'
```

---
______________________________________________________________________

#### MNIST with DALI

The MNIST example above using [NVIDIA DALI](https://developer.nvidia.com/DALI).
Requires NVIDIA DALI to be installed based on your CUDA version, see [here](https://docs.nvidia.com/deeplearning/dali/user-guide/docs/installation.html).

```bash
python dali_image_classifier.py
```

---
______________________________________________________________________

#### Image classifier

Generic image classifier with an arbitrary backbone (ie: a simple system)

```bash
# cpu
python backbone_image_classifier.py
Expand All @@ -36,9 +45,12 @@ python backbone_image_classifier.py --trainer.gpus 2
python backbone_image_classifier.py --trainer.gpus 2 --trainer.accelerator 'dp'
```

---
______________________________________________________________________

#### Autoencoder

Showing the power of a system... arbitrarily complex training loops

```bash
# cpu
python autoencoder.py
Expand All @@ -49,12 +61,14 @@ python autoencoder.py --trainer.gpus 2
# dataparallel
python autoencoder.py --trainer.gpus 2 --trainer.accelerator 'dp'
```
---

______________________________________________________________________

# Multi-node example

This demo launches a job using 2 GPUs on 2 different nodes (4 GPUs total).
To run this demo do the following:

1. Log into the jumphost node of your SLURM-managed cluster.
2. Create a conda environment with Lightning and a GPU PyTorch version.
3. Choose a script to submit
1. Create a conda environment with Lightning and a GPU PyTorch version.
1. Choose a script to submit
6 changes: 6 additions & 0 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# 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

```bash
git clone https://github.com/PyTorchLightning/pytorch-lightning
cd pytorch-lightning
Expand All @@ -23,6 +25,7 @@ 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.

```bash
Expand All @@ -41,11 +44,14 @@ coverage xml
## Building test image

You can build it on your own, note it takes lots of time, be prepared.

```bash
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.

```bash
docker image list
docker run --rm -it pytorch_lightning:devel-torch1.9 bash
Expand Down

0 comments on commit 960646c

Please sign in to comment.