Skip to content

Commit 8623143

Browse files
awaelchlilexierule
authored andcommitted
release 2.1.4
1 parent 80c02ff commit 8623143

File tree

19 files changed

+76
-19
lines changed

19 files changed

+76
-19
lines changed

.actions/assistant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def _download_frontend(pkg_path: str, version: str = "v0.0.0"):
234234
response = urllib.request.urlopen(frontend_release_url)
235235

236236
file = tarfile.open(fileobj=response, mode="r|gz")
237-
file.extractall(path=download_dir)
237+
file.extractall(path=download_dir) # noqa: S202
238238

239239
shutil.move(download_dir, frontend_dir)
240240
print("The Lightning UI has successfully been downloaded!")
@@ -457,7 +457,7 @@ def pull_docs_files(
457457
raise RuntimeError(f"Requesting file '{zip_url}' does not exist or it is just unavailable.")
458458

459459
with zipfile.ZipFile(zip_file, "r") as zip_ref:
460-
zip_ref.extractall(tmp)
460+
zip_ref.extractall(tmp) # noqa: S202
461461

462462
zip_dirs = [d for d in glob.glob(os.path.join(tmp, "*")) if os.path.isdir(d)]
463463
# check that the extracted archive has only repo folder

docs/source-pytorch/extensions/strategy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The below table lists all relevant strategies available in Lightning with their
7777
- Strategy for multi-process single-device training on one or multiple nodes. :ref:`Learn more. <accelerators/gpu_intermediate:Distributed Data Parallel>`
7878
* - ddp_spawn
7979
- :class:`~lightning.pytorch.strategies.DDPStrategy`
80-
- Same as "ddp" but launches processes using :func:`torch.multiprocessing.spawn` method and joins processes after training finishes. :ref:`Learn more. <accelerators/gpu_intermediate:Distributed Data Parallel Spawn>`
80+
- Same as "ddp" but launches processes using ``torch.multiprocessing.spawn`` method and joins processes after training finishes. :ref:`Learn more. <accelerators/gpu_intermediate:Distributed Data Parallel Spawn>`
8181
* - deepspeed
8282
- :class:`~lightning.pytorch.strategies.DeepSpeedStrategy`
8383
- Provides capabilities to run training using the DeepSpeed library, with training optimizations for large billion parameter models. :doc:`Learn more. <../advanced/model_parallel/deepspeed>`

examples/app/hpo/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def extract_tarfile(file_path: str, extract_path: str, mode: str):
4848
if ".zip" in local_filename:
4949
if os.path.exists(local_filename):
5050
with zipfile.ZipFile(local_filename, "r") as zip_ref:
51-
zip_ref.extractall(path)
51+
zip_ref.extractall(path) # noqa: S202
5252
elif local_filename.endswith(".tar.gz") or local_filename.endswith(".tgz"):
5353
extract_tarfile(local_filename, path, "r:gz")
5454
elif local_filename.endswith(".tar.bz2") or local_filename.endswith(".tbz"):

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ ignore-init-module-imports = true
7979
".actions/*" = ["S101", "S310"]
8080
"setup.py" = ["S101"]
8181
"examples/**" = [
82+
"F841", # Local variable is assigned to but never used
8283
"S101", # Use of `assert` detected
8384
"S113", # todo: Probable use of requests call without
8485
"S104", # Possible binding to all interface
@@ -88,6 +89,7 @@ ignore-init-module-imports = true
8889
"S108", # Probable insecure usage of temporary file or directory: "/tmp/data/MNIST"
8990
]
9091
"src/**" = [
92+
"F841", # Local variable is assigned to but never used
9193
"S101", # todo: Use of `assert` detected
9294
"S105", "S106", "S107", # todo: Possible hardcoded password: ...
9395
"S113", # todo: Probable use of requests call without timeout
@@ -103,12 +105,14 @@ ignore-init-module-imports = true
103105
"RET503",
104106
]
105107
"tests/**" = [
108+
"F841", # Local variable is assigned to but never used
106109
"S101", # Use of `assert` detected
107110
"S105", "S106", # todo: Possible hardcoded password: ...
108111
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
109112
"S113", # todo: Probable use of requests call without timeout
110113
"S311", # todo: Standard pseudo-random generators are not suitable for cryptographic purposes
111114
"S108", # todo: Probable insecure usage of temporary file or directory: "/tmp/sys-customizations-sync"
115+
"S202", # Uses of `tarfile.extractall()`
112116
"S403", # `pickle`, `cPickle`, `dill`, and `shelve` modules are possibly insecure
113117
"S404", # `subprocess` module is possibly insecure
114118
"S602", # todo: `subprocess` call with `shell=True` identified, security issue

src/lightning/app/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

77

8+
## [2.1.4] - 2024-01-31
9+
10+
### Changed
11+
12+
- Remove torch distributed for the Dataset Optimizer ([#19182](https://github.com/Lightning-AI/lightning/pull/19182))
13+
14+
815
## [2.1.3] - 2023-12-21
916

1017
### Changed

src/lightning/app/cli/cmd_pl_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def download_frontend(destination: Path) -> None:
121121
with TemporaryDirectory() as download_dir:
122122
response = urllib.request.urlopen(url) # noqa: S310
123123
file = tarfile.open(fileobj=response, mode="r|gz")
124-
file.extractall(path=download_dir)
124+
file.extractall(path=download_dir) # noqa: S202
125125
shutil.move(str(Path(download_dir, build_dir_name)), destination)
126126

127127

src/lightning/app/plugin/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _run_plugin(run: _Run) -> Dict[str, Any]:
154154
logger.info("Extracting plugin source.")
155155

156156
with tarfile.open(download_path, "r:gz") as tf:
157-
tf.extractall(source_path)
157+
tf.extractall(source_path) # noqa: S202
158158
except Exception as ex:
159159
raise HTTPException(
160160
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,

src/lightning/app/storage/drive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def __str__(self) -> str:
334334

335335

336336
def _maybe_create_drive(component_name: str, state: Dict) -> Union[Dict, Drive]:
337-
if state.get("type", None) == Drive.__IDENTIFIER__:
337+
if state.get("type") == Drive.__IDENTIFIER__:
338338
drive = Drive.from_dict(state)
339339
drive.component_name = component_name
340340
return drive

src/lightning/app/utilities/packaging/cloud_compute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def from_dict(cls, d: dict) -> "CloudCompute":
156156
f"mounts argument must be one of [None, Mount, List[Mount]], "
157157
f"received {mounts} of type {type(mounts)}"
158158
)
159-
_verify_mount_root_dirs_are_unique(d.get("mounts", None))
159+
_verify_mount_root_dirs_are_unique(d.get("mounts"))
160160
return cls(**d)
161161

162162
@property
@@ -183,6 +183,6 @@ def _verify_mount_root_dirs_are_unique(mounts: Union[None, Mount, List[Mount], T
183183

184184

185185
def _maybe_create_cloud_compute(state: Dict) -> Union[CloudCompute, Dict]:
186-
if state and state.get("type", None) == __CLOUD_COMPUTE_IDENTIFIER__:
186+
if state and state.get("type") == __CLOUD_COMPUTE_IDENTIFIER__:
187187
return CloudCompute.from_dict(state)
188188
return state

src/lightning/app/utilities/packaging/lightning_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def download_frontend(root: str = _PROJECT_ROOT):
5252
response = urllib.request.urlopen(LIGHTNING_FRONTEND_RELEASE_URL) # noqa: S310
5353

5454
file = tarfile.open(fileobj=response, mode="r|gz")
55-
file.extractall(path=download_dir)
55+
file.extractall(path=download_dir) # noqa: S202
5656

5757
shutil.move(os.path.join(download_dir, build_dir), frontend_dir)
5858
print("The Lightning UI has successfully been downloaded!")

src/lightning/data/CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

77

8+
## [2.1.4] - 2024-01-31
9+
10+
### Added
11+
12+
- Added support for nested folders in map operator ([#19366](https://github.com/Lightning-AI/lightning/pull/19366))
13+
- Added support for weights to evenly distributed works among workers for map operator ([#19365](https://github.com/Lightning-AI/lightning/pull/19365))
14+
- Added profiling support to StreamingDataloader ([#19338](https://github.com/Lightning-AI/lightning/pull/19338))
15+
- Allow any AWS authentication method in studios ([#19336](https://github.com/Lightning-AI/lightning/pull/19336))
16+
- Added walk operator #19333
17+
- Added intra node shuffling to accelerate second epoch in StreamingDataset ([#19296](https://github.com/Lightning-AI/lightning/pull/19296))
18+
- Enabled map over inputs without files input ([#19285](https://github.com/Lightning-AI/lightning/pull/19285))
19+
- Added Fault Tolerance v2 ([#19196](https://github.com/Lightning-AI/lightning/pull/19196), [#19201](https://github.com/Lightning-AI/lightning/pull/19201))
20+
21+
### Changed
22+
23+
- Switched map operator arguments order ([#19345](https://github.com/Lightning-AI/lightning/pull/19345))
24+
- Removed torch distributed for the Dataset Optimizer ([#19182](https://github.com/Lightning-AI/lightning/pull/19182))
25+
- Remove `__len__` from CombinedStreamingDataset ([#19321](https://github.com/Lightning-AI/lightning/pull/19321))
26+
27+
### Fixed
28+
29+
- Fixed race condition in downloader ([#19348](https://github.com/Lightning-AI/lightning/pull/19348))
30+
- Fixed serializer `io.bytes` image in JPEGSerializer ([#19369](https://github.com/Lightning-AI/lightning/pull/19369))
31+
- Fixed several bugs found in Studio Data Processor ([#19309](https://github.com/Lightning-AI/lightning/pull/19309))
32+
- Fixed handling queue errors in streaming dataset reader ([#19167](https://github.com/Lightning-AI/lightning/pull/19167))
33+
- Fixed chunks eviction in StreamingDataset ([#19214](https://github.com/Lightning-AI/lightning/pull/19214))
34+
35+
836
## [2.1.3] - 2023-12-21
937

1038
### Added

src/lightning/fabric/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

77

8+
## [2.1.4] - 2024-01-31
9+
10+
### Fixed
11+
12+
- Fixed an issue preventing Fabric to run on CPU when the system's CUDA driver is outdated or broken ([#19234](https://github.com/Lightning-AI/lightning/pull/19234))
13+
- Fixed typo in kwarg in SpikeDetection ([#19282](https://github.com/Lightning-AI/lightning/pull/19282))
14+
15+
816
## [2.1.3] - 2023-12-21
917

1018
### Fixed

src/lightning/fabric/strategies/launchers/subprocess_script.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,11 @@ def _basic_subprocess_cmd() -> Sequence[str]:
160160

161161

162162
def _hydra_subprocess_cmd(local_rank: int) -> Tuple[Sequence[str], str]:
163-
import __main__ # local import to avoid https://github.com/Lightning-AI/lightning/issues/15218
164163
from hydra.core.hydra_config import HydraConfig
165164
from hydra.utils import get_original_cwd, to_absolute_path
166165

166+
import __main__ # local import to avoid https://github.com/Lightning-AI/lightning/issues/15218
167+
167168
# when user is using hydra find the absolute path
168169
if __main__.__spec__ is None: # pragma: no-cover
169170
command = [sys.executable, to_absolute_path(sys.argv[0])]

src/lightning/pytorch/CHANGELOG.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

77

8+
## [2.1.4] - 2024-01-31
9+
10+
### Fixed
11+
12+
- Fixed `Trainer` not expanding the `default_root_dir` if it has the `~` (home) prefix ([#19179](https://github.com/Lightning-AI/lightning/pull/19179))
13+
- Fixed warning for Dataloader if `num_workers=1` and CPU count is 1 ([#19224](https://github.com/Lightning-AI/lightning/pull/19224))
14+
- Fixed `WandbLogger.watch()` method annotation to accept `None` for the log parameter ([#19237](https://github.com/Lightning-AI/lightning/pull/19237))
15+
- Fixed an issue preventing the Trainer to run on CPU when the system's CUDA driver is outdated or broken ([#19234](https://github.com/Lightning-AI/lightning/pull/19234))
16+
- Fixed an issue with the ModelCheckpoint callback not saving relative symlinks with `ModelCheckpoint(save_last="link")` ([#19303](https://github.com/Lightning-AI/lightning/pull/19303))
17+
- Fixed issue where the `_restricted_classmethod_impl` would incorrectly raise a TypeError on inspection rather than on call ([#19332](https://github.com/Lightning-AI/lightning/pull/19332))
18+
- Fixed exporting `__version__` in `__init__` ([#19221](https://github.com/Lightning-AI/lightning/pull/19221))
19+
20+
821
## [2.1.3] - 2023-12-21
922

1023
### Changed
@@ -23,9 +36,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
2336
- Fixed the tensor conversion in `self.log` to respect the default dtype ([#19046](https://github.com/Lightning-AI/lightning/issues/19046))
2437

2538

26-
- Fixed `Trainer` not expanding the `default_root_dir` if it has the `~` (home) prefix ([#19179](https://github.com/Lightning-AI/lightning/pull/19179))
27-
28-
2939
## [2.1.2] - 2023-11-15
3040

3141
### Fixed

src/lightning/pytorch/utilities/model_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import functools
1515
import inspect
1616
import os
17-
from typing import TYPE_CHECKING, Any, Callable, Dict, Generic, Optional, Type, TypeVar
17+
from typing import TYPE_CHECKING, Any, Callable, Generic, Optional, Type, TypeVar
1818

1919
from lightning_utilities.core.imports import RequirementCache
2020
from torch import nn

src/version.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.3
1+
2.1.4

tests/tests_app/core/test_lightning_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ def __init__(self, flow):
11151115
def test_cloud_compute_binding():
11161116
cloud_compute.ENABLE_MULTIPLE_WORKS_IN_NON_DEFAULT_CONTAINER = True
11171117

1118-
assert {} == cloud_compute._CLOUD_COMPUTE_STORE
1118+
assert cloud_compute._CLOUD_COMPUTE_STORE == {}
11191119
flow = FlowCC()
11201120
assert len(cloud_compute._CLOUD_COMPUTE_STORE) == 2
11211121
assert cloud_compute._CLOUD_COMPUTE_STORE["default"].component_names == ["root.work_c"]

tests/tests_pytorch/strategies/test_fsdp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def __init__(self, wrap_min_params: int = 2):
114114

115115
self.save_hyperparameters()
116116
self.layer = torch.nn.Sequential(torch.nn.Linear(32, 32), torch.nn.ReLU(), torch.nn.Linear(32, 2))
117-
self.should_be_wrapped = [(32 * 32 + 32) > wrap_min_params, None, (32 * 2 + 2) > wrap_min_params]
117+
self.should_be_wrapped = [wrap_min_params < (32 * 32 + 32), None, wrap_min_params < (32 * 2 + 2)]
118118

119119
def configure_optimizers(self):
120120
parameters = self.parameters() if _TORCH_GREATER_EQUAL_2_0 else self.trainer.model.parameters()

tests/tests_pytorch/utilities/test_model_helpers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
import inspect
15-
import logging
1615

1716
import pytest
1817
from lightning.pytorch import LightningDataModule

0 commit comments

Comments
 (0)