autogluon.cloud 0.6.0__tar.gz → 0.7.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {autogluon_cloud-0.6.0/src/autogluon.cloud.egg-info → autogluon_cloud-0.7.0}/PKG-INFO +34 -49
- autogluon_cloud-0.7.0/README.md +82 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/pyproject.toml +4 -7
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/setup.py +1 -1
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/__init__.py +2 -11
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/backend/backend.py +17 -34
- autogluon_cloud-0.7.0/src/autogluon/cloud/backend/backend_factory.py +25 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/backend/constant.py +1 -4
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/backend/multimodal_sagemaker_backend.py +61 -83
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/backend/sagemaker_backend.py +536 -544
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/backend/tabular_sagemaker_backend.py +8 -8
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/backend/timeseries_sagemaker_backend.py +49 -53
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/cli.py +12 -13
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/cloud_setup.py +66 -70
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/config.py +4 -11
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/data/format_converter.py +6 -7
- autogluon_cloud-0.7.0/src/autogluon/cloud/endpoint/endpoint.py +48 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/endpoint/multimodal_endpoint.py +129 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/endpoint/prediction_future.py +30 -9
- autogluon_cloud-0.7.0/src/autogluon/cloud/endpoint/tabular_endpoint.py +180 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/endpoint/timeseries_endpoint.py +115 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/job/remote_job.py +5 -6
- autogluon_cloud-0.7.0/src/autogluon/cloud/job/sagemaker_job.py +299 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/model/foundation_model.py +1061 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/model/registry.py +191 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/predictor/cloud_predictor.py +948 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/predictor/multimodal_cloud_predictor.py +172 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/predictor/tabular_cloud_predictor.py +274 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/predictor/timeseries_cloud_predictor.py +444 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/scripts/sagemaker_scripts/serving_utils/mitra.py +24 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/sagemaker_scripts/serving_utils/timeseries.py +4 -4
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/sagemaker_scripts/tabular_fm_serve.py +5 -2
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/sagemaker_scripts/tabular_serve.py +18 -11
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/sagemaker_scripts/timeseries_fm_serve.py +3 -2
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/sagemaker_scripts/timeseries_serve.py +31 -3
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/sagemaker_scripts/train.py +7 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/script_manager.py +1 -4
- autogluon_cloud-0.7.0/src/autogluon/cloud/utils/ag_sagemaker.py +124 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/utils/autogluon_dlc.json +90 -28
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/utils/aws_utils.py +118 -21
- autogluon_cloud-0.7.0/src/autogluon/cloud/utils/constants.py +16 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/utils/deserializers.py +28 -19
- autogluon_cloud-0.7.0/src/autogluon/cloud/utils/dlc_utils.py +183 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/utils/job_logs.py +98 -0
- autogluon_cloud-0.7.0/src/autogluon/cloud/utils/misc.py +33 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/utils/s3_utils.py +7 -9
- autogluon_cloud-0.7.0/src/autogluon/cloud/utils/sagemaker_api.py +184 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/utils/serializers.py +38 -32
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/utils/tag_utils.py +3 -4
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/utils/utils.py +1 -1
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/version.py +1 -1
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0/src/autogluon.cloud.egg-info}/PKG-INFO +34 -49
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon.cloud.egg-info/SOURCES.txt +4 -20
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon.cloud.egg-info/requires.txt +1 -6
- autogluon_cloud-0.6.0/README.md +0 -93
- autogluon_cloud-0.6.0/src/autogluon/cloud/backend/backend_factory.py +0 -47
- autogluon_cloud-0.6.0/src/autogluon/cloud/backend/ray_aws_backend.py +0 -94
- autogluon_cloud-0.6.0/src/autogluon/cloud/backend/ray_backend.py +0 -507
- autogluon_cloud-0.6.0/src/autogluon/cloud/cluster/__init__.py +0 -6
- autogluon_cloud-0.6.0/src/autogluon/cloud/cluster/cluster_config_generator.py +0 -80
- autogluon_cloud-0.6.0/src/autogluon/cloud/cluster/cluster_manager.py +0 -54
- autogluon_cloud-0.6.0/src/autogluon/cloud/cluster/constants.py +0 -20
- autogluon_cloud-0.6.0/src/autogluon/cloud/cluster/ray_aws_cluster_config_generator.py +0 -247
- autogluon_cloud-0.6.0/src/autogluon/cloud/cluster/ray_aws_cluster_manager.py +0 -11
- autogluon_cloud-0.6.0/src/autogluon/cloud/cluster/ray_cluster_config_generator.py +0 -7
- autogluon_cloud-0.6.0/src/autogluon/cloud/cluster/ray_cluster_manager.py +0 -105
- autogluon_cloud-0.6.0/src/autogluon/cloud/default_cluster_configs/ray_aws_default_cluster_config.yaml +0 -47
- autogluon_cloud-0.6.0/src/autogluon/cloud/endpoint/endpoint.py +0 -26
- autogluon_cloud-0.6.0/src/autogluon/cloud/endpoint/sagemaker_endpoint.py +0 -47
- autogluon_cloud-0.6.0/src/autogluon/cloud/endpoint/tabular_endpoint.py +0 -128
- autogluon_cloud-0.6.0/src/autogluon/cloud/endpoint/timeseries_endpoint.py +0 -112
- autogluon_cloud-0.6.0/src/autogluon/cloud/job/ray_job.py +0 -177
- autogluon_cloud-0.6.0/src/autogluon/cloud/job/sagemaker_job.py +0 -360
- autogluon_cloud-0.6.0/src/autogluon/cloud/model/foundation_model.py +0 -854
- autogluon_cloud-0.6.0/src/autogluon/cloud/model/registry.py +0 -81
- autogluon_cloud-0.6.0/src/autogluon/cloud/predictor/cloud_predictor.py +0 -822
- autogluon_cloud-0.6.0/src/autogluon/cloud/predictor/multimodal_cloud_predictor.py +0 -40
- autogluon_cloud-0.6.0/src/autogluon/cloud/predictor/tabular_cloud_predictor.py +0 -258
- autogluon_cloud-0.6.0/src/autogluon/cloud/predictor/timeseries_cloud_predictor.py +0 -439
- autogluon_cloud-0.6.0/src/autogluon/cloud/scripts/ray_scripts/train.py +0 -125
- autogluon_cloud-0.6.0/src/autogluon/cloud/scripts/sagemaker_scripts/__init__.py +0 -0
- autogluon_cloud-0.6.0/src/autogluon/cloud/scripts/sagemaker_scripts/serving_utils/__init__.py +0 -0
- autogluon_cloud-0.6.0/src/autogluon/cloud/templates/ag_cloud_ray_aws.yaml +0 -128
- autogluon_cloud-0.6.0/src/autogluon/cloud/utils/ag_sagemaker.py +0 -271
- autogluon_cloud-0.6.0/src/autogluon/cloud/utils/constants.py +0 -9
- autogluon_cloud-0.6.0/src/autogluon/cloud/utils/dlc_utils.py +0 -142
- autogluon_cloud-0.6.0/src/autogluon/cloud/utils/ec2.py +0 -103
- autogluon_cloud-0.6.0/src/autogluon/cloud/utils/iam.py +0 -129
- autogluon_cloud-0.6.0/src/autogluon/cloud/utils/misc.py +0 -14
- autogluon_cloud-0.6.0/src/autogluon/cloud/utils/ray_aws_iam.py +0 -106
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/LICENSE +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/NOTICE +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/setup.cfg +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/backend/__init__.py +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/data/__init__.py +0 -0
- {autogluon_cloud-0.6.0/src/autogluon/cloud/default_cluster_configs → autogluon_cloud-0.7.0/src/autogluon/cloud/endpoint}/__init__.py +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/job/__init__.py +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/model/__init__.py +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/predictor/__init__.py +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/__init__.py +0 -0
- {autogluon_cloud-0.6.0/src/autogluon/cloud/endpoint → autogluon_cloud-0.7.0/src/autogluon/cloud/scripts/sagemaker_scripts}/__init__.py +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/scripts/sagemaker_scripts/multimodal_serve.py +0 -0
- {autogluon_cloud-0.6.0/src/autogluon/cloud/scripts/ray_scripts → autogluon_cloud-0.7.0/src/autogluon/cloud/scripts/sagemaker_scripts/serving_utils}/__init__.py +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/templates/ag_cloud_sagemaker.yaml +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon/cloud/utils/__init__.py +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon.cloud.egg-info/dependency_links.txt +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon.cloud.egg-info/entry_points.txt +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon.cloud.egg-info/top_level.txt +0 -0
- {autogluon_cloud-0.6.0 → autogluon_cloud-0.7.0}/src/autogluon.cloud.egg-info/zip-safe +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autogluon.cloud
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Train and deploy ML models in the cloud
|
|
5
5
|
Author: AutoGluon Community
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -36,19 +36,15 @@ License-File: NOTICE
|
|
|
36
36
|
Requires-Dist: autogluon.common<1.7,>=0.7
|
|
37
37
|
Requires-Dist: boto3<2,>=1.37.23
|
|
38
38
|
Requires-Dist: packaging<27,>=23.0
|
|
39
|
-
Requires-Dist: sagemaker<3,>=2.240.0
|
|
40
39
|
Requires-Dist: pyarrow<25,>=19.0.1
|
|
41
40
|
Requires-Dist: PyYAML~=6.0
|
|
42
41
|
Requires-Dist: Pillow<13,>=10.2
|
|
43
42
|
Requires-Dist: huggingface_hub<2,>=0.20
|
|
44
|
-
Requires-Dist: typing_extensions<5,>=4.
|
|
43
|
+
Requires-Dist: typing_extensions<5,>=4.5
|
|
45
44
|
Requires-Dist: click<9,>=8.0
|
|
46
45
|
Requires-Dist: rich<15,>=13.0
|
|
47
|
-
Provides-Extra: ray
|
|
48
|
-
Requires-Dist: ray[default]<2.59,>=2.10.0; extra == "ray"
|
|
49
46
|
Provides-Extra: all
|
|
50
47
|
Requires-Dist: autogluon<1.7,>=0.7; extra == "all"
|
|
51
|
-
Requires-Dist: autogluon.cloud[ray]; extra == "all"
|
|
52
48
|
Provides-Extra: tests
|
|
53
49
|
Requires-Dist: pytest; extra == "tests"
|
|
54
50
|
Requires-Dist: moto; extra == "tests"
|
|
@@ -63,7 +59,7 @@ Dynamic: license-file
|
|
|
63
59
|
## Train and Deploy AutoGluon in the Cloud
|
|
64
60
|
|
|
65
61
|
[](https://pypi.org/project/autogluon.cloud/)
|
|
66
|
-
[](https://pypi.org/project/autogluon.cloud/)
|
|
62
|
+
[](https://pypi.org/project/autogluon.cloud/)
|
|
67
63
|
[](./LICENSE)
|
|
68
64
|
[](https://github.com/autogluon/autogluon-cloud/actions/workflows/continuous_integration.yml)
|
|
69
65
|
|
|
@@ -71,30 +67,48 @@ Dynamic: license-file
|
|
|
71
67
|
|
|
72
68
|
</div>
|
|
73
69
|
|
|
74
|
-
AutoGluon-Cloud lets you train and deploy state-of-the-art ML models
|
|
70
|
+
AutoGluon-Cloud lets you train and deploy state-of-the-art ML models for classification, regression, and time series forecasting on [Amazon SageMaker](https://aws.amazon.com/sagemaker/). All it takes is a few lines of code; AutoGluon-Cloud handles the infrastructure, dependencies, and glue code for you.
|
|
75
71
|
|
|
76
|
-
|
|
77
|
-
- **[Run pretrained foundation models](https://auto.gluon.ai/cloud/stable/tutorials/foundation-model-timeseries.html)** — deploy state-of-the-art pretrained models like [Chronos-2](https://huggingface.co/amazon/chronos-2) for zero-shot inference, with no training required.
|
|
72
|
+
## 💡 Why AutoGluon-Cloud?
|
|
78
73
|
|
|
79
|
-
|
|
74
|
+
- **Works like local [AutoGluon](https://auto.gluon.ai/stable/index.html).** Pass in DataFrames, get predictions back — as convenient as working locally, with the compute handled by AWS.
|
|
75
|
+
- **No boilerplate.** No training scripts, inference handlers, or serialization code to write and maintain.
|
|
76
|
+
- **Official AWS containers.** Everything runs in the [AutoGluon Deep Learning Containers](https://aws.github.io/deep-learning-containers/), maintained and security-patched by AWS.
|
|
77
|
+
- **Sensible defaults, fully configurable.** Under the hood it's just SageMaker running in your AWS account, so you stay in full control.
|
|
78
|
+
|
|
79
|
+
## 💾 Installation
|
|
80
80
|
|
|
81
81
|
```bash
|
|
82
82
|
pip install autogluon.cloud
|
|
83
|
+
autogluon-cloud bootstrap # one-time setup for IAM role and S3 bucket
|
|
83
84
|
```
|
|
84
85
|
|
|
85
|
-
|
|
86
|
+
See the [Setup tutorial](https://auto.gluon.ai/cloud/stable/tutorials/setup.html) for more details.
|
|
87
|
+
|
|
88
|
+
## 🚀 Foundation models
|
|
89
|
+
|
|
90
|
+
Zero-shot forecasts with a pretrained model like [Chronos-2](https://huggingface.co/amazon/chronos-2) — no training required. [Full walkthrough](https://auto.gluon.ai/cloud/stable/tutorials/foundation-model-timeseries.html).
|
|
86
91
|
|
|
87
92
|
```python
|
|
88
|
-
from autogluon.cloud import
|
|
93
|
+
from autogluon.cloud import TimeSeriesFoundationModel
|
|
89
94
|
|
|
90
|
-
|
|
91
|
-
|
|
95
|
+
# `data` can be a local path, S3 URL, or pandas DataFrame
|
|
96
|
+
data = "https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly_tiny/train.csv"
|
|
97
|
+
|
|
98
|
+
model = TimeSeriesFoundationModel("chronos-2")
|
|
99
|
+
|
|
100
|
+
# Batch prediction
|
|
101
|
+
predictions = model.predict(data=data, target="target", prediction_length=24)
|
|
92
102
|
|
|
93
|
-
|
|
103
|
+
# Real-time inference endpoint
|
|
104
|
+
endpoint = model.deploy()
|
|
105
|
+
predictions = endpoint.predict(data=data, target="target", prediction_length=24)
|
|
106
|
+
endpoint.delete_endpoint()
|
|
107
|
+
```
|
|
94
108
|
|
|
95
|
-
## ⚙️ Train your own
|
|
109
|
+
## ⚙️ Train your own predictor
|
|
96
110
|
|
|
97
|
-
Train an AutoGluon predictor on your data and serve it from
|
|
111
|
+
Train an AutoGluon predictor on your data and serve it from SageMaker. Full walkthrough: [time series](https://auto.gluon.ai/cloud/stable/tutorials/predictor-timeseries.html), [tabular](https://auto.gluon.ai/cloud/stable/tutorials/predictor-tabular.html).
|
|
98
112
|
|
|
99
113
|
```python
|
|
100
114
|
from autogluon.cloud import TabularCloudPredictor
|
|
@@ -111,40 +125,11 @@ cloud_predictor.fit(
|
|
|
111
125
|
predictor_fit_args={"time_limit": 120}, # passed to TabularPredictor.fit()
|
|
112
126
|
)
|
|
113
127
|
|
|
114
|
-
# Real-time inference endpoint
|
|
115
|
-
cloud_predictor.deploy()
|
|
116
|
-
result = cloud_predictor.predict_real_time(test_data)
|
|
117
|
-
cloud_predictor.cleanup_deployment()
|
|
118
|
-
|
|
119
128
|
# Batch prediction
|
|
120
129
|
result = cloud_predictor.predict(test_data)
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
## 🚀 Run a pretrained foundation model
|
|
124
|
-
|
|
125
|
-
Skip training entirely — deploy a pretrained model like Chronos-2 to SageMaker and get zero-shot predictions out of the box. Full walkthrough: [time series](https://auto.gluon.ai/cloud/stable/tutorials/foundation-model-timeseries.html).
|
|
126
|
-
|
|
127
|
-
```python
|
|
128
|
-
from autogluon.cloud import TimeSeriesFoundationModel
|
|
129
|
-
|
|
130
|
-
# `data` can be a local path, S3 URL, or pandas DataFrame
|
|
131
|
-
data = "https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly_tiny/train.csv"
|
|
132
|
-
|
|
133
|
-
model = TimeSeriesFoundationModel("chronos-2")
|
|
134
|
-
|
|
135
|
-
# Batch prediction — no training required
|
|
136
|
-
predictions = model.predict(
|
|
137
|
-
data=data,
|
|
138
|
-
target="target",
|
|
139
|
-
prediction_length=24,
|
|
140
|
-
)
|
|
141
130
|
|
|
142
131
|
# Real-time inference endpoint
|
|
143
|
-
endpoint =
|
|
144
|
-
|
|
145
|
-
data=data,
|
|
146
|
-
target="target",
|
|
147
|
-
prediction_length=24,
|
|
148
|
-
)
|
|
132
|
+
endpoint = cloud_predictor.deploy()
|
|
133
|
+
result = endpoint.predict(test_data)
|
|
149
134
|
endpoint.delete_endpoint()
|
|
150
135
|
```
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
<img src="https://user-images.githubusercontent.com/16392542/77208906-224aa500-6aba-11ea-96bd-e81806074030.png" width="350">
|
|
5
|
+
|
|
6
|
+
## Train and Deploy AutoGluon in the Cloud
|
|
7
|
+
|
|
8
|
+
[](https://pypi.org/project/autogluon.cloud/)
|
|
9
|
+
[](https://pypi.org/project/autogluon.cloud/)
|
|
10
|
+
[](./LICENSE)
|
|
11
|
+
[](https://github.com/autogluon/autogluon-cloud/actions/workflows/continuous_integration.yml)
|
|
12
|
+
|
|
13
|
+
[AutoGluon-Cloud Documentation](https://auto.gluon.ai/cloud/stable/index.html) | [AutoGluon Documentation](https://auto.gluon.ai)
|
|
14
|
+
|
|
15
|
+
</div>
|
|
16
|
+
|
|
17
|
+
AutoGluon-Cloud lets you train and deploy state-of-the-art ML models for classification, regression, and time series forecasting on [Amazon SageMaker](https://aws.amazon.com/sagemaker/). All it takes is a few lines of code; AutoGluon-Cloud handles the infrastructure, dependencies, and glue code for you.
|
|
18
|
+
|
|
19
|
+
## 💡 Why AutoGluon-Cloud?
|
|
20
|
+
|
|
21
|
+
- **Works like local [AutoGluon](https://auto.gluon.ai/stable/index.html).** Pass in DataFrames, get predictions back — as convenient as working locally, with the compute handled by AWS.
|
|
22
|
+
- **No boilerplate.** No training scripts, inference handlers, or serialization code to write and maintain.
|
|
23
|
+
- **Official AWS containers.** Everything runs in the [AutoGluon Deep Learning Containers](https://aws.github.io/deep-learning-containers/), maintained and security-patched by AWS.
|
|
24
|
+
- **Sensible defaults, fully configurable.** Under the hood it's just SageMaker running in your AWS account, so you stay in full control.
|
|
25
|
+
|
|
26
|
+
## 💾 Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install autogluon.cloud
|
|
30
|
+
autogluon-cloud bootstrap # one-time setup for IAM role and S3 bucket
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
See the [Setup tutorial](https://auto.gluon.ai/cloud/stable/tutorials/setup.html) for more details.
|
|
34
|
+
|
|
35
|
+
## 🚀 Foundation models
|
|
36
|
+
|
|
37
|
+
Zero-shot forecasts with a pretrained model like [Chronos-2](https://huggingface.co/amazon/chronos-2) — no training required. [Full walkthrough](https://auto.gluon.ai/cloud/stable/tutorials/foundation-model-timeseries.html).
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
from autogluon.cloud import TimeSeriesFoundationModel
|
|
41
|
+
|
|
42
|
+
# `data` can be a local path, S3 URL, or pandas DataFrame
|
|
43
|
+
data = "https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly_tiny/train.csv"
|
|
44
|
+
|
|
45
|
+
model = TimeSeriesFoundationModel("chronos-2")
|
|
46
|
+
|
|
47
|
+
# Batch prediction
|
|
48
|
+
predictions = model.predict(data=data, target="target", prediction_length=24)
|
|
49
|
+
|
|
50
|
+
# Real-time inference endpoint
|
|
51
|
+
endpoint = model.deploy()
|
|
52
|
+
predictions = endpoint.predict(data=data, target="target", prediction_length=24)
|
|
53
|
+
endpoint.delete_endpoint()
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## ⚙️ Train your own predictor
|
|
57
|
+
|
|
58
|
+
Train an AutoGluon predictor on your data and serve it from SageMaker. Full walkthrough: [time series](https://auto.gluon.ai/cloud/stable/tutorials/predictor-timeseries.html), [tabular](https://auto.gluon.ai/cloud/stable/tutorials/predictor-tabular.html).
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
from autogluon.cloud import TabularCloudPredictor
|
|
62
|
+
|
|
63
|
+
# `train_data` and `test_data` can be a local path, S3 URL, or pandas DataFrame
|
|
64
|
+
train_data = "https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv"
|
|
65
|
+
test_data = "https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv"
|
|
66
|
+
|
|
67
|
+
# Train
|
|
68
|
+
cloud_predictor = TabularCloudPredictor()
|
|
69
|
+
cloud_predictor.fit(
|
|
70
|
+
train_data=train_data,
|
|
71
|
+
predictor_init_args={"label": "class"}, # passed to TabularPredictor()
|
|
72
|
+
predictor_fit_args={"time_limit": 120}, # passed to TabularPredictor.fit()
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
# Batch prediction
|
|
76
|
+
result = cloud_predictor.predict(test_data)
|
|
77
|
+
|
|
78
|
+
# Real-time inference endpoint
|
|
79
|
+
endpoint = cloud_predictor.deploy()
|
|
80
|
+
result = endpoint.predict(test_data)
|
|
81
|
+
endpoint.delete_endpoint()
|
|
82
|
+
```
|
|
@@ -43,23 +43,19 @@ dependencies = [
|
|
|
43
43
|
# TransformAmiVersion was added to the SageMaker service model in botocore 1.37.23.
|
|
44
44
|
"boto3>=1.37.23,<2",
|
|
45
45
|
"packaging>=23.0,<27",
|
|
46
|
-
# Supports forwarding inference_ami_version from Model.deploy.
|
|
47
|
-
"sagemaker>=2.240.0,<3",
|
|
48
46
|
"pyarrow>=19.0.1,<25", # lower bound to avoid https://github.com/apache/arrow/issues/45283
|
|
49
47
|
"PyYAML~=6.0",
|
|
50
48
|
"Pillow>=10.2,<13",
|
|
51
49
|
"huggingface_hub>=0.20,<2",
|
|
52
|
-
"typing_extensions>=4.
|
|
50
|
+
"typing_extensions>=4.5,<5", # 4.5 adds @deprecated (PEP 702)
|
|
53
51
|
# CLI dependencies (autogluon-cloud command)
|
|
54
52
|
"click>=8.0,<9",
|
|
55
53
|
"rich>=13.0,<15",
|
|
56
54
|
]
|
|
57
55
|
|
|
58
56
|
[project.optional-dependencies]
|
|
59
|
-
ray = ["ray[default]>=2.10.0,<2.59"]
|
|
60
57
|
all = [ # To allow user to pass ag objects
|
|
61
58
|
"autogluon>=0.7,<1.7",
|
|
62
|
-
"autogluon.cloud[ray]",
|
|
63
59
|
]
|
|
64
60
|
tests = [
|
|
65
61
|
"pytest",
|
|
@@ -86,7 +82,6 @@ namespaces = true
|
|
|
86
82
|
|
|
87
83
|
[tool.setuptools.package-data]
|
|
88
84
|
"autogluon.cloud" = [
|
|
89
|
-
"default_cluster_configs/*.yaml",
|
|
90
85
|
"utils/autogluon_dlc.json",
|
|
91
86
|
"templates/*.yaml",
|
|
92
87
|
]
|
|
@@ -105,5 +100,7 @@ known-first-party = ["autogluon"]
|
|
|
105
100
|
|
|
106
101
|
[tool.pytest.ini_options]
|
|
107
102
|
testpaths = ["tests"]
|
|
108
|
-
|
|
103
|
+
# Release tests are slow and expensive; run them with `-m release` (see .github/workflows/release_tests.yml).
|
|
104
|
+
addopts = "--strict-markers -m 'not release'"
|
|
105
|
+
markers = ["release: pre-release test that runs every registry model on its default instance"]
|
|
109
106
|
xfail_strict = true
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import logging
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
os.environ.setdefault("SAGEMAKER_SUPPRESS_V2_WARNING", "1")
|
|
5
|
-
import sagemaker
|
|
6
|
-
from packaging.version import Version
|
|
7
|
-
|
|
8
|
-
if Version(sagemaker.__version__) >= Version("3.0"):
|
|
9
|
-
raise ImportError(
|
|
10
|
-
f"SageMaker SDK >= 3.0 is currently not supported (found {sagemaker.__version__}). "
|
|
11
|
-
"Please downgrade: pip install -U 'sagemaker<3'"
|
|
12
|
-
)
|
|
13
2
|
|
|
14
3
|
from autogluon.common.utils.log_utils import _add_stream_handler
|
|
15
4
|
|
|
16
5
|
from .cloud_setup import bootstrap, register, status, teardown
|
|
6
|
+
from .endpoint.multimodal_endpoint import MultiModalEndpoint
|
|
17
7
|
from .endpoint.tabular_endpoint import TabularEndpoint
|
|
18
8
|
from .endpoint.timeseries_endpoint import TimeSeriesEndpoint
|
|
19
9
|
from .model.foundation_model import TabularFoundationModel, TimeSeriesFoundationModel
|
|
@@ -24,6 +14,7 @@ logging.getLogger(__name__).setLevel(logging.INFO)
|
|
|
24
14
|
|
|
25
15
|
__all__ = [
|
|
26
16
|
"MultiModalCloudPredictor",
|
|
17
|
+
"MultiModalEndpoint",
|
|
27
18
|
"TabularCloudPredictor",
|
|
28
19
|
"TabularEndpoint",
|
|
29
20
|
"TabularFoundationModel",
|
|
@@ -3,14 +3,12 @@ from __future__ import annotations
|
|
|
3
3
|
import json
|
|
4
4
|
import os
|
|
5
5
|
from abc import ABC, abstractmethod
|
|
6
|
-
from typing import Any
|
|
6
|
+
from typing import Any
|
|
7
7
|
|
|
8
8
|
import pandas as pd
|
|
9
9
|
|
|
10
|
-
from ..endpoint.endpoint import Endpoint
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
def dumps_ag_args(config: Dict[str, Any]) -> str:
|
|
11
|
+
def dumps_ag_args(config: dict[str, Any]) -> str:
|
|
14
12
|
"""Serialize the remote-training config to JSON, raising a user-facing error on failure.
|
|
15
13
|
|
|
16
14
|
The config carries the user's predictor init/fit arguments. Some objects (search spaces,
|
|
@@ -58,8 +56,8 @@ class Backend(ABC):
|
|
|
58
56
|
self,
|
|
59
57
|
local_output_path: str,
|
|
60
58
|
predictor_type: str,
|
|
61
|
-
cloud_output_path:
|
|
62
|
-
resource_prefix:
|
|
59
|
+
cloud_output_path: str | None = None,
|
|
60
|
+
resource_prefix: str | None = None,
|
|
63
61
|
**kwargs,
|
|
64
62
|
) -> None:
|
|
65
63
|
"""Initialize the backend."""
|
|
@@ -68,12 +66,7 @@ class Backend(ABC):
|
|
|
68
66
|
self.predictor_type = predictor_type
|
|
69
67
|
self.resource_prefix = resource_prefix or f"ag-cloud-{predictor_type}"
|
|
70
68
|
self.original_features = None
|
|
71
|
-
self.
|
|
72
|
-
|
|
73
|
-
@abstractmethod
|
|
74
|
-
def parse_backend_fit_kwargs(self, kwargs: Dict) -> Dict[str, Any]:
|
|
75
|
-
"""Parse backend specific kwargs and get them ready to be sent to fit call"""
|
|
76
|
-
raise NotImplementedError
|
|
69
|
+
self.endpoint_name: str | None = None
|
|
77
70
|
|
|
78
71
|
@abstractmethod
|
|
79
72
|
def attach_job(self, job_name: str) -> None:
|
|
@@ -108,7 +101,7 @@ class Backend(ABC):
|
|
|
108
101
|
raise NotImplementedError
|
|
109
102
|
|
|
110
103
|
@abstractmethod
|
|
111
|
-
def get_fit_job_info(self) ->
|
|
104
|
+
def get_fit_job_info(self) -> dict[str, Any]:
|
|
112
105
|
"""
|
|
113
106
|
Get general info of the training job.
|
|
114
107
|
"""
|
|
@@ -139,11 +132,6 @@ class Backend(ABC):
|
|
|
139
132
|
"""Fit AG on the backend"""
|
|
140
133
|
raise NotImplementedError
|
|
141
134
|
|
|
142
|
-
@abstractmethod
|
|
143
|
-
def parse_backend_deploy_kwargs(self, kwargs: Dict) -> Dict[str, Any]:
|
|
144
|
-
"""Parse backend specific kwargs and get them ready to be sent to deploy call"""
|
|
145
|
-
raise NotImplementedError
|
|
146
|
-
|
|
147
135
|
@abstractmethod
|
|
148
136
|
def deploy(self, **kwargs) -> None:
|
|
149
137
|
"""Deploy and endpoint"""
|
|
@@ -155,32 +143,27 @@ class Backend(ABC):
|
|
|
155
143
|
raise NotImplementedError
|
|
156
144
|
|
|
157
145
|
@abstractmethod
|
|
158
|
-
def attach_endpoint(self, endpoint:
|
|
159
|
-
"""Attach the backend to an existing endpoint"""
|
|
146
|
+
def attach_endpoint(self, endpoint: str) -> None:
|
|
147
|
+
"""Attach the backend to an existing endpoint by name"""
|
|
160
148
|
raise NotImplementedError
|
|
161
149
|
|
|
162
150
|
@abstractmethod
|
|
163
|
-
def detach_endpoint(self) ->
|
|
164
|
-
"""Detach the current endpoint and return
|
|
151
|
+
def detach_endpoint(self) -> str:
|
|
152
|
+
"""Detach the current endpoint and return its name"""
|
|
165
153
|
raise NotImplementedError
|
|
166
154
|
|
|
167
155
|
@abstractmethod
|
|
168
|
-
def predict_real_time(self, test_data:
|
|
156
|
+
def predict_real_time(self, test_data: str | pd.DataFrame, **kwargs) -> pd.DataFrame | pd.Series:
|
|
169
157
|
"""Realtime prediction with the endpoint"""
|
|
170
158
|
raise NotImplementedError
|
|
171
159
|
|
|
172
160
|
@abstractmethod
|
|
173
|
-
def predict_proba_real_time(self, test_data:
|
|
161
|
+
def predict_proba_real_time(self, test_data: str | pd.DataFrame, **kwargs) -> pd.DataFrame | pd.Series:
|
|
174
162
|
"""Realtime prediction probability with the endpoint"""
|
|
175
163
|
raise NotImplementedError
|
|
176
164
|
|
|
177
165
|
@abstractmethod
|
|
178
|
-
def
|
|
179
|
-
"""Parse backend specific kwargs and get them ready to be sent to predict call"""
|
|
180
|
-
raise NotImplementedError
|
|
181
|
-
|
|
182
|
-
@abstractmethod
|
|
183
|
-
def get_batch_inference_job_info(self, job_name: Optional[str] = None) -> Dict[str, Any]:
|
|
166
|
+
def get_batch_inference_job_info(self, job_name: str | None = None) -> dict[str, Any]:
|
|
184
167
|
"""
|
|
185
168
|
Get general info of the batch inference job.
|
|
186
169
|
If job_name not specified, return the info of the most recent batch inference job
|
|
@@ -188,7 +171,7 @@ class Backend(ABC):
|
|
|
188
171
|
raise NotImplementedError
|
|
189
172
|
|
|
190
173
|
@abstractmethod
|
|
191
|
-
def get_batch_inference_job_status(self, job_name:
|
|
174
|
+
def get_batch_inference_job_status(self, job_name: str | None = None) -> str:
|
|
192
175
|
"""
|
|
193
176
|
Get general status of the batch inference job.
|
|
194
177
|
If job_name not specified, return the info of the most recent batch inference job
|
|
@@ -196,17 +179,17 @@ class Backend(ABC):
|
|
|
196
179
|
raise NotImplementedError
|
|
197
180
|
|
|
198
181
|
@abstractmethod
|
|
199
|
-
def get_batch_inference_jobs(self) ->
|
|
182
|
+
def get_batch_inference_jobs(self) -> list[str]:
|
|
200
183
|
"""Get a list of names of all batch inference jobs"""
|
|
201
184
|
raise NotImplementedError
|
|
202
185
|
|
|
203
186
|
@abstractmethod
|
|
204
|
-
def predict(self, test_data:
|
|
187
|
+
def predict(self, test_data: str | pd.DataFrame, **kwargs) -> pd.DataFrame | pd.Series:
|
|
205
188
|
"""Batch inference"""
|
|
206
189
|
raise NotImplementedError
|
|
207
190
|
|
|
208
191
|
@abstractmethod
|
|
209
|
-
def predict_proba(self, test_data:
|
|
192
|
+
def predict_proba(self, test_data: str | pd.DataFrame, **kwargs) -> pd.DataFrame | pd.Series:
|
|
210
193
|
"""Batch inference probability"""
|
|
211
194
|
raise NotImplementedError
|
|
212
195
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
from .backend import Backend
|
|
2
|
+
from .multimodal_sagemaker_backend import MultiModalSagemakerBackend
|
|
3
|
+
from .sagemaker_backend import SagemakerBackend
|
|
4
|
+
from .tabular_sagemaker_backend import TabularSagemakerBackend
|
|
5
|
+
from .timeseries_sagemaker_backend import TimeSeriesSagemakerBackend
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BackendFactory:
|
|
9
|
+
_BACKENDS = {
|
|
10
|
+
SagemakerBackend.name: SagemakerBackend,
|
|
11
|
+
TabularSagemakerBackend.name: TabularSagemakerBackend,
|
|
12
|
+
MultiModalSagemakerBackend.name: MultiModalSagemakerBackend,
|
|
13
|
+
TimeSeriesSagemakerBackend.name: TimeSeriesSagemakerBackend,
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@staticmethod
|
|
17
|
+
def get_backend_cls(backend: str) -> type[Backend]:
|
|
18
|
+
if backend in BackendFactory._BACKENDS:
|
|
19
|
+
return BackendFactory._BACKENDS[backend]
|
|
20
|
+
raise ValueError(f"{backend} not supported. Supported backends: {sorted(BackendFactory._BACKENDS)}")
|
|
21
|
+
|
|
22
|
+
@staticmethod
|
|
23
|
+
def get_backend(backend: str, **init_args) -> Backend:
|
|
24
|
+
"""Return the corresponding backend"""
|
|
25
|
+
return BackendFactory.get_backend_cls(backend)(**init_args)
|
|
@@ -2,9 +2,6 @@ SAGEMAKER = "sagemaker"
|
|
|
2
2
|
TABULAR_SAGEMAKER = "tabular_sagemaker"
|
|
3
3
|
MULTIMODL_SAGEMAKER = "multimodal_sagemaker"
|
|
4
4
|
TIMESERIES_SAGEMAKER = "timeseries_sagemaker"
|
|
5
|
-
RAY = "ray"
|
|
6
|
-
RAY_AWS = "ray_aws"
|
|
7
|
-
TABULAR_RAY_AWS = "tabular_ray_aws"
|
|
8
5
|
|
|
9
6
|
# Backends the top-level setup API can provision via CloudFormation.
|
|
10
|
-
SUPPORTED_BACKENDS = (SAGEMAKER,
|
|
7
|
+
SUPPORTED_BACKENDS = (SAGEMAKER,)
|