Skip to content

Commit 626c69c

Browse files
authored
Merge branch 'master' into fix/enabling-multiple-checkpoints-mlflow
2 parents c46b47d + 9afcc58 commit 626c69c

File tree

7 files changed

+10
-38
lines changed

7 files changed

+10
-38
lines changed

examples/fabric/reinforcement_learning/train_fabric_decoupled.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def trainer(
274274
if group_rank == 0:
275275
metrics = {}
276276

277-
# Lerning rate annealing
277+
# Learning rate annealing
278278
if args.anneal_lr:
279279
linear_annealing(optimizer, update, num_updates, args.learning_rate)
280280
if group_rank == 0:

src/lightning/__setup__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ def _setup_args() -> dict[str, Any]:
9898
"entry_points": {
9999
"console_scripts": [
100100
"fabric = lightning.fabric.cli:_main",
101-
"lightning = lightning.fabric.cli:_legacy_main",
102101
],
103102
},
104103
"setup_requires": [],

src/lightning/fabric/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

7+
## [unreleased] - YYYY-MM-DD
8+
9+
### Removed
10+
11+
Removed legacy supoport for `lightning run model`. Use `fabric run` instead. ([#20588](https://github.com/Lightning-AI/pytorch-lightning/pull/20588))
12+
713
## [2.5.0] - 2024-12-19
814

915
### Added

src/lightning/fabric/cli.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import logging
1515
import os
1616
import re
17-
import subprocess
18-
import sys
1917
from argparse import Namespace
2018
from typing import Any, Optional
2119

@@ -50,25 +48,6 @@ def _get_supported_strategies() -> list[str]:
5048
if _CLICK_AVAILABLE:
5149
import click
5250

53-
def _legacy_main() -> None:
54-
"""Legacy CLI handler for fabric.
55-
56-
Raises deprecation warning and runs through fabric cli if necessary, else runs the entrypoint directly
57-
58-
"""
59-
hparams = sys.argv[1:]
60-
if len(hparams) >= 2 and hparams[0] == "run" and hparams[1] == "model":
61-
print(
62-
"`lightning run model` is deprecated and will be removed in future versions."
63-
" Please call `fabric run` instead."
64-
)
65-
_main()
66-
return
67-
68-
if _LIGHTNING_SDK_AVAILABLE:
69-
subprocess.run([sys.executable, "-m", "lightning_sdk.cli.entrypoint"] + hparams)
70-
return
71-
7251
@click.group()
7352
def _main() -> None:
7453
pass

tests/tests_fabric/loggers/test_csv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def test_automatic_step_tracking(tmp_path):
148148

149149

150150
@mock.patch(
151-
# Mock the existance check, so we can simulate appending to the metrics file
151+
# Mock the existence check, so we can simulate appending to the metrics file
152152
"lightning.fabric.loggers.csv_logs._ExperimentWriter._check_log_dir_exists"
153153
)
154154
def test_append_metrics_file(_, tmp_path):
@@ -189,7 +189,7 @@ def test_append_columns(tmp_path):
189189

190190

191191
@mock.patch(
192-
# Mock the existance check, so we can simulate appending to the metrics file
192+
# Mock the existence check, so we can simulate appending to the metrics file
193193
"lightning.fabric.loggers.csv_logs._ExperimentWriter._check_log_dir_exists"
194194
)
195195
def test_rewrite_with_new_header(_, tmp_path):

tests/tests_fabric/test_cli.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,6 @@ def test_run_through_fabric_entry_point():
179179
assert message in result.stdout or message in result.stderr
180180

181181

182-
@pytest.mark.skipif("lightning.fabric" == "lightning_fabric", reason="standalone package")
183-
def test_run_through_lightning_entry_point():
184-
result = subprocess.run("lightning run model --help", capture_output=True, text=True, shell=True)
185-
186-
deprecation_message = (
187-
"`lightning run model` is deprecated and will be removed in future versions. Please call `fabric run` instead"
188-
)
189-
message = "Usage: lightning run [OPTIONS] SCRIPT [SCRIPT_ARGS]"
190-
assert deprecation_message in result.stdout
191-
assert message in result.stdout or message in result.stderr
192-
193-
194182
@mock.patch("lightning.fabric.cli._process_cli_args")
195183
@mock.patch("lightning.fabric.cli._load_distributed_checkpoint")
196184
@mock.patch("lightning.fabric.cli.torch.save")

tests/tests_pytorch/accelerators/test_xla.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def on_train_start(self):
148148

149149
def on_train_end(self):
150150
# this might fail if run in an environment with too many ranks, as the total
151-
# length of the dataloader will be distrbuted among them and then each rank might not do 3 steps
151+
# length of the dataloader will be distributed among them and then each rank might not do 3 steps
152152
assert self.called["training_step"] == 3
153153
assert self.called["on_train_batch_start"] == 3
154154
assert self.called["on_train_batch_end"] == 3

0 commit comments

Comments
 (0)