Skip to content

Commit e90dfdb

Browse files
Update README.md
1 parent 2b0dc7f commit e90dfdb

File tree

1 file changed

+47
-52
lines changed

1 file changed

+47
-52
lines changed

README.md

Lines changed: 47 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,19 @@ pip install -iU https://test.pypi.org/simple/ pytorch-lightning
9696

9797
## Lightning has 3 core packages
9898

99-
- [PyTorch Lightning: Train and deploy PyTorch at scale](#PyTorch Lightning: Train and deploy PyTorch at scale).
100-
- Lightning Fabric: Expert-level control over scale and training loop.
101-
- Lightning Apps: Build AI products and ML workflows.
99+
[PyTorch Lightning: Train and deploy PyTorch at scale](#pytorch-lightning-train-and-deploy-pytorch-at-scale).
100+
[Lightning Fabric: Expert control](#lightning-fabric-expert-control).
101+
[Lightning Apps: Build AI products and ML workflows](#lightning-apps-build-ai-products-and-ml-workflows).
102+
103+
Lightning gives you granular control over how much abstraction you want to add over PyTorch.
104+
105+
<div align="center">
106+
<img src="https://pl-public-data.s3.amazonaws.com/assets_lightning/continuum.png" width="80%">
107+
</div>
102108

103109
----
104110

105-
## PyTorch Lightning: Train and deploy PyTorch at scale
111+
# PyTorch Lightning: Train and Deploy PyTorch at Scale
106112

107113
PyTorch Lightning is just organized PyTorch - Lightning disentangles PyTorch code to decouple the science from the engineering.
108114

@@ -302,7 +308,7 @@ with tempfile.NamedTemporaryFile(suffix=".onnx", delete=False) as tmpfile:
302308

303309
----
304310

305-
## Lightning Fabric: Expert-level control over scale and training loop.
311+
# Lightning Fabric: Expert control.
306312

307313
Run on any device with Fabric with expert-level PyTorch control for scaling foundation models or writing your own Trainer.
308314

@@ -340,14 +346,6 @@ Fabric is designed for the most complex models like foundation model scaling, LL
340346
lr_scheduler.step()
341347
```
342348

343-
## Fabric vs PyTorch vs PyTorch Lightning
344-
345-
In the spectrum from raw PyTorch to fully managed PyTorch Lightning, Fabric gives you full control over how much abstraction you want to add.
346-
347-
<div align="center">
348-
<img src="https://pl-public-data.s3.amazonaws.com/assets_lightning/continuum.png" width="80%">
349-
</div>
350-
351349
## Key features
352350

353351
- Easily switch from running on CPU to GPU (Apple Silicon, CUDA, …), TPU, multi-GPU or even multi-node training
@@ -358,65 +356,62 @@ In the spectrum from raw PyTorch to fully managed PyTorch Lightning, Fabric give
358356

359357
----
360358

361-
### [Read the Fabric docs](https://lightning.ai/docs/fabric/stable/)
359+
<div align="center">
360+
<a href="https://lightning.ai/docs/fabric/stable/">Read the Lightning Fabric docs</a>
361+
</div>
362362

363363
----
364364

365-
## Lightning Apps: Build AI products and ML workflows
365+
# Lightning Apps: Build AI products and ML workflows
366366

367-
Once you're done building models, publish a paper demo or build a full production end-to-end ML system with Lightning Apps. Lightning Apps remove the cloud infrastructure boilerplate so you can focus on solving the research or business problems. Lightning Apps can run on the Lightning Cloud, your own cluster or a private cloud.
368-
369-
[Browse available Lightning apps here](https://lightning.ai/)
367+
Lightning Apps remove the cloud infrastructure boilerplate so you can focus on solving the research or business problems. Lightning Apps can run on the Lightning Cloud, your own cluster or a private cloud.
370368

371369
<div align="center">
372370
<img src="https://pl-public-data.s3.amazonaws.com/assets_lightning/lightning-apps-teaser.png" width="80%">
373371
</div>
374372

375-
<details>
376-
<summary>Learn more about apps</summary>
377-
378-
Build machine learning components that can plug into existing ML workflows. A Lightning component organizes arbitrary code to run on the cloud, manage its own infrastructure, cloud costs, networking, and more. Focus on component logic and not engineering.
379-
380-
Use components on their own, or compose them into full-stack AI apps with our next-generation Lightning orchestrator. to package your code into Lightning components which can plug into your existing ML workflows.
373+
## Hello Lightning app world
381374

382-
## Run your first Lightning App
383-
384-
1. Install a simple training and deployment app by typing:
385-
386-
```bash
387-
# install lightning
388-
pip install lightning
389-
390-
lightning install app lightning/quick-start
391-
```
392-
393-
1. If everything was successful, move into the new directory:
394-
395-
```bash
396-
cd lightning-quick-start
397-
```
375+
```python
376+
# app.py
377+
import lightning as L
398378

399-
1. Run the app locally
379+
class TrainComponent(L.LightningWork):
380+
def run(self, x):
381+
print(f'train a model on {x}')
400382

401-
```bash
402-
lightning run app app.py
403-
```
383+
class AnalyzeComponent(L.LightningWork):
384+
def run(self, x):
385+
print(f'analyze model on {x}')
404386

405-
1. Alternatively, run it on the public Lightning Cloud to share your app!
387+
class WorkflowOrchestrator(L.LightningFlow):
388+
def __init__(self) -> None:
389+
super().__init__()
390+
self.train = TrainComponent(cloud_compute=L.CloudCompute('cpu'))
391+
self.analyze = AnalyzeComponent(cloud_compute=L.CloudCompute('gpu'))
406392

407-
```bash
408-
lightning run app app.py --cloud
409-
```
393+
def run(self):
394+
self.train.run("CPU machine 1")
395+
self.analyze.run("GPU machine 2")
410396

411-
Apps run the same on the cloud and locally on your choice of hardware.
397+
app = L.LightningApp(WorkflowOrchestrator())
398+
```
412399

413-
## run the app on the --cloud
400+
Run on the cloud or locally
414401

402+
```bash
403+
# run on the cloud
415404
lightning run app app.py --setup --cloud
416405

417-
### [Learn more about Lightning Apps](src/lightning_app/README.md)
406+
# run locally
407+
lightning run app app.py
408+
```
418409

419-
</details>
410+
----
411+
412+
<div align="center">
413+
<a href="https://lightning.ai/docs/app/stable/">Read the Lightning Apps docs</a>
414+
</div>
420415

421416
----
422417

0 commit comments

Comments
 (0)