Skip to content

Commit 6697832

Browse files
Sherin ThomasBorda
authored andcommitted
[App] Cold start proxy in autoscaler (#16094)
* cold start proxy * Update src/lightning_app/components/serve/auto_scaler.py * changelog * better-doc Co-authored-by: Akihiro Nitta <[email protected]> Co-authored-by: thomas chaton <[email protected]> Co-authored-by: Jirka Borovec <[email protected]> (cherry picked from commit 7cbdc68)
1 parent 90822bc commit 6697832

File tree

7 files changed

+244
-45
lines changed

7 files changed

+244
-45
lines changed

docs/source-app/api_references.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ ___________________
4646
~multi_node.pytorch_spawn.PyTorchSpawnMultiNode
4747
~multi_node.trainer.LightningTrainerMultiNode
4848
~serve.auto_scaler.AutoScaler
49+
~serve.auto_scaler.ColdStartProxy
4950

5051
----
5152

requirements/app/test.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pytest==7.2.0
44
pytest-timeout==2.1.0
55
pytest-cov==4.0.0
66
pytest-doctestplus>=0.9.0
7+
pytest-asyncio==0.20.3
78
playwright==1.28.0
89
httpx
910
trio<0.22.0

src/lightning_app/CHANGELOG.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,25 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
1111

1212
- Added partial support for fastapi `Request` annotation in `configure_api` handlers ([#16047](https://github.com/Lightning-AI/lightning/pull/16047))
1313

14+
1415
- Added a nicer UI with URL and examples for the autoscaler component ([#16063](https://github.com/Lightning-AI/lightning/pull/16063))
1516

17+
1618
- Enabled users to have more control over scaling out/in interval ([#16093](https://github.com/Lightning-AI/lightning/pull/16093))
1719

20+
1821
- Added more datatypes to serving component ([#16018](https://github.com/Lightning-AI/lightning/pull/16018))
1922

23+
2024
- Added `work.delete` method to delete the work ([#16103](https://github.com/Lightning-AI/lightning/pull/16103))
2125

26+
2227
- Added `display_name` property to LightningWork for the cloud ([#16095](https://github.com/Lightning-AI/lightning/pull/16095))
2328

2429

30+
- Added `ColdStartProxy` to the AutoScaler ([#16094](https://github.com/Lightning-AI/lightning/pull/16094))
31+
32+
2533
### Changed
2634

2735

@@ -31,7 +39,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
3139
- The utility `lightning.app.utilities.cloud.is_running_in_cloud` now returns `True` during loading of the app locally when running with `--cloud` ([#16045](https://github.com/Lightning-AI/lightning/pull/16045))
3240

3341

34-
3542
### Deprecated
3643

3744
-
@@ -47,6 +54,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
4754
- Fixed `PythonServer` messaging "Your app has started" ([#15989](https://github.com/Lightning-AI/lightning/pull/15989))
4855

4956

57+
- Fixed auto-batching to enable batching for requests coming even after batch interval but is in the queue ([#16110](https://github.com/Lightning-AI/lightning/pull/16110))
58+
59+
60+
- Fixed a bug where `AutoScaler` would fail with min_replica=0 ([#16092](https://github.com/Lightning-AI/lightning/pull/16092)
61+
62+
63+
- Fixed a non-thread safe deepcopy in the scheduler ([#16114](https://github.com/Lightning-AI/lightning/pull/16114))
64+
65+
66+
- Fixed Http Queue sleeping for 1 sec by default if no delta were found ([#16114](https://github.com/Lightning-AI/lightning/pull/16114))
67+
5068

5169
## [1.8.5] - 2022-12-15
5270

@@ -71,13 +89,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
7189
- Fixed a bug where apps that had previously been deleted could not be run again from the CLI ([#16082](https://github.com/Lightning-AI/lightning/pull/16082))
7290
- Fixed install/upgrade - removing single quote ([#16079](https://github.com/Lightning-AI/lightning/pull/16079))
7391

74-
- Fixed a bug where `AutoScaler` would fail with min_replica=0 ([#16092](https://github.com/Lightning-AI/lightning/pull/16092)
75-
76-
77-
- Fixed a non-thread safe deepcopy in the scheduler ([#16114](https://github.com/Lightning-AI/lightning/pull/16114))
78-
79-
- Fixed Http Queue sleeping for 1 sec by default if no delta were found ([#16114](https://github.com/Lightning-AI/lightning/pull/16114))
80-
8192

8293
## [1.8.4] - 2022-12-08
8394

src/lightning_app/components/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
)
99
from lightning_app.components.python.popen import PopenPythonScript
1010
from lightning_app.components.python.tracer import Code, TracerPythonScript
11-
from lightning_app.components.serve.auto_scaler import AutoScaler
11+
from lightning_app.components.serve.auto_scaler import AutoScaler, ColdStartProxy
1212
from lightning_app.components.serve.gradio import ServeGradio
1313
from lightning_app.components.serve.python_server import Category, Image, Number, PythonServer, Text
1414
from lightning_app.components.serve.serve import ModelInferenceAPI
@@ -17,6 +17,7 @@
1717

1818
__all__ = [
1919
"AutoScaler",
20+
"ColdStartProxy",
2021
"DatabaseClient",
2122
"Database",
2223
"PopenPythonScript",
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
1-
from lightning_app.components.serve.auto_scaler import AutoScaler
1+
from lightning_app.components.serve.auto_scaler import AutoScaler, ColdStartProxy
22
from lightning_app.components.serve.gradio import ServeGradio
33
from lightning_app.components.serve.python_server import Category, Image, Number, PythonServer, Text
44
from lightning_app.components.serve.streamlit import ServeStreamlit
55

6-
__all__ = ["ServeGradio", "ServeStreamlit", "PythonServer", "Image", "Number", "Category", "Text", "AutoScaler"]
6+
__all__ = [
7+
"ServeGradio",
8+
"ServeStreamlit",
9+
"PythonServer",
10+
"Image",
11+
"Number",
12+
"Category",
13+
"Text",
14+
"AutoScaler",
15+
"ColdStartProxy",
16+
]

0 commit comments

Comments
 (0)