From 54147e074521f08a74e430acdaa677423e899db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20W=C3=A4lchli?= Date: Mon, 6 Mar 2023 16:13:51 +0100 Subject: [PATCH] Update Fabric docs navigation (#16957) --- .gitignore | 2 +- .../advanced/distributed_communication.rst | 2 - .../advanced/gradient_accumulation.rst | 2 - docs/source-fabric/api/fabric_args.rst | 2 - docs/source-fabric/api/fabric_methods.rst | 2 - docs/source-fabric/api/utilities.rst | 2 - docs/source-fabric/api_reference.rst | 18 ++- docs/source-fabric/examples/index.rst | 59 ++++++++ .../fundamentals/accelerators.rst | 2 - .../fundamentals/code_structure.rst | 2 - docs/source-fabric/fundamentals/convert.rst | 2 - docs/source-fabric/fundamentals/launch.rst | 2 - docs/source-fabric/fundamentals/notebooks.rst | 2 - docs/source-fabric/fundamentals/precision.rst | 2 - docs/source-fabric/guide/callbacks.rst | 2 - docs/source-fabric/guide/checkpoint.rst | 2 - docs/source-fabric/guide/lightning_module.rst | 2 - docs/source-fabric/guide/logging.rst | 2 - docs/source-fabric/guide/trainer_template.rst | 2 - docs/source-fabric/index.rst | 134 +++++------------- 20 files changed, 107 insertions(+), 138 deletions(-) create mode 100644 docs/source-fabric/examples/index.rst diff --git a/.gitignore b/.gitignore index f5864e578ddea..68004fa79eda1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ docs/source-pytorch/notebooks docs/source-pytorch/_static/images/course_UvA-DL docs/source-pytorch/_static/images/lightning_examples -docs/source-fabric/api +docs/source-fabric/*/generated # C extensions *.so diff --git a/docs/source-fabric/advanced/distributed_communication.rst b/docs/source-fabric/advanced/distributed_communication.rst index 5bbff312ea341..5635d19051962 100644 --- a/docs/source-fabric/advanced/distributed_communication.rst +++ b/docs/source-fabric/advanced/distributed_communication.rst @@ -1,5 +1,3 @@ -:orphan: - ########################################### Communication between distributed processes ########################################### diff --git a/docs/source-fabric/advanced/gradient_accumulation.rst b/docs/source-fabric/advanced/gradient_accumulation.rst index d893e42fd2982..0fb5a3197882c 100644 --- a/docs/source-fabric/advanced/gradient_accumulation.rst +++ b/docs/source-fabric/advanced/gradient_accumulation.rst @@ -1,5 +1,3 @@ -:orphan: - ############################### Efficient Gradient Accumulation ############################### diff --git a/docs/source-fabric/api/fabric_args.rst b/docs/source-fabric/api/fabric_args.rst index eb7a7916c13df..dfa3e77c34618 100644 --- a/docs/source-fabric/api/fabric_args.rst +++ b/docs/source-fabric/api/fabric_args.rst @@ -1,5 +1,3 @@ -:orphan: - ################ Fabric Arguments ################ diff --git a/docs/source-fabric/api/fabric_methods.rst b/docs/source-fabric/api/fabric_methods.rst index b26c834f04384..1df5aa5391860 100644 --- a/docs/source-fabric/api/fabric_methods.rst +++ b/docs/source-fabric/api/fabric_methods.rst @@ -1,5 +1,3 @@ -:orphan: - ############## Fabric Methods ############## diff --git a/docs/source-fabric/api/utilities.rst b/docs/source-fabric/api/utilities.rst index 978f7599096c1..3d7864a4085a6 100644 --- a/docs/source-fabric/api/utilities.rst +++ b/docs/source-fabric/api/utilities.rst @@ -1,5 +1,3 @@ -:orphan: - ################ Fabric Utilities ################ diff --git a/docs/source-fabric/api_reference.rst b/docs/source-fabric/api_reference.rst index 13cc0207d13ad..1e64f7313c87a 100644 --- a/docs/source-fabric/api_reference.rst +++ b/docs/source-fabric/api_reference.rst @@ -1,5 +1,3 @@ -:orphan: - .. include:: links.rst ############# @@ -13,7 +11,7 @@ Fabric .. currentmodule:: lightning.fabric.fabric .. autosummary:: - :toctree: api + :toctree: api/generated :nosignatures: :template: classtemplate.rst @@ -26,7 +24,7 @@ Accelerators .. currentmodule:: lightning.fabric.accelerators .. autosummary:: - :toctree: api + :toctree: api/generated :nosignatures: :template: classtemplate.rst @@ -43,7 +41,7 @@ Loggers .. currentmodule:: lightning.fabric.loggers .. autosummary:: - :toctree: api + :toctree: api/generated :nosignatures: :template: classtemplate.rst @@ -59,7 +57,7 @@ Precision .. currentmodule:: lightning.fabric.plugins.precision .. autosummary:: - :toctree: api + :toctree: api/generated :nosignatures: :template: classtemplate.rst @@ -77,7 +75,7 @@ Environments .. currentmodule:: lightning.fabric.plugins.environments .. autosummary:: - :toctree: api + :toctree: api/generated :nosignatures: :template: classtemplate_noindex.rst @@ -97,7 +95,7 @@ IO .. currentmodule:: lightning.fabric.plugins.io .. autosummary:: - :toctree: api + :toctree: api/generated :nosignatures: :template: classtemplate.rst @@ -112,7 +110,7 @@ Collectives .. currentmodule:: lightning.fabric.plugins.collectives .. autosummary:: - :toctree: api + :toctree: api/generated :nosignatures: :template: classtemplate.rst @@ -129,7 +127,7 @@ Strategies .. currentmodule:: lightning.fabric.strategies .. autosummary:: - :toctree: api + :toctree: api/generated :nosignatures: :template: classtemplate.rst diff --git a/docs/source-fabric/examples/index.rst b/docs/source-fabric/examples/index.rst new file mode 100644 index 0000000000000..fdc1b6ef725ca --- /dev/null +++ b/docs/source-fabric/examples/index.rst @@ -0,0 +1,59 @@ +######## +Examples +######## + +.. raw:: html + +
+
+ +.. displayitem:: + :header: Image Classification + :description: Train an image classifier on the MNIST dataset + :button_link: https://github.com/Lightning-AI/lightning/blob/master/examples/fabric/image_classifier + :col_css: col-md-4 + :height: 150 + :tag: basic + +.. displayitem:: + :header: GAN + :description: Train a GAN that generates realistic human faces + :button_link: https://github.com/Lightning-AI/lightning/blob/master/examples/fabric/dcgan + :col_css: col-md-4 + :height: 150 + :tag: intermediate + +.. displayitem:: + :header: Meta-Learning + :description: Distributed training with the MAML algorithm on the Omniglot and MiniImagenet datasets + :button_link: https://github.com/Lightning-AI/lightning/blob/master/examples/fabric/meta_learning + :col_css: col-md-4 + :height: 150 + :tag: intermediate + +.. displayitem:: + :header: Large Language Models + :description: Pre-train a GPT-2 language model on OpenWebText data + :button_link: https://github.com/Lightning-AI/nanoGPT/blob/master/train_fabric.py + :col_css: col-md-4 + :height: 150 + :tag: advanced + +.. displayitem:: + :header: Reinforcement Learning + :description: Implementation of the Proximal Policy Optimization (PPO) algorithm with multi-GPU support + :button_link: https://github.com/Lightning-AI/lightning/blob/master/examples/fabric/reinforcement_learning + :col_css: col-md-4 + :height: 150 + +.. displayitem:: + :header: Active Learning + :description: Coming soon + :col_css: col-md-4 + :height: 150 + + +.. raw:: html + +
+
diff --git a/docs/source-fabric/fundamentals/accelerators.rst b/docs/source-fabric/fundamentals/accelerators.rst index b010a1ab1c534..47c2e0f4d4d3a 100644 --- a/docs/source-fabric/fundamentals/accelerators.rst +++ b/docs/source-fabric/fundamentals/accelerators.rst @@ -1,5 +1,3 @@ -:orphan: - ################################ Accelerate your code with Fabric ################################ diff --git a/docs/source-fabric/fundamentals/code_structure.rst b/docs/source-fabric/fundamentals/code_structure.rst index baebbc366d60d..4991c25458236 100644 --- a/docs/source-fabric/fundamentals/code_structure.rst +++ b/docs/source-fabric/fundamentals/code_structure.rst @@ -1,5 +1,3 @@ -:orphan: - ###################################### How to structure your code with Fabric ###################################### diff --git a/docs/source-fabric/fundamentals/convert.rst b/docs/source-fabric/fundamentals/convert.rst index 55cbd8226334e..92c2aeb7c2ba2 100644 --- a/docs/source-fabric/fundamentals/convert.rst +++ b/docs/source-fabric/fundamentals/convert.rst @@ -1,5 +1,3 @@ -:orphan: - ############################## Convert PyTorch code to Fabric ############################## diff --git a/docs/source-fabric/fundamentals/launch.rst b/docs/source-fabric/fundamentals/launch.rst index ab9d1c9649326..cc673a45c3b94 100644 --- a/docs/source-fabric/fundamentals/launch.rst +++ b/docs/source-fabric/fundamentals/launch.rst @@ -1,5 +1,3 @@ -:orphan: - ########################### Launch distributed training ########################### diff --git a/docs/source-fabric/fundamentals/notebooks.rst b/docs/source-fabric/fundamentals/notebooks.rst index 0cbb0537274ba..7cc9fab679017 100644 --- a/docs/source-fabric/fundamentals/notebooks.rst +++ b/docs/source-fabric/fundamentals/notebooks.rst @@ -1,5 +1,3 @@ -:orphan: - .. _Fabric in Notebooks: ################### diff --git a/docs/source-fabric/fundamentals/precision.rst b/docs/source-fabric/fundamentals/precision.rst index 5f8cb65322563..ab6ffa863e0ca 100644 --- a/docs/source-fabric/fundamentals/precision.rst +++ b/docs/source-fabric/fundamentals/precision.rst @@ -1,5 +1,3 @@ -:orphan: - ################################ Save memory with mixed precision ################################ diff --git a/docs/source-fabric/guide/callbacks.rst b/docs/source-fabric/guide/callbacks.rst index 5985ebbd59c62..4e92875c98974 100644 --- a/docs/source-fabric/guide/callbacks.rst +++ b/docs/source-fabric/guide/callbacks.rst @@ -1,5 +1,3 @@ -:orphan: - ######### Callbacks ######### diff --git a/docs/source-fabric/guide/checkpoint.rst b/docs/source-fabric/guide/checkpoint.rst index 40c4eca0bebbc..8528145c650c7 100644 --- a/docs/source-fabric/guide/checkpoint.rst +++ b/docs/source-fabric/guide/checkpoint.rst @@ -1,5 +1,3 @@ -:orphan: - ############################## Saving and Loading Checkpoints ############################## diff --git a/docs/source-fabric/guide/lightning_module.rst b/docs/source-fabric/guide/lightning_module.rst index fec49b1427481..662bee9c16c06 100644 --- a/docs/source-fabric/guide/lightning_module.rst +++ b/docs/source-fabric/guide/lightning_module.rst @@ -1,5 +1,3 @@ -:orphan: - ################## Organize Your Code ################## diff --git a/docs/source-fabric/guide/logging.rst b/docs/source-fabric/guide/logging.rst index 6bb9902f8a8ed..36b951337320c 100644 --- a/docs/source-fabric/guide/logging.rst +++ b/docs/source-fabric/guide/logging.rst @@ -1,5 +1,3 @@ -:orphan: - ############################### Track and Visualize Experiments ############################### diff --git a/docs/source-fabric/guide/trainer_template.rst b/docs/source-fabric/guide/trainer_template.rst index c893f3edc0a5a..4ef97805a4e93 100644 --- a/docs/source-fabric/guide/trainer_template.rst +++ b/docs/source-fabric/guide/trainer_template.rst @@ -1,5 +1,3 @@ -:orphan: - ################ Template Trainer ################ diff --git a/docs/source-fabric/index.rst b/docs/source-fabric/index.rst index 40cd97c0bf92d..0846cd8c0d9f7 100644 --- a/docs/source-fabric/index.rst +++ b/docs/source-fabric/index.rst @@ -240,116 +240,60 @@ Advanced Topics ---- -.. _Fabric Examples: - -******** -Examples -******** - .. raw:: html -
-
+
-.. displayitem:: - :header: Image Classification - :description: Train an image classifier on the MNIST dataset - :button_link: https://github.com/Lightning-AI/lightning/blob/master/examples/fabric/image_classifier - :col_css: col-md-4 - :height: 150 - :tag: basic -.. displayitem:: - :header: GAN - :description: Train a GAN that generates realistic human faces - :button_link: https://github.com/Lightning-AI/lightning/blob/master/examples/fabric/dcgan - :col_css: col-md-4 - :height: 150 - :tag: intermediate +.. toctree:: + :maxdepth: 1 + :name: start + :caption: Fundamentals -.. displayitem:: - :header: Meta-Learning - :description: Distributed training with the MAML algorithm on the Omniglot and MiniImagenet datasets - :button_link: https://github.com/Lightning-AI/lightning/blob/master/examples/fabric/meta_learning - :col_css: col-md-4 - :height: 150 - :tag: intermediate + Getting Started + Accelerators + Code Structure + Launch Distributed Training + Fabric in Notebooks + Mixed Precision Training -.. displayitem:: - :header: Large Language Models - :description: Pre-train a GPT-2 language model on OpenWebText data - :button_link: https://github.com/Lightning-AI/nanoGPT/blob/master/train_fabric.py - :col_css: col-md-4 - :height: 150 - :tag: advanced +.. toctree:: + :maxdepth: 1 + :name: byot + :caption: Build Your Own Trainer -.. displayitem:: - :header: Reinforcement Learning - :description: Implementation of the Proximal Policy Optimization (PPO) algorithm with multi-GPU support - :button_link: https://github.com/Lightning-AI/lightning/blob/master/examples/fabric/reinforcement_learning - :col_css: col-md-4 - :height: 150 + The LightningModule + Callbacks + Logging + Checkpoints + Trainer Template -.. displayitem:: - :header: Active Learning - :description: Coming soon - :col_css: col-md-4 - :height: 150 +.. toctree:: + :maxdepth: 1 + :name: advanced + :caption: Advanced Topics + Efficient Gradient Accumulation + Distributed Communication +.. toctree:: + :maxdepth: 1 + :name: examples + :caption: Examples -.. raw:: html + Examples -
-
+.. toctree:: + :maxdepth: 1 + :name: api + :caption: API Reference + Fabric Arguments + Fabric Methods + Utilities + Full API Reference ----- - - -*** -API -*** - .. raw:: html -
-
- -.. displayitem:: - :header: Fabric Arguments - :description: All configuration options for the Fabric object - :button_link: api/fabric_args.html - :col_css: col-md-4 - :height: 150 - :tag: basic - -.. displayitem:: - :header: Fabric Methods - :description: Explore all methods that Fabric offers - :button_link: api/fabric_methods.html - :col_css: col-md-4 - :height: 150 - :tag: basic - -.. displayitem:: - :header: Utilities - :description: Explore utility functions that make your life easier - :button_link: api/utilities.html - :col_css: col-md-4 - :height: 150 - :tag: basic - -.. displayitem:: - :header: Full API Reference - :description: Reference of all public classes, methods and functions. Useful for developers. - :button_link: api_reference.html - :col_css: col-md-4 - :height: 150 - :tag: intermediate - -.. raw:: html - -