lightning/examples
Carlos Mocholí 174c32a9f1
Sync with master changes (#16230)
* [App] Introduce basic auth to Lightning CLI (#16105)

* Introduce basic auth to Lightning CLI for app creation

* Parsing creds added

* Adding auth field to app instance body

* Adding tests

* Adding changelog entry

* Adding more tests


* Update runtime.py

* Setting auth on update

* Fix test

* Update lightning-cloud dep

* Apply suggestions from code review

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Update runtime.py

* Fix for release

* Update base.txt

Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* docs: fix order of on_fit_start() hook (#16180)

Fixes https://github.com/Lightning-AI/lightning/issues/16170

* docs: updated broken links (#16191)

Co-authored-by: Shashwat <shashwat>
Fixes https://github.com/Lightning-AI/lightning/issues/16186

* Always use the local rank zero imports (#16178)

* update BYOC documentation with AWS details (#16044)

Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>

* Using internal ip + port in a load balancer instead of URL exposed (#16119)

Co-authored-by: thomas chaton <thomas@grid.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* Remove CUDA_LAUNCH_BLOCKING from Lite tests (#16177)

* simplify torch.Tensor (#16190)

* Fix inclusion of `model_parallel` document (#16197)

fix link to gpu/advanced section

* Update numpy requirement from <1.23.1,>=1.17.2 to >=1.17.2,<1.24.1 in /requirements (#16199)

Update numpy requirement in /requirements

Updates the requirements on [numpy](https://github.com/numpy/numpy) to permit the latest version.
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](https://github.com/numpy/numpy/compare/v1.17.2...v1.24.0)

---
updated-dependencies:
- dependency-name: numpy
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update s3fs requirement from <2022.8.3,>=2022.5.0 to >=2022.5.0,<2022.11.1 in /requirements (#16198)

Update s3fs requirement in /requirements

Updates the requirements on [s3fs](https://github.com/fsspec/s3fs) to permit the latest version.
- [Release notes](https://github.com/fsspec/s3fs/releases)
- [Changelog](https://github.com/fsspec/s3fs/blob/main/release-procedure.md)
- [Commits](https://github.com/fsspec/s3fs/compare/2022.5.0...2022.11.0)

---
updated-dependencies:
- dependency-name: s3fs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* ci: upload only with release (#16194)

* Update endpoint access examples: added info about accessing auth-protected apps (#16145)

* Skip a failing Bagua test for manual optimization (#16225)

* Fix type error when dividing chunk size in colossalai strategy (#16212)


Co-authored-by: awaelchli <aedu.waelchli@gmail.com>

* Fix DDP on XLA (#16020)

Co-authored-by: awaelchli <aedu.waelchli@gmail.com>

* Added support and test for custom artifact names in WandbLogger (#16173)

* Update ipython[all] requirement from <8.6.1 to <8.7.1 in /requirements (#16220)

Updates the requirements on [ipython[all]](https://github.com/ipython/ipython) to permit the latest version.
- [Release notes](https://github.com/ipython/ipython/releases)
- [Commits](https://github.com/ipython/ipython/compare/rel-0.8.4...8.7.0)

---
updated-dependencies:
- dependency-name: ipython[all]
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Improvements to checkpoint migration (#16233)

Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>

* Support arbitrary `Optimizable`s as optimizers (#16189)

* Differences with master

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Dmitry Frolov <dmitsf@gmail.com>
Co-authored-by: Jirka Borovec <6035284+Borda@users.noreply.github.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
Co-authored-by: David Gilbertson <gilbertson.david@gmail.com>
Co-authored-by: Shashwat Agrawal <72117025+ShashwatAgrawal20@users.noreply.github.com>
Co-authored-by: Raphael Randschau <nicolai86@users.noreply.github.com>
Co-authored-by: thomas chaton <thomas@grid.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: HELSON <c2h214748@gmail.com>
Co-authored-by: Liyang90 <liyanglu@google.com>
Co-authored-by: Manan Goel <manangoel1999@gmail.com>
Co-authored-by: Justus Schock <12886177+justusschock@users.noreply.github.com>
2023-01-04 10:58:30 -05:00
..
app_argparse Add --app_args support from the CLI (#13625) 2022-07-15 19:12:40 +01:00
app_boring Sync debug branch with master changes (#16115) 2022-12-20 09:08:27 -05:00
app_commands_and_api [App] Enable debugger with LightningApp (#15590) 2022-11-09 20:46:31 +00:00
app_components [App] Reduce import depths and add test (#15330) 2022-10-28 13:57:35 +00:00
app_dag Sync debug branch with master (#15983) 2022-12-09 16:26:07 +00:00
app_display_name Sync debug branch with master changes (#16115) 2022-12-20 09:08:27 -05:00
app_drive [App] Fix cluster logic (#15383) 2022-10-28 15:35:21 +01:00
app_hpo [App] Reduce import depths and add test (#15330) 2022-10-28 13:57:35 +00:00
app_installation_commands Sync debug branch with master changes (#16066) 2022-12-15 16:22:12 +00:00
app_justpy Add JustPy Frontend (#15002) 2022-10-27 11:48:26 -04:00
app_layout [App] Fix cluster logic (#15383) 2022-10-28 15:35:21 +01:00
app_mount Sync debug branch with master (#15983) 2022-12-09 16:26:07 +00:00
app_multi_node Sync debug branch with master changes (#16115) 2022-12-20 09:08:27 -05:00
app_payload [App] Fix cluster logic (#15383) 2022-10-28 15:35:21 +01:00
app_pickle_or_not Add lightning app examples (#13456) 2022-06-30 16:45:15 -04:00
app_server Sample datatype for Serve Component (#15623) 2022-11-10 14:39:36 -05:00
app_server_with_auto_scaler Sync debug branch with master changes (#16115) 2022-12-20 09:08:27 -05:00
app_template_streamlit_ui Sync debug branch with master (#15983) 2022-12-09 16:26:07 +00:00
app_v0 [App] Enable debugger with LightningApp (#15590) 2022-11-09 20:46:31 +00:00
app_works_on_default_machine [App] Enable debugger with LightningApp (#15590) 2022-11-09 20:46:31 +00:00
fabric Rename LightningLite (6/n) (#15982) 2022-12-09 16:38:49 +00:00
pl_basics Sync debug branch with master changes (#16133) 2022-12-21 02:15:28 +00:00
pl_bug_report Update old PL links (#13349) 2022-06-21 16:38:04 +02:00
pl_domain_templates Sync debug branch with master changes (#16133) 2022-12-21 02:15:28 +00:00
pl_fault_tolerant Future 2/n: stand-alone examples (#13294) 2022-06-15 08:53:51 -04:00
pl_hpu Sync debug branch with master changes (#16133) 2022-12-21 02:15:28 +00:00
pl_integrations Sync debug branch with master changes (#16133) 2022-12-21 02:15:28 +00:00
pl_ipu Future 2/n: stand-alone examples (#13294) 2022-06-15 08:53:51 -04:00
pl_loops Sync debug branch with master changes (#16115) 2022-12-20 09:08:27 -05:00
pl_servable_module Sync debug branch with master changes (#16133) 2022-12-21 02:15:28 +00:00
README.md Sync with master changes (#16230) 2023-01-04 10:58:30 -05:00
run_fabric_examples.sh Rename LightningLite (6/n) (#15982) 2022-12-09 16:38:49 +00:00
run_pl_examples.sh Update Lightning Lite examples (#15599) 2022-11-10 04:16:46 -05:00
test_pl_examples.py Future 2/n: stand-alone examples (#13294) 2022-06-15 08:53:51 -04:00

README.md

Examples

Our most robust examples showing all sorts of implementations can be found in our sister library Lightning Bolts.


Note that some examples may rely on new features that are only available in the development branch and may be incompatible with any releases. If you see any errors, you might want to consider switching to a version tag you would like to run examples with. For example, if you're using pytorch-lightning==1.6.4 in your environment and seeing issues, run examples of the tag 1.6.4.


Lightning Fabric Examples

We show how to accelerate your PyTorch code with Lightning Fabric with minimal code changes. You stay in full control of the training loop.


Lightning Trainer Examples

In this folder, we have 2 simple examples that showcase the power of the Lightning Trainer.


Domain Examples

This folder contains older examples. You should instead use the examples in Lightning Bolts for advanced use cases.


Basic Examples

In this folder, we have 1 simple example:


Loop examples

Contains implementations leveraging loop customization to enhance the Trainer with new optimization routines.

  • K-fold Cross Validation Loop: Implementation of cross validation in a loop and special datamodule.
  • Yield Loop: Enables yielding from the training_step like in a Python generator. Useful for automatic optimization with multiple optimizers.