Skip to content

Update Introduction docs page to "Lightning in 2 Steps" #12357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Welcome to PyTorch Lightning

.. customcalloutitem::
:description: Learn how to leverage the PyTorch Lightning features for your Machine Learning projects with ease in this quickstart guide.
:header: Introduction
:header: Lightning in 2 Steps
:button_link: starter/introduction.html
:button_text: Get started with PyTorch Lightning

Expand Down
28 changes: 14 additions & 14 deletions docs/source/starter/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,8 @@ Installation

--------------

******************
Lightning Coverage
******************

PyTorch Lightning is maintained and tested on different Python and PyTorch versions.

Check out the `CI Coverage <https://github.com/PyTorchLightning/pytorch-lightning#continuous-integration>`_ for more info.

It is rigorously tested across multiple GPUs, TPUs, CPUs and IPUs. GPU tests run on two NVIDIA P100. TPU tests run on Google GKE TPUv2/3.
TPU py3.7 means we support Colab and Kaggle env. IPU tests run on MK1 IPU boxes.

--------------

*********************
Installation with Pip
Installation with pip
*********************

Install any supported version of PyTorch if you want from `PyTorch Installation Page <https://pytorch.org/get-started/locally/#start-locally>`_.
Expand Down Expand Up @@ -68,3 +55,16 @@ Install future patch releases from the source. Note that the patch release conta
.. code-block:: bash

pip install https://github.com/PyTorchLightning/pytorch-lightning/archive/refs/heads/release/1.5.x.zip

--------------

******************
Lightning Coverage
******************

PyTorch Lightning is maintained and tested on different Python and PyTorch versions.

Check out the `CI Coverage <https://github.com/PyTorchLightning/pytorch-lightning#continuous-integration>`_ for more info.

It is rigorously tested across multiple GPUs, TPUs, CPUs and IPUs. GPU tests run on two NVIDIA P100. TPU tests run on Google GKE TPUv2/3.
TPU py3.7 means we support Colab and Kaggle env. IPU tests run on MK1 IPU boxes.
133 changes: 63 additions & 70 deletions docs/source/starter/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,103 +12,58 @@

.. _new_project:

############
Introduction
############

**************************
What is PyTorch Lightning?
**************************
####################
Lightning in 2 Steps
####################

PyTorch Lightning provides you with the APIs required to build models, datasets, and so on. PyTorch has all you need to train your models; however, there’s much more to deep learning than attaching layers. When it comes to the actual training, there’s a lot of boilerplate code that you need to write, and if you need to scale your training/inferencing on multiple devices/machines, there’s another set of integrations you might need to do.
**In this guide we'll show you how to organize your PyTorch code into Lightning in 2 steps.**

PyTorch Lightning solves these for you. All you need is to restructure some of your existing code, set certain flags, and then you are done.
Now you can train your models on different accelerators like GPU/TPU/IPU, to do distributed training across multiple machines/nodes without code changes using state-of-the-art distributed training mechanisms.
Organizing your code with PyTorch Lightning makes your code:

Code organization is the core of Lightning. It leaves the research logic to you and automates the rest.

----------

********************
Lightning Philosophy
********************

Organizing your code with Lightning makes your code:

* Flexible (this is all pure PyTorch), but removes a ton of boilerplate
* Keep all the flexibility (this is all pure PyTorch), but removes a ton of boilerplate
* More readable by decoupling the research code from the engineering
* Easier to reproduce
* Less error-prone by automating most of the training loop and tricky engineering
* Scalable to any hardware without changing your model

Lightning is built for:

* Researchers who want to focus on research without worrying about the engineering aspects of it
* ML Engineers who want to build reproducible pipelines
* Data Scientists who want to try out different models for their tasks and build-in ML techniques
* Educators who seek to study and teach Deep Learning with PyTorch

The team makes sure that all the latest techniques are already integrated and well maintained.


----------

Here's a 3 minute conversion guide for PyTorch projects:

*****************
Starter Templates
*****************
.. raw:: html

Before installing anything, use the following templates to try it out live:
<video width="100%" max-width="800px" controls autoplay muted playsinline
src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/pl_docs/pl_docs_animation_final.m4v"></video>

.. list-table::
:widths: 18 15 25
:header-rows: 1
----------

* - Use case
- Description
- link
* - Scratch model
- To prototype quickly / debug with random data
-
.. raw:: html
*********************************
Step 0: Install PyTorch Lightning
*********************************

<div style='width:150px;height:auto'>
<a href="https://colab.research.google.com/drive/1rHBxrtopwtF8iLpmC_e7yl3TeDGrseJL?usp=sharing>">
<img alt="open in colab" src="http://bit.ly/pl_colab">
</a>
</div>
* - Scratch model with manual optimization
- To prototype quickly / debug with random data
-
.. raw:: html

<div style='width:150px;height:auto'>
<a href="https://colab.research.google.com/drive/1nGtvBFirIvtNQdppe2xBes6aJnZMjvl8?usp=sharing">
<img alt="open in colab" src="http://bit.ly/pl_colab">
</a>
</div>
You can install using `pip <https://pypi.org/project/pytorch-lightning/>`_

.. code-block:: bash

----------
pip install pytorch-lightning

************
Installation
************
Or with `conda <https://anaconda.org/conda-forge/pytorch-lightning>`_ (see how to install conda `here <https://docs.conda.io/projects/conda/en/latest/user-guide/install/>`_):

Follow the :ref:`Installation Guide <installation>` to install PyTorch Lightning.
.. code-block:: bash

----------
conda install pytorch-lightning -c conda-forge

********************
Lightning Components
********************
You could also use conda environments

Here's a 3-minute conversion guide for PyTorch projects:
.. code-block:: bash

.. raw:: html
conda activate my_env
pip install pytorch-lightning

<video width="100%" max-width="800px" controls autoplay muted playsinline
src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/pl_docs/pl_docs_animation_final.m4v"></video>
----------

Import the following:

Expand Down Expand Up @@ -641,6 +596,44 @@ Read our :doc:`Guide <../starter/core_guide>` to learn more with a step-by-step
-------------


*****************
Starter Templates
*****************

Before installing anything, use the following templates to try it out live:

.. list-table::
:widths: 18 15 25
:header-rows: 1

* - Use case
- Description
- link
* - Scratch model
- To prototype quickly / debug with random data
-
.. raw:: html

<div style='width:150px;height:auto'>
<a href="https://colab.research.google.com/drive/1rHBxrtopwtF8iLpmC_e7yl3TeDGrseJL?usp=sharing>">
<img alt="open in colab" src="http://bit.ly/pl_colab">
</a>
</div>
* - Scratch model with manual optimization
- To prototype quickly / debug with random data
-
.. raw:: html

<div style='width:150px;height:auto'>
<a href="https://colab.research.google.com/drive/1nGtvBFirIvtNQdppe2xBes6aJnZMjvl8?usp=sharing">
<img alt="open in colab" src="http://bit.ly/pl_colab">
</a>
</div>


------------


*******
Grid AI
*******
Expand Down