From 01e70fc6de11b51f8bf7da1a18e2288fe12b0d4b Mon Sep 17 00:00:00 2001 From: Kaushik B Date: Thu, 17 Mar 2022 17:02:17 +0400 Subject: [PATCH 1/2] Update Introduction docs page --- docs/source/index.rst | 2 +- docs/source/starter/installation.rst | 28 +++--- docs/source/starter/introduction.rst | 133 +++++++++++++-------------- 3 files changed, 78 insertions(+), 85 deletions(-) diff --git a/docs/source/index.rst b/docs/source/index.rst index d02eff4fb225a..d220c6c236fec 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -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 diff --git a/docs/source/starter/installation.rst b/docs/source/starter/installation.rst index d823ab2e0786c..65202205d771c 100644 --- a/docs/source/starter/installation.rst +++ b/docs/source/starter/installation.rst @@ -6,21 +6,8 @@ Installation -------------- -****************** -Lightning Coverage -****************** - -PyTorch Lightning is maintained and tested on different Python and PyTorch versions. - -Check out the `CI Coverage `_ 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 `_. @@ -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 `_ 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. diff --git a/docs/source/starter/introduction.rst b/docs/source/starter/introduction.rst index e4f9166cb4844..baf7276f3a1e6 100644 --- a/docs/source/starter/introduction.rst +++ b/docs/source/starter/introduction.rst @@ -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: + -.. 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 +********************************* -
- - open in colab - -
- * - Scratch model with manual optimization - - To prototype quickly / debug with random data - - - .. raw:: html -
- - open in colab - -
+You can install using `pip `_ +.. code-block:: bash ----------- + pip install pytorch-lightning -************ -Installation -************ +Or with `conda `_ (see how to install conda `here `_): -Follow the :ref:`Installation Guide ` 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 - +---------- Import the following: @@ -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 + +
+ + open in colab + +
+ * - Scratch model with manual optimization + - To prototype quickly / debug with random data + - + .. raw:: html + +
+ + open in colab + +
+ + +------------ + + ******* Grid AI ******* From ee613c7848474a7cd00582f5fde7e41f154d6811 Mon Sep 17 00:00:00 2001 From: Kaushik B <45285388+kaushikb11@users.noreply.github.com> Date: Sat, 19 Mar 2022 01:14:52 +0400 Subject: [PATCH 2/2] Update docs/source/starter/introduction.rst Co-authored-by: Aki Nitta --- docs/source/starter/introduction.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/starter/introduction.rst b/docs/source/starter/introduction.rst index baf7276f3a1e6..791f71d14f222 100644 --- a/docs/source/starter/introduction.rst +++ b/docs/source/starter/introduction.rst @@ -14,7 +14,7 @@ #################### -Lightning in 2 steps +Lightning in 2 Steps #################### **In this guide we'll show you how to organize your PyTorch code into Lightning in 2 steps.**