Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Lightning Fabric CLI #19442

Merged
merged 22 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/source-fabric/fundamentals/launch.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ An alternative way to launch your Python script in multiple processes is to use

.. code-block:: bash

lightning run model path/to/your/script.py
fabric run model path/to/your/script.py

This is essentially the same as running ``python path/to/your/script.py``, but it also lets you configure the following settings externally without changing your code:

Expand All @@ -80,9 +80,9 @@ This is essentially the same as running ``python path/to/your/script.py``, but i

.. code-block:: bash

lightning run model --help
fabric run model --help

Usage: lightning run model [OPTIONS] SCRIPT [SCRIPT_ARGS]...
Usage: fabric run model [OPTIONS] SCRIPT [SCRIPT_ARGS]...

Run a Lightning Fabric script.

Expand Down Expand Up @@ -128,7 +128,7 @@ Here is how you run DDP with 8 GPUs and `torch.bfloat16 <https://pytorch.org/doc

.. code-block:: bash

lightning run model ./path/to/train.py \
fabric run model ./path/to/train.py \
--strategy=ddp \
--devices=8 \
--accelerator=cuda \
Expand All @@ -138,7 +138,7 @@ Or `DeepSpeed Zero3 <https://www.deepspeed.ai/2021/03/07/zero3-offload.html>`_ w

.. code-block:: bash

lightning run model ./path/to/train.py \
fabric run model ./path/to/train.py \
--strategy=deepspeed_stage_3 \
--devices=8 \
--accelerator=cuda \
Expand All @@ -148,7 +148,7 @@ Or `DeepSpeed Zero3 <https://www.deepspeed.ai/2021/03/07/zero3-offload.html>`_ w

.. code-block:: bash

lightning run model ./path/to/train.py \
fabric run model ./path/to/train.py \
--devices=auto \
--accelerator=auto \
--precision=16
Expand Down
1 change: 1 addition & 0 deletions src/lightning/__setup__.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def _setup_args() -> Dict[str, Any]:
"python_requires": ">=3.8", # todo: take the lowes based on all packages
"entry_points": {
"console_scripts": [
"fabric = lightning.fabric.cli:_main",
"lightning_app = lightning:_cli_entry_point",
],
},
Expand Down
2 changes: 1 addition & 1 deletion src/lightning/fabric/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).

### Changed

-
- Rename `lightning run model` to `fabric run model` ([#19442](https://github.com/Lightning-AI/pytorch-lightning/pull/19442))

-

Expand Down
10 changes: 9 additions & 1 deletion src/lightning/fabric/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,15 @@ def _get_supported_strategies() -> List[str]:
if _CLICK_AVAILABLE:
import click

@click.command(
@click.group()
def _main() -> None:
pass

@_main.group()
def run() -> None:
pass

@run.command(
"model",
context_settings={
"ignore_unknown_options": True,
Expand Down
5 changes: 5 additions & 0 deletions src/lightning_fabric/__setup__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ def _setup_args() -> Dict[str, Any]:
"install_requires": assistant.load_requirements(
_PATH_REQUIREMENTS, unfreeze="none" if _FREEZE_REQUIREMENTS else "all"
),
"entry_points": {
"console_scripts": [
"fabric = lightning_fabric.cli:main",
],
},
"extras_require": _prepare_extras(),
"project_urls": {
"Bug Tracker": "https://github.com/Lightning-AI/lightning/issues",
Expand Down
Loading