Skip to content

Commit e072336

Browse files
Update Introduction docs page to "Lightning in 2 Steps" (#12357)
Co-authored-by: Aki Nitta <[email protected]>
1 parent 1dc57f9 commit e072336

File tree

3 files changed

+78
-85
lines changed

3 files changed

+78
-85
lines changed

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Welcome to PyTorch Lightning
1515
1616
.. customcalloutitem::
1717
:description: Learn how to leverage the PyTorch Lightning features for your Machine Learning projects with ease in this quickstart guide.
18-
:header: Introduction
18+
:header: Lightning in 2 Steps
1919
:button_link: starter/introduction.html
2020
:button_text: Get started with PyTorch Lightning
2121

docs/source/starter/installation.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,8 @@ Installation
66

77
--------------
88

9-
******************
10-
Lightning Coverage
11-
******************
12-
13-
PyTorch Lightning is maintained and tested on different Python and PyTorch versions.
14-
15-
Check out the `CI Coverage <https://github.com/PyTorchLightning/pytorch-lightning#continuous-integration>`_ for more info.
16-
17-
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.
18-
TPU py3.7 means we support Colab and Kaggle env. IPU tests run on MK1 IPU boxes.
19-
20-
--------------
21-
229
*********************
23-
Installation with Pip
10+
Installation with pip
2411
*********************
2512

2613
Install any supported version of PyTorch if you want from `PyTorch Installation Page <https://pytorch.org/get-started/locally/#start-locally>`_.
@@ -68,3 +55,16 @@ Install future patch releases from the source. Note that the patch release conta
6855
.. code-block:: bash
6956
7057
pip install https://github.com/PyTorchLightning/pytorch-lightning/archive/refs/heads/release/1.5.x.zip
58+
59+
--------------
60+
61+
******************
62+
Lightning Coverage
63+
******************
64+
65+
PyTorch Lightning is maintained and tested on different Python and PyTorch versions.
66+
67+
Check out the `CI Coverage <https://github.com/PyTorchLightning/pytorch-lightning#continuous-integration>`_ for more info.
68+
69+
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.
70+
TPU py3.7 means we support Colab and Kaggle env. IPU tests run on MK1 IPU boxes.

docs/source/starter/introduction.rst

Lines changed: 63 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -12,103 +12,58 @@
1212

1313
.. _new_project:
1414

15-
############
16-
Introduction
17-
############
1815

19-
**************************
20-
What is PyTorch Lightning?
21-
**************************
16+
####################
17+
Lightning in 2 Steps
18+
####################
2219

23-
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.
20+
**In this guide we'll show you how to organize your PyTorch code into Lightning in 2 steps.**
2421

25-
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.
26-
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.
22+
Organizing your code with PyTorch Lightning makes your code:
2723

28-
Code organization is the core of Lightning. It leaves the research logic to you and automates the rest.
29-
30-
----------
31-
32-
********************
33-
Lightning Philosophy
34-
********************
35-
36-
Organizing your code with Lightning makes your code:
37-
38-
* Flexible (this is all pure PyTorch), but removes a ton of boilerplate
24+
* Keep all the flexibility (this is all pure PyTorch), but removes a ton of boilerplate
3925
* More readable by decoupling the research code from the engineering
4026
* Easier to reproduce
4127
* Less error-prone by automating most of the training loop and tricky engineering
4228
* Scalable to any hardware without changing your model
4329

44-
Lightning is built for:
45-
46-
* Researchers who want to focus on research without worrying about the engineering aspects of it
47-
* ML Engineers who want to build reproducible pipelines
48-
* Data Scientists who want to try out different models for their tasks and build-in ML techniques
49-
* Educators who seek to study and teach Deep Learning with PyTorch
50-
51-
The team makes sure that all the latest techniques are already integrated and well maintained.
52-
5330

5431
----------
5532

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

57-
*****************
58-
Starter Templates
59-
*****************
35+
.. raw:: html
6036

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

63-
.. list-table::
64-
:widths: 18 15 25
65-
:header-rows: 1
40+
----------
6641

67-
* - Use case
68-
- Description
69-
- link
70-
* - Scratch model
71-
- To prototype quickly / debug with random data
72-
-
73-
.. raw:: html
42+
*********************************
43+
Step 0: Install PyTorch Lightning
44+
*********************************
7445

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

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

49+
.. code-block:: bash
9150
92-
----------
51+
pip install pytorch-lightning
9352
94-
************
95-
Installation
96-
************
53+
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/>`_):
9754

98-
Follow the :ref:`Installation Guide <installation>` to install PyTorch Lightning.
55+
.. code-block:: bash
9956
100-
----------
57+
conda install pytorch-lightning -c conda-forge
10158
102-
********************
103-
Lightning Components
104-
********************
59+
You could also use conda environments
10560

106-
Here's a 3-minute conversion guide for PyTorch projects:
61+
.. code-block:: bash
10762
108-
.. raw:: html
63+
conda activate my_env
64+
pip install pytorch-lightning
10965
110-
<video width="100%" max-width="800px" controls autoplay muted playsinline
111-
src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/pl_docs/pl_docs_animation_final.m4v"></video>
66+
----------
11267

11368
Import the following:
11469

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

643598

599+
*****************
600+
Starter Templates
601+
*****************
602+
603+
Before installing anything, use the following templates to try it out live:
604+
605+
.. list-table::
606+
:widths: 18 15 25
607+
:header-rows: 1
608+
609+
* - Use case
610+
- Description
611+
- link
612+
* - Scratch model
613+
- To prototype quickly / debug with random data
614+
-
615+
.. raw:: html
616+
617+
<div style='width:150px;height:auto'>
618+
<a href="https://colab.research.google.com/drive/1rHBxrtopwtF8iLpmC_e7yl3TeDGrseJL?usp=sharing>">
619+
<img alt="open in colab" src="http://bit.ly/pl_colab">
620+
</a>
621+
</div>
622+
* - Scratch model with manual optimization
623+
- To prototype quickly / debug with random data
624+
-
625+
.. raw:: html
626+
627+
<div style='width:150px;height:auto'>
628+
<a href="https://colab.research.google.com/drive/1nGtvBFirIvtNQdppe2xBes6aJnZMjvl8?usp=sharing">
629+
<img alt="open in colab" src="http://bit.ly/pl_colab">
630+
</a>
631+
</div>
632+
633+
634+
------------
635+
636+
644637
*******
645638
Grid AI
646639
*******

0 commit comments

Comments
 (0)