Skip to content

Commit e1b698c

Browse files
committed
Merge branch 'master' into ruff/100
2 parents 21dca9a + e3b6af5 commit e1b698c

16 files changed

+55
-51
lines changed

.github/workflows/ci-pkg-install.yml

-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ jobs:
7171
pkg-folder: dist/${{ env.PKG_DIR }}
7272
pkg-name: ${{ matrix.pkg-name }}
7373
pkg-extra: ${{ matrix.pkg-extra }}
74-
pip-flags: "--pre" # todo: drop this when `lidata` is released (not as RC only)
7574

7675
- name: Run CLI (via python)
7776
if: ${{ (matrix.pkg-name == 'lightning' || matrix.pkg-name == 'notset') && matrix.pkg-extra == 'app' }}

.pre-commit-config.yaml

+7-2
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,18 @@ repos:
7171
additional_dependencies: [tomli]
7272
args: ["--in-place"]
7373

74+
- repo: https://github.com/sphinx-contrib/sphinx-lint
75+
rev: v0.9.1
76+
hooks:
77+
- id: sphinx-lint
78+
7479
- repo: https://github.com/astral-sh/ruff-pre-commit
7580
rev: "v0.2.0"
7681
hooks:
77-
- id: ruff
78-
args: ["--fix", "--preview"]
7982
- id: ruff-format
8083
args: ["--preview"]
84+
- id: ruff
85+
args: ["--fix", "--preview"]
8186

8287
- repo: https://github.com/executablebooks/mdformat
8388
rev: 0.7.17

docs/source-app/core_api/lightning_app/communication_content.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ And here's the output you get when running the App using the **Lightning CLI**:
8787

8888
.. code-block:: console
8989
90-
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
91-
State: {'works': {'w': {'vars': {'counter': 1}}}}
92-
State: {'works': {'w': {'vars': {'counter': 2}}}}
93-
State: {'works': {'w': {'vars': {'counter': 3}}}}
94-
State: {'works': {'w': {'vars': {'counter': 3}}}}
95-
State: {'works': {'w': {'vars': {'counter': 4}}}}
96-
...
90+
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
91+
State: {'works': {'w': {'vars': {'counter': 1}}}}
92+
State: {'works': {'w': {'vars': {'counter': 2}}}}
93+
State: {'works': {'w': {'vars': {'counter': 3}}}}
94+
State: {'works': {'w': {'vars': {'counter': 3}}}}
95+
State: {'works': {'w': {'vars': {'counter': 4}}}}
96+
...
9797
9898
----
9999

docs/source-app/core_api/lightning_app/dynamic_work_content.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ There are a couple of ways you can add a dynamic Work:
4141
def run(self):
4242
4343
if not hasattr(self, "work"):
44-
# The `Work` component is created and attached here.
44+
# The `Work` component is created and attached here.
4545
setattr(self, "work", Work())
46-
# Run the `Work` component.
46+
# Run the `Work` component.
4747
getattr(self, "work").run()
4848
4949
**OPTION 2:** Use the built-in Lightning classes :class:`~lightning.app.structures.Dict` or :class:`~lightning.app.structures.List`
@@ -60,7 +60,7 @@ There are a couple of ways you can add a dynamic Work:
6060
6161
def run(self):
6262
if "work" not in self.dict:
63-
# The `Work` component is attached here.
63+
# The `Work` component is attached here.
6464
self.dict["work"] = Work()
6565
self.dict["work"].run()
6666

docs/source-app/glossary/environment_variables.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Environment variables are available in all Flows and Works, and can be accessed
2424
print(os.environ["BAZ"]) # FAZ
2525
2626
.. note::
27-
Environment variables are not encrypted. For sensitive values, we recommend using :ref:`Encrypted Secrets <secrets>`.
27+
Environment variables are not encrypted. For sensitive values, we recommend using :ref:`Encrypted Secrets <secrets>`.

docs/source-app/glossary/secrets.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Encrypted Secrets allow you to pass private data to your apps, like API keys, ac
88
Secrets provide you with a secure way to store this data in a way that is accessible to Apps so that they can authenticate third-party services/solutions.
99

1010
.. tip::
11-
For non-sensitive configuration values, we recommend using :ref:`plain-text Environment Variables <environment_variables>`.
11+
For non-sensitive configuration values, we recommend using :ref:`plain-text Environment Variables <environment_variables>`.
1212

1313
************
1414
Add a secret

docs/source-app/glossary/sharing_components.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Now, imagine you have implemented a **KerasScriptRunner** component for training
3434

3535
Here are the best practices steps before sharing the component:
3636

37-
* **Testing**: Ensure your component is well tested by following the ref:`../testing` guide.
37+
* **Testing**: Ensure your component is well tested by following the :doc:`../testing` guide.
3838
* **Documented**: Ensure your component has a docstring and comes with some usage explications.
3939

4040
.. Note:: As a Lightning user, it helps to implement your components thinking someone else is going to use them.

docs/source-app/workflows/access_app_state.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ And here's the output you get when running the App using **Lightning CLI**:
5050

5151
.. code-block:: console
5252
53-
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
54-
State: {'works': {'w': {'vars': {'counter': 1}}}}
55-
State: {'works': {'w': {'vars': {'counter': 2}}}}
56-
State: {'works': {'w': {'vars': {'counter': 3}}}}
57-
State: {'works': {'w': {'vars': {'counter': 3}}}}
58-
State: {'works': {'w': {'vars': {'counter': 4}}}}
59-
...
53+
INFO: Your app has started. View it in your browser: http://127.0.0.1:7501/view
54+
State: {'works': {'w': {'vars': {'counter': 1}}}}
55+
State: {'works': {'w': {'vars': {'counter': 2}}}}
56+
State: {'works': {'w': {'vars': {'counter': 3}}}}
57+
State: {'works': {'w': {'vars': {'counter': 3}}}}
58+
State: {'works': {'w': {'vars': {'counter': 4}}}}
59+
...

docs/source-app/workflows/add_web_ui/react/communicate_between_react_and_lightning.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Update React <-- Lightning app
4747
******************************
4848
To change the React app from the Lightning app, use the values from the `lightningState`.
4949

50-
In this example, when the `react_ui.counter`` increaes in the Lightning app:
50+
In this example, when the ``react_ui.counter`` increaes in the Lightning app:
5151

5252
.. literalinclude:: ../../../../../src/lightning/app/cli/react-ui-template/example_app.py
5353
:emphasize-lines: 18, 24

docs/source-pytorch/advanced/post_training_quantization.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ Usage
5555

5656
Minor code changes are required for the user to get started with Intel® Neural Compressor quantization API. To construct the quantization process, users can specify the below settings via the Python code:
5757

58-
1. Calibration Dataloader (Needed for post-training static quantization)
59-
2. Evaluation Dataloader and Metric
58+
1. Calibration Dataloader (Needed for post-training static quantization)
59+
2. Evaluation Dataloader and Metric
6060

6161
The code changes that are required for Intel® Neural Compressor are highlighted with comments in the line above.
6262

docs/source-pytorch/data/alternatives.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ As datasets grow in size and the number of nodes scales, loading training data c
3232
The `StreamingDataset <https://github.com/mosaicml/streaming>`__ can make training on large datasets from cloud storage
3333
as fast, cheap, and scalable as possible.
3434

35-
This library uses a custom built class:`~torch.utils.data.IterableDataset`. The library recommends iterating through it
36-
via a regular class:`~torch.utils.data.DataLoader`. This means that support in the ``Trainer`` is seamless:
35+
This library uses a custom built :class:`~torch.utils.data.IterableDataset`. The library recommends iterating through it
36+
via a regular :class:`~torch.utils.data.DataLoader`. This means that support in the ``Trainer`` is seamless:
3737

3838
.. code-block:: python
3939

docs/source-pytorch/ecosystem/asr_nlp_tts.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ Hydra makes every aspect of the NeMo model, including the PyTorch Lightning Trai
660660
Using State-Of-The-Art Pre-trained TTS Model
661661
--------------------------------------------
662662

663-
Generate speech using models trained on `LJSpeech <https://keithito.com/LJ-Speech-Dataset/>`,
663+
Generate speech using models trained on `LJSpeech <https://keithito.com/LJ-Speech-Dataset/>`_,
664664
around 24 hours of single speaker data.
665665

666666
See this `TTS notebook <https://github.com/NVIDIA/NeMo/blob/v1.0.0b1/tutorials/tts/1_TTS_inference.ipynb>`_

docs/source-pytorch/tuning/profiler_basic.rst

+16-16
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ Once the **.fit()** function has completed, you'll see an output like this:
3131
3232
FIT Profiler Report
3333
34-
-----------------------------------------------------------------------------------------------
35-
| Action | Mean duration (s) | Total time (s) |
36-
-----------------------------------------------------------------------------------------------
37-
| [LightningModule]BoringModel.prepare_data | 10.0001 | 20.00 |
38-
| run_training_epoch | 6.1558 | 6.1558 |
39-
| run_training_batch | 0.0022506 | 0.015754 |
40-
| [LightningModule]BoringModel.optimizer_step | 0.0017477 | 0.012234 |
41-
| [LightningModule]BoringModel.val_dataloader | 0.00024388 | 0.00024388 |
42-
| on_train_batch_start | 0.00014637 | 0.0010246 |
43-
| [LightningModule]BoringModel.teardown | 2.15e-06 | 2.15e-06 |
44-
| [LightningModule]BoringModel.on_train_start | 1.644e-06 | 1.644e-06 |
45-
| [LightningModule]BoringModel.on_train_end | 1.516e-06 | 1.516e-06 |
46-
| [LightningModule]BoringModel.on_fit_end | 1.426e-06 | 1.426e-06 |
47-
| [LightningModule]BoringModel.setup | 1.403e-06 | 1.403e-06 |
48-
| [LightningModule]BoringModel.on_fit_start | 1.226e-06 | 1.226e-06 |
49-
-----------------------------------------------------------------------------------------------
34+
-------------------------------------------------------------------------------------------
35+
| Action | Mean duration (s) | Total time (s) |
36+
-------------------------------------------------------------------------------------------
37+
| [LightningModule]BoringModel.prepare_data | 10.0001 | 20.00 |
38+
| run_training_epoch | 6.1558 | 6.1558 |
39+
| run_training_batch | 0.0022506 | 0.015754 |
40+
| [LightningModule]BoringModel.optimizer_step | 0.0017477 | 0.012234 |
41+
| [LightningModule]BoringModel.val_dataloader | 0.00024388 | 0.00024388 |
42+
| on_train_batch_start | 0.00014637 | 0.0010246 |
43+
| [LightningModule]BoringModel.teardown | 2.15e-06 | 2.15e-06 |
44+
| [LightningModule]BoringModel.on_train_start | 1.644e-06 | 1.644e-06 |
45+
| [LightningModule]BoringModel.on_train_end | 1.516e-06 | 1.516e-06 |
46+
| [LightningModule]BoringModel.on_fit_end | 1.426e-06 | 1.426e-06 |
47+
| [LightningModule]BoringModel.setup | 1.403e-06 | 1.403e-06 |
48+
| [LightningModule]BoringModel.on_fit_start | 1.226e-06 | 1.226e-06 |
49+
-------------------------------------------------------------------------------------------
5050
5151
In this report we can see that the slowest function is **prepare_data**. Now you can figure out why data preparation is slowing down your training.
5252

docs/source-pytorch/upgrade/sections/1_7_advanced.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@
103103
- `PR11871`_
104104

105105
* - used ``Trainer.validated_ckpt_path`` attribute
106-
- rely on generic read-only property ``Trainer.ckpt_path`` which is set when checkpoints are loaded via ``Trainer.validate(````ckpt_path=...)``
106+
- rely on generic read-only property ``Trainer.ckpt_path`` which is set when checkpoints are loaded via ``Trainer.validate(ckpt_path=...)``
107107
- `PR11696`_
108108

109109
* - used ``Trainer.tested_ckpt_path`` attribute
110-
- rely on generic read-only property ``Trainer.ckpt_path`` which is set when checkpoints are loaded via ``Trainer.test(````ckpt_path=...)``
110+
- rely on generic read-only property ``Trainer.ckpt_path`` which is set when checkpoints are loaded via ``Trainer.test(ckpt_path=...)``
111111
- `PR11696`_
112112

113113
* - used ``Trainer.predicted_ckpt_path`` attribute
114-
- rely on generic read-only property ``Trainer.ckpt_path``, which is set when checkpoints are loaded via ``Trainer.predict(````ckpt_path=...)``
114+
- rely on generic read-only property ``Trainer.ckpt_path``, which is set when checkpoints are loaded via ``Trainer.predict(ckpt_path=...)``
115115
- `PR11696`_
116116

117117
* - rely on the returned dictionary from ``Callback.on_save_checkpoint``

docs/source-pytorch/upgrade/sections/1_9_devel.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
- use DDP instead
2727
- `PR16386`_ :doc:`DDP <../../accelerators/gpu_expert>`
2828

29-
* - used the pl.plugins.ApexMixedPrecisionPlugin`` plugin
29+
* - used the ``pl.plugins.ApexMixedPrecisionPlugin`` plugin
3030
- use PyTorch native mixed precision
3131
- `PR16039`_
3232

docs/source-pytorch/upgrade/sections/1_9_regular.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@
3939
- `PR16184`_
4040

4141
* - called the ``pl.tuner.auto_gpu_select.pick_single_gpu`` function
42-
- use Trainer’s flag``devices="auto"``
42+
- use Trainer’s flag ``devices="auto"``
4343
- `PR16184`_
4444

4545
* - called the ``pl.tuner.auto_gpu_select.pick_multiple_gpus`` functions
46-
- use Trainer’s flag``devices="auto"``
46+
- use Trainer’s flag ``devices="auto"``
4747
- `PR16184`_
4848

4949
* - used Trainer’s flag ``accumulate_grad_batches`` with a scheduling dictionary value

0 commit comments

Comments
 (0)