lightning/docs/source-app/examples/dag/dag.rst

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

82 lines
2.2 KiB
ReStructuredText
Raw Normal View History

docs updates 1/n (#15473) * docs * docs updates * docs updates * docs updates * docs updates * d * d * d * d * d * d * ?? * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d1 * d * d * d * d * d * d * d * d * d * d * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * new title * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * only select from parent * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * use OSS template * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * only select from parent * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update docs/README.md Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: William Falcon <williamfalcon@Williams-MacBook-Pro-2.local> Co-authored-by: William Falcon <williamfalcon@Williams-MBP-2.lan> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
2022-11-03 14:55:30 +00:00
:orphan:
######################################
Develop a Directed Acyclic Graph (DAG)
######################################
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
.. _dag_example:
**Audience:** Users coming from MLOps to Lightning Apps, looking for more flexibility.
A typical ML training workflow can be implemented with a simple DAG.
Below is a pseudo-code using the lightning framework that uses a LightningFlow to orchestrate the serial workflow: process data, train a model, and serve the model.
.. code-block:: python
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
import lightning as L
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
class DAGFlow(L.LightningFlow):
def __init__(self):
super().__init__()
self.processor = DataProcessorWork(...)
self.train_work = TrainingWork(...)
self.serve_work = ServeWork(...)
def run(self):
self.processor.run(...)
self.train_work.run(...)
self.serve_work.run(...)
Below is a pseudo-code to run several works in parallel using a built-in :class:`~lightning.app.structures.Dict`.
.. code-block:: python
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
import lightning as L
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
class DAGFlow(L.LightningFlow):
def __init__(self):
super().__init__()
...
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
self.train_works = L.structures.Dict(**{
"1": TrainingWork(..., parallel=True),
"2": TrainingWork(..., parallel=True),
"3": TrainingWork(..., parallel=True),
...
})
...
def run(self):
self.processor.run(...)
# The flow runs through them all, so we need to guard self.serve_work.run
for work in self.train_works.values():
work.run(...)
# Wait for all to have finished without errors.
if not all(w.has_succeeded for w in self.train_works):
continue
self.serve_work.run(...)
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
----
**********
Add `lightning_app` docs (#13656) * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update latest docs * remove image * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * ci * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * make * Update .gitignore Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * Update .github/workflows/docs-deploy.yml Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * Update docs/source-app/_templates/theme_variables.jinja Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/api_reference/api_references.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/code_samples/convert_pl_to_app/train.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server_app_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/get_started/training_with_apps.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/hpo/hpo.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/communication_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_2.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/github_repo_runner_step_4.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/model_server_app/model_server.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * Update docs/source-app/core_api/lightning_app/dynamic_work_content.rst Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * Update docs/source-app/examples/github_repo_runner/app.py Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com> * update * update * update * update * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update * update Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka <jirka.borovec@seznam.cz> Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com> Co-authored-by: Rohit Gupta <rohitgr1998@gmail.com>
2022-07-15 12:45:50 +00:00
Next Steps
**********
.. raw:: html
<div class="display-card-container">
<div class="row">
.. displayitem::
:header: Scheduled DAG with pandas and sklearn from scratch.
:description: DAG example in pure Lightning.
:col_css: col-md-4
:button_link: dag_from_scratch.html
:height: 180
:tag: intermediate