Skip to content

Commit 934f022

Browse files
committed
Merge branch 'master' into patch-1
2 parents 65eca2b + a611de0 commit 934f022

File tree

67 files changed

+1452
-299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1452
-299
lines changed

.azure/gpu-tests-pytorch.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pr:
3131
- "src/lightning/pytorch/**"
3232
- "src/pytorch_lightning/*"
3333
- "tests/tests_pytorch/**"
34+
- "tests/run_standalone_*.sh"
3435
- "pyproject.toml" # includes pytest config
3536
- "requirements/fabric/**"
3637
- "src/lightning/fabric/**"

.github/CODEOWNERS

Lines changed: 20 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,49 +5,36 @@
55
# the repo. Unless a later match takes precedence,
66
# @global-owner1 and @global-owner2 will be requested for
77
# review when someone opens a pull request.
8-
* @lantiga @borda @tchaton @awaelchli
8+
* @lantiga @borda @tchaton @awaelchli @justusschock
99

1010
# CI/CD and configs
11-
/.actions/ @borda @carmocca @ethanwharris @justusschock
12-
/.github/ @borda @carmocca @ethanwharris @justusschock
13-
/.azure/ @borda @carmocca @ethanwharris @justusschock
11+
/.actions/ @borda @ethanwharris @justusschock
12+
/.github/ @borda @ethanwharris @justusschock
13+
/.azure/ @borda @ethanwharris @justusschock
1414
/.azure/app-cloud-e2e.yml @awaelchli @ethanwharris @lantiga
15-
/dockers/ @borda @carmocca @ethanwharris @justusschock
16-
*.yml @borda @carmocca @ethanwharris @justusschock
15+
/dockers/ @borda @ethanwharris @justusschock
16+
*.yml @borda @ethanwharris @justusschock
1717

1818
# Docs
19-
/docs/ @edenlightning @lantiga @borda @awaelchli
20-
/docs/*/conf.py @borda @awaelchli @carmocca
21-
/.github/*.md @edenlightning @williamfalcon @lantiga @borda
22-
/.github/ISSUE_TEMPLATE/ @edenlightning @borda @tchaton @awaelchli
23-
/docs/source-fabric/conf.py @borda @awaelchli @carmocca
24-
/docs/source-fabric/index.rst @awaelchli @lantiga @carmocca
25-
/docs/source-pytorch/conf.py @borda @awaelchli @carmocca
19+
/docs/ @lantiga @borda @awaelchli
20+
/docs/*/conf.py @borda @awaelchli
21+
/.github/*.md @williamfalcon @lantiga @borda
22+
/.github/ISSUE_TEMPLATE/ @borda @tchaton @awaelchli
23+
/docs/source-fabric/conf.py @borda @awaelchli
24+
/docs/source-fabric/index.rst @awaelchli @lantiga
25+
/docs/source-pytorch/conf.py @borda @awaelchli
2626
/docs/source-pytorch/index.rst @williamfalcon @lantiga
2727
/docs/source-pytorch/levels @williamfalcon @lantiga
28-
/docs/source-app/ @williamfalcon @lantiga @tchaton @awaelchli
29-
/docs/source-app/index.rst @williamfalcon @lantiga
30-
/docs/source-app/expertise_levels @williamfalcon @lantiga
28+
/docs/source-app/ @williamfalcon @lantiga @tchaton
3129

3230
# PyTorch Lightning
33-
/src/lightning/pytorch @williamfalcon @awaelchli @carmocca @justusschock
34-
/src/pytorch_lightning @williamfalcon @awaelchli @carmocca @justusschock
35-
/tests/tests_pytorch @awaelchli @carmocca @justusschock @borda
36-
37-
# Core APIs
38-
/src/lightning/pytorch/callbacks/callback.py @williamfalcon @awaelchli @carmocca
39-
/src/lightning/pytorch/core/datamodule.py @williamFalcon @awaelchli @carmocca
40-
/src/lightning/pytorch/trainer/trainer.py @williamfalcon @tchaton @awaelchli @carmocca
41-
/src/lightning/pytorch/core/hooks.py @williamfalcon @tchaton @awaelchli @carmocca
42-
/src/lightning/pytorch/core/module.py @williamfalcon @tchaton @awaelchli @carmocca
31+
/src/lightning/pytorch @lantiga @borda @tchaton @awaelchli @justusschock
4332

4433
# Lightning Data
45-
/src/lightning/data/ @tchaton
34+
/src/lightning/data/ @tchaton @lantiga
4635

4736
# Lightning Fabric
48-
/src/lightning/fabric @awaelchli @carmocca @justusschock
49-
/src/lightning_fabric @awaelchli @carmocca @justusschock
50-
/tests/tests_fabric @awaelchli @carmocca @justusschock
37+
/src/lightning/fabric @lantiga @borda @tchaton @awaelchli @justusschock
5138

5239
# Lightning App
5340
/src/lightning/app @tchaton @lantiga @awaelchli @ethanwharris
@@ -59,8 +46,8 @@
5946
/.github/CODEOWNERS @williamfalcon
6047
/SECURITY.md @williamfalcon @lantiga
6148
/README.md @williamfalcon @lantiga
62-
/setup.py @williamfalcon @borda @carmocca
63-
/src/pytorch_lightning/__about__.py @williamfalcon @borda @carmocca
49+
/setup.py @williamfalcon @borda
50+
/src/pytorch_lightning/__about__.py @williamfalcon @borda
6451
/src/lightning_app/__about__.py @williamfalcon @lantiga @borda
6552
/src/lightning_fabric/__about__.py @williamfalcon @borda @awaelchli
66-
/src/*/__setup__.py @borda @carmocca @justusschock
53+
/src/*/__setup__.py @borda @justusschock

.github/CONTRIBUTING.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ To build the documentation locally, simply execute the following commands from p
121121

122122
All added or edited code shall be the own original work of the particular contributor.
123123
If you use some third-party implementation, all such blocks/functions/modules shall be properly referred and if possible also agreed by code's author. For example - `This code is inspired from http://...`.
124-
In case you adding new dependencies, make sure that they are compatible with the actual PyTorch Lightning license (ie. dependencies should be _at least_ as permissive as the PyTorch Lightning license).
124+
In case you are adding new dependencies, make sure that they are compatible with the actual PyTorch Lightning license (i.e. dependencies should be _at least_ as permissive as the PyTorch Lightning license).
125125

126126
### Coding Style
127127

128-
1. Use f-strings for output formation (except logging when we stay with lazy `logging.info("Hello %s!", name)`.
128+
1. Use f-strings for output formation (except logging when we stay with lazy `logging.info("Hello %s!", name)`).
129129
1. You can use [pre-commit](https://pre-commit.com/) to make sure your code style is correct.
130130

131131
### Documentation
@@ -234,9 +234,9 @@ Here are tutorials:
234234

235235
Here is the process to create a new test
236236

237-
- 0. Optional: Follow tutorials !
238-
- 1. Find a file in tests/ which match what you want to test. If none, create one.
239-
- 2. Use this template to get started !
237+
- 0. Optional: Follow tutorials!
238+
- 1. Find a file in tests/ which matches what you want to test. If none, create one.
239+
- 2. Use this template to get started!
240240
- 3. Use **BoringModel and derivates to test out your code**.
241241

242242
```python

.github/checkgroup.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ subprojects:
6060
- "src/lightning/pytorch/**"
6161
- "src/pytorch_lightning/*"
6262
- "tests/tests_pytorch/**"
63+
- "tests/run_standalone_*.sh"
6364
- "pyproject.toml" # includes pytest config
6465
- "requirements/fabric/**"
6566
- "src/lightning/fabric/**"
@@ -201,14 +202,14 @@ subprojects:
201202
- ".azure/gpu-tests-fabric.yml"
202203
- "examples/fabric/**"
203204
- "examples/run_fabric_examples.sh"
204-
- "tests/run_standalone_*.sh"
205205
- "requirements/fabric/**"
206206
- "src/lightning/__init__.py"
207207
- "src/lightning/__setup__.py"
208208
- "src/lightning/__version__.py"
209209
- "src/lightning/fabric/**"
210210
- "src/lightning_fabric/*"
211211
- "tests/tests_fabric/**"
212+
- "tests/run_standalone_*.sh"
212213
- "pyproject.toml" # includes pytest config
213214
- "!requirements/*/docs.txt"
214215
- "!*.md"

.github/workflows/docs-build.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,14 @@ jobs:
108108
- name: Full build for deployment
109109
if: github.event_name != 'pull_request'
110110
run: echo "DOCS_FETCH_ASSETS=1" >> $GITHUB_ENV
111+
- name: Build without warnings
112+
if: github.event_name != 'workflow_dispatch'
113+
run: echo "BUILD_SPHINX_OPTS=-W --keep-going" >> $GITHUB_ENV
111114
- name: Make ${{ matrix.target }}
112115
working-directory: ./docs/source-${{ matrix.pkg-name }}
113116
# allow failing link check and doctest if you run with dispatch
114-
continue-on-error: ${{ (matrix.target == 'doctest' || matrix.target == 'linkcheck') && github.event_name == 'workflow_dispatch' }}
115-
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="-W --keep-going"
117+
continue-on-error: ${{ (matrix.target == 'doctest' || matrix.target == 'linkcheck') && github.event_name == 'workflow_dispatch' }}
118+
run: make ${{ matrix.target }} --debug --jobs $(nproc) SPHINXOPTS="$BUILD_SPHINX_OPTS"
116119

117120
- name: Keep artifact
118121
if: github.event_name == 'pull_request'

docs/source-app/conf.py

Lines changed: 7 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@
4141
# The full version, including alpha/beta/rc tags
4242
release = lightning.__version__
4343

44-
# Options for the linkcode extension
45-
# ----------------------------------
46-
github_user = "Lightning-AI"
47-
github_repo = project
48-
4944
# -- Project documents -------------------------------------------------------
5045

5146
if _FETCH_S3_ASSETS:
@@ -71,7 +66,7 @@
7166
"sphinx_toolbox.collapse",
7267
"sphinx.ext.todo",
7368
"sphinx.ext.coverage",
74-
"sphinx.ext.linkcode",
69+
# "sphinx.ext.linkcode",
7570
"sphinx.ext.autosummary",
7671
"sphinx.ext.napoleon",
7772
# 'sphinxcontrib.mockautodoc', # raises error: directive 'automodule' is already registered ...
@@ -324,15 +319,6 @@ def setup(app):
324319
app.add_js_file("copybutton.js")
325320
app.add_css_file("main.css")
326321

327-
328-
# copy all notebooks to local folder
329-
path_nbs = os.path.join(_PATH_HERE, "notebooks")
330-
if not os.path.isdir(path_nbs):
331-
os.mkdir(path_nbs)
332-
for path_ipynb in glob.glob(os.path.join(_PATH_ROOT, "notebooks", "*.ipynb")):
333-
path_ipynb2 = os.path.join(path_nbs, os.path.basename(path_ipynb))
334-
shutil.copy(path_ipynb, path_ipynb2)
335-
336322
# copy all examples to local folder
337323
path_examples = os.path.join(_PATH_HERE, "..", "examples")
338324
if not os.path.isdir(path_examples):
@@ -370,44 +356,6 @@ def _package_list_from_file(file):
370356
autodoc_mock_imports = MOCK_PACKAGES
371357

372358

373-
# Resolve function
374-
# This function is used to populate the (source-app) links in the API
375-
def linkcode_resolve(domain, info):
376-
def find_source():
377-
# try to find the file and line number, based on code from numpy:
378-
# https://github.com/numpy/numpy/blob/master/doc/source/conf.py#L286
379-
obj = sys.modules[info["module"]]
380-
for part in info["fullname"].split("."):
381-
obj = getattr(obj, part)
382-
fname = inspect.getsourcefile(obj)
383-
# https://github.com/rtfd/readthedocs.org/issues/5735
384-
if any(s in fname for s in ("readthedocs", "rtfd", "checkouts")):
385-
# /home/docs/checkouts/readthedocs.org/user_builds/pytorch_lightning/checkouts/
386-
# devel/pytorch_lightning/utilities/cls_experiment.py#L26-L176
387-
path_top = os.path.abspath(os.path.join("..", "..", ".."))
388-
fname = os.path.relpath(fname, start=path_top)
389-
else:
390-
# Local build, imitate master
391-
fname = "master/" + os.path.relpath(fname, start=os.path.abspath(".."))
392-
source, lineno = inspect.getsourcelines(obj)
393-
return fname, lineno, lineno + len(source) - 1
394-
395-
if domain != "py" or not info["module"]:
396-
return None
397-
try:
398-
filename = "%s#L%d-L%d" % find_source()
399-
except Exception:
400-
filename = info["module"].replace(".", "/") + ".py"
401-
# import subprocess
402-
# tag = subprocess.Popen(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE,
403-
# universal_newlines=True).communicate()[0][:-1]
404-
branch = filename.split("/")[0]
405-
# do mapping from latest tags to master
406-
branch = {"latest": "master", "stable": "master"}.get(branch, branch)
407-
filename = "/".join([branch] + filename.split("/")[1:])
408-
return f"https://github.com/{github_user}/{github_repo}/blob/{filename}"
409-
410-
411359
autosummary_generate = True
412360

413361
autodoc_member_order = "groupwise"
@@ -456,3 +404,9 @@ def find_source():
456404

457405
# ignore all links in any CHANGELOG file
458406
linkcheck_exclude_documents = [r"^(.*\/)*CHANGELOG.*$"]
407+
408+
409+
# ignore the following relative links (false positive errors during linkcheck)
410+
linkcheck_ignore = [
411+
"https://www.openai.com/index/clip/",
412+
]

docs/source-app/get_started/what_app_can_do.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Find the `ScratchPad App <https://lightning.ai/app/hvUwbEG70B-ScratchPad%2C%20No
8585
InVideo Search (Public)
8686
***********************
8787

88-
This App lets you find anything you're looking for inside a video. The engine is powered by `Open AI CLIP <https://openai.com/blog/clip/>`_.
88+
This App lets you find anything you're looking for inside a video. The engine is powered by `Open AI CLIP <https://www.openai.com/index/clip/>`_.
8989

9090
Find the `InVideo Search App <https://lightning.ai/app/7pmQNIDxAE-InVideo%20Search>`_ on the App Gallery and the `InVideo Search App codebase. <https://github.com/Lightning-AI/LAI-InVideo-search-App>`_ in GitHub.
9191

docs/source-app/glossary/restful_api/restful_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ These methods are guidelines to organize your RESTful Services and help users un
2525
* **`PUT`:** Updates/replaces existing resources.
2626
* **`DELETE`:** Deletes resources.
2727

28-
Learn more about `HTTP Methods for RESTful Services here <https://www.restapitutorial.com/lessons/httpmethods.html#:~:text=The%20primary%20or%20most%2Dcommonly,but%20are%20utilized%20less%20frequently.>`_.
28+
Learn more about `HTTP Methods for RESTful Services here <https://www.restapitutorial.com/introduction/whatisrest>`_.
2929

3030
The Lightning App framework uses the popular `FastAPI <https://fastapi.tiangolo.com/>`_ and `Pydantic <https://pydantic-docs.helpmanual.io/>`_ frameworks under the hood. This means you can use all their features while building your App.
3131

docs/source-app/workflows/build_rest_api/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ These methods are guidelines to organize your RESTful Services and help users un
2525
* **`PUT`:** Updates/replaces existing resources.
2626
* **`DELETE`:** Deletes resources.
2727

28-
Learn more about `HTTP Methods for RESTful Services here <https://www.restapitutorial.com/lessons/httpmethods.html#:~:text=The%20primary%20or%20most%2Dcommonly,but%20are%20utilized%20less%20frequently.>`_.
28+
Learn more about `HTTP Methods for RESTful Services here <https://www.restapitutorial.com/introduction/whatisrest>`_.
2929

3030
The Lightning App framework uses the popular `FastAPI <https://fastapi.tiangolo.com/>`_ and `Pydantic <https://pydantic-docs.helpmanual.io/>`_ frameworks under the hood. This means you can use all their features while building your App.
3131

docs/source-fabric/advanced/model_parallel/tp.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ Tensor parallelism is a technique for training large models by distributing laye
66
However, for smaller models, the communication overhead may outweigh its benefits.
77
This method is most effective for models with very large layers, significantly enhancing performance and memory efficiency.
88

9-
.. note:: This is an experimental feature.
9+
.. raw:: html
10+
11+
<a target="_blank" href="https://lightning.ai/lightning-ai/studios/tensor-parallelism-supercharging-large-model-training-with-lightning-fabric">
12+
<img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio" style="width: auto; max-width: none;"/>
13+
</a>
1014

1115

1216
----
@@ -197,9 +201,10 @@ Later in the code, when you call ``fabric.setup(model)``, Fabric will apply the
197201
198202
fabric.print(f"Peak memory usage: {torch.cuda.max_memory_allocated() / 1e9:.02f} GB")
199203
200-
|
201204
202-
When measuring the peak memory consumption, we should see that doubling the number of GPUs reduces the memory consuption roughly by half:
205+
.. note:: Tensor Parallelism in Lightning Fabric as well as PyTorch is experimental. The APIs may change in the future.
206+
207+
When measuring the peak memory consumption, we should see that doubling the number of GPUs reduces the memory consumption roughly by half:
203208

204209

205210
.. list-table::

0 commit comments

Comments
 (0)