autogluon.cloud 0.4.2__tar.gz → 0.5.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.5.0/PKG-INFO +165 -0
- autogluon_cloud-0.5.0/README.md +93 -0
- autogluon_cloud-0.5.0/pyproject.toml +37 -0
- autogluon_cloud-0.5.0/setup.cfg +4 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/setup.py +30 -20
- autogluon_cloud-0.5.0/src/autogluon/cloud/__init__.py +32 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/backend.py +15 -6
- autogluon_cloud-0.5.0/src/autogluon/cloud/backend/backend_factory.py +39 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/constant.py +3 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/ray_aws_backend.py +4 -9
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/ray_backend.py +9 -13
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/sagemaker_backend.py +267 -174
- autogluon_cloud-0.5.0/src/autogluon/cloud/backend/timeseries_sagemaker_backend.py +272 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/cli.py +246 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/cloud_setup.py +374 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/cluster/cluster_config_generator.py +3 -3
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/cluster/cluster_manager.py +0 -7
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/cluster/ray_aws_cluster_config_generator.py +24 -15
- autogluon_cloud-0.5.0/src/autogluon/cloud/cluster/ray_aws_cluster_manager.py +11 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/cluster/ray_cluster_manager.py +1 -8
- autogluon_cloud-0.5.0/src/autogluon/cloud/config.py +96 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/default_cluster_configs/ray_aws_default_cluster_config.yaml +47 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/endpoint/prediction_future.py +52 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/endpoint/timeseries_endpoint.py +112 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/job/sagemaker_job.py +2 -7
- autogluon_cloud-0.5.0/src/autogluon/cloud/model/__init__.py +10 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/model/foundation_model.py +705 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/model/registry.py +56 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/predictor/cloud_predictor.py +88 -71
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/predictor/multimodal_cloud_predictor.py +6 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/predictor/tabular_cloud_predictor.py +6 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/predictor/timeseries_cloud_predictor.py +451 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/scripts/sagemaker_scripts/multimodal_serve.py +11 -17
- autogluon_cloud-0.5.0/src/autogluon/cloud/scripts/sagemaker_scripts/serving_utils/__init__.py +0 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/scripts/sagemaker_scripts/serving_utils/timeseries.py +135 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/scripts/sagemaker_scripts/tabular_serve.py +5 -4
- autogluon_cloud-0.5.0/src/autogluon/cloud/scripts/sagemaker_scripts/timeseries_fm_serve.py +62 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/scripts/sagemaker_scripts/timeseries_serve.py +48 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/scripts/sagemaker_scripts/train.py +68 -47
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/scripts/script_manager.py +2 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/templates/ag_cloud_ray_aws.yaml +128 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/templates/ag_cloud_sagemaker.yaml +58 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/ag_sagemaker.py +11 -14
- autogluon_cloud-0.5.0/src/autogluon/cloud/utils/autogluon_dlc.json +1515 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/utils/aws_utils.py +184 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/deserializers.py +3 -3
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/dlc_utils.py +49 -14
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/ec2.py +2 -2
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/ray_aws_iam.py +0 -3
- autogluon_cloud-0.5.0/src/autogluon/cloud/utils/serializers.py +132 -0
- autogluon_cloud-0.5.0/src/autogluon/cloud/utils/tag_utils.py +27 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/version.py +1 -1
- autogluon_cloud-0.5.0/src/autogluon.cloud.egg-info/PKG-INFO +165 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon.cloud.egg-info/SOURCES.txt +17 -4
- autogluon_cloud-0.5.0/src/autogluon.cloud.egg-info/entry_points.txt +2 -0
- autogluon_cloud-0.5.0/src/autogluon.cloud.egg-info/requires.txt +25 -0
- autogluon.cloud-0.4.2/PKG-INFO +0 -80
- autogluon.cloud-0.4.2/README.md +0 -41
- autogluon.cloud-0.4.2/pyproject.toml +0 -16
- autogluon.cloud-0.4.2/setup.cfg +0 -90
- autogluon.cloud-0.4.2/src/autogluon/__init__.py +0 -1
- autogluon.cloud-0.4.2/src/autogluon/cloud/__init__.py +0 -5
- autogluon.cloud-0.4.2/src/autogluon/cloud/backend/backend_factory.py +0 -29
- autogluon.cloud-0.4.2/src/autogluon/cloud/backend/timeseries_sagemaker_backend.py +0 -252
- autogluon.cloud-0.4.2/src/autogluon/cloud/cluster/ray_aws_cluster_manager.py +0 -76
- autogluon.cloud-0.4.2/src/autogluon/cloud/predictor/timeseries_cloud_predictor.py +0 -328
- autogluon.cloud-0.4.2/src/autogluon/cloud/scripts/sagemaker_scripts/timeseries_serve.py +0 -97
- autogluon.cloud-0.4.2/src/autogluon/cloud/utils/aws_utils.py +0 -50
- autogluon.cloud-0.4.2/src/autogluon/cloud/utils/sagemaker_iam.py +0 -155
- autogluon.cloud-0.4.2/src/autogluon/cloud/utils/serializers.py +0 -156
- autogluon.cloud-0.4.2/src/autogluon.cloud.egg-info/PKG-INFO +0 -80
- autogluon.cloud-0.4.2/src/autogluon.cloud.egg-info/namespace_packages.txt +0 -1
- autogluon.cloud-0.4.2/src/autogluon.cloud.egg-info/requires.txt +0 -18
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/LICENSE +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/NOTICE +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/multimodal_sagemaker_backend.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/tabular_sagemaker_backend.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/cluster/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/cluster/constants.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/cluster/ray_cluster_config_generator.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/data/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/data/format_converter.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/default_cluster_configs/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/endpoint/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/endpoint/endpoint.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/endpoint/sagemaker_endpoint.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/job/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/job/ray_job.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/job/remote_job.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/predictor/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/scripts/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/scripts/ray_scripts/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/scripts/ray_scripts/train.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/scripts/sagemaker_scripts/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/__init__.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/constants.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/iam.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/misc.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/s3_utils.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/utils/utils.py +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon.cloud.egg-info/dependency_links.txt +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon.cloud.egg-info/top_level.txt +0 -0
- {autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon.cloud.egg-info/zip-safe +0 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: autogluon.cloud
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: Train and deploy AutoGluon backed models on the cloud
|
|
5
|
+
Home-page: https://github.com/autogluon/autogluon-cloud
|
|
6
|
+
Author: AutoGluon Community
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Documentation, https://auto.gluon.ai
|
|
9
|
+
Project-URL: Bug Reports, https://github.com/autogluon/autogluon-cloud/issues
|
|
10
|
+
Project-URL: Source, https://github.com/autogluon/autogluon-cloud/
|
|
11
|
+
Project-URL: Contribute!, https://github.com/autogluon/autogluon-cloud/blob/master/CONTRIBUTING.md
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Intended Audience :: Education
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Intended Audience :: Customer Service
|
|
17
|
+
Classifier: Intended Audience :: Financial and Insurance Industry
|
|
18
|
+
Classifier: Intended Audience :: Healthcare Industry
|
|
19
|
+
Classifier: Intended Audience :: Telecommunications Industry
|
|
20
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
21
|
+
Classifier: Operating System :: MacOS
|
|
22
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
23
|
+
Classifier: Operating System :: POSIX
|
|
24
|
+
Classifier: Operating System :: Unix
|
|
25
|
+
Classifier: Programming Language :: Python :: 3
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
27
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
28
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
29
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
30
|
+
Classifier: Topic :: Software Development
|
|
31
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
32
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
33
|
+
Classifier: Topic :: Scientific/Engineering :: Image Recognition
|
|
34
|
+
Requires-Python: >=3.10, <3.14
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
License-File: LICENSE
|
|
37
|
+
License-File: NOTICE
|
|
38
|
+
Requires-Dist: autogluon.common<1.6,>=0.7
|
|
39
|
+
Requires-Dist: boto3<2,>=1.10
|
|
40
|
+
Requires-Dist: packaging<27,>=23.0
|
|
41
|
+
Requires-Dist: sagemaker<3,>=2.126.0
|
|
42
|
+
Requires-Dist: pyarrow<25,>=19.0.1
|
|
43
|
+
Requires-Dist: PyYAML~=6.0
|
|
44
|
+
Requires-Dist: Pillow<13,>=10.2
|
|
45
|
+
Requires-Dist: huggingface_hub<2,>=0.20
|
|
46
|
+
Requires-Dist: typing_extensions<5,>=4.0
|
|
47
|
+
Requires-Dist: click<9,>=8.0
|
|
48
|
+
Requires-Dist: rich<15,>=13.0
|
|
49
|
+
Provides-Extra: ray
|
|
50
|
+
Requires-Dist: ray[default]<2.56,>=2.10.0; extra == "ray"
|
|
51
|
+
Provides-Extra: all
|
|
52
|
+
Requires-Dist: autogluon<1.6,>=0.7; extra == "all"
|
|
53
|
+
Requires-Dist: ray[default]<2.56,>=2.10.0; extra == "all"
|
|
54
|
+
Provides-Extra: tests
|
|
55
|
+
Requires-Dist: moto; extra == "tests"
|
|
56
|
+
Requires-Dist: pytest; extra == "tests"
|
|
57
|
+
Requires-Dist: autogluon.common>=0.7; extra == "tests"
|
|
58
|
+
Requires-Dist: pytest-cov; extra == "tests"
|
|
59
|
+
Requires-Dist: tox; extra == "tests"
|
|
60
|
+
Dynamic: author
|
|
61
|
+
Dynamic: classifier
|
|
62
|
+
Dynamic: description
|
|
63
|
+
Dynamic: description-content-type
|
|
64
|
+
Dynamic: home-page
|
|
65
|
+
Dynamic: license
|
|
66
|
+
Dynamic: license-file
|
|
67
|
+
Dynamic: project-url
|
|
68
|
+
Dynamic: provides-extra
|
|
69
|
+
Dynamic: requires-dist
|
|
70
|
+
Dynamic: requires-python
|
|
71
|
+
Dynamic: summary
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
<div align="center">
|
|
76
|
+
<img src="https://user-images.githubusercontent.com/16392542/77208906-224aa500-6aba-11ea-96bd-e81806074030.png" width="350">
|
|
77
|
+
|
|
78
|
+
## Train and Deploy AutoGluon in the Cloud
|
|
79
|
+
|
|
80
|
+
[](https://pypi.org/project/autogluon.cloud/)
|
|
81
|
+
[](https://pypi.org/project/autogluon.cloud/)
|
|
82
|
+
[](./LICENSE)
|
|
83
|
+
[](https://github.com/autogluon/autogluon-cloud/actions/workflows/continuous_integration.yml)
|
|
84
|
+
|
|
85
|
+
[AutoGluon-Cloud Documentation](https://auto.gluon.ai/cloud/stable/index.html) | [AutoGluon Documentation](https://auto.gluon.ai)
|
|
86
|
+
|
|
87
|
+
</div>
|
|
88
|
+
|
|
89
|
+
AutoGluon-Cloud lets you train and deploy state-of-the-art ML models in the cloud in a few lines of code. Run [AutoGluon](https://auto.gluon.ai/stable/index.html) on [Amazon SageMaker](https://aws.amazon.com/sagemaker/) without worrying about infrastructure, dependencies, or a heavy local ML environment. It supports two workflows:
|
|
90
|
+
|
|
91
|
+
- **[Train your own predictor](https://auto.gluon.ai/cloud/stable/tutorials/predictor-tabular.html)** — the same `fit → deploy → predict` workflow as local AutoGluon, with all the heavy lifting offloaded to SageMaker.
|
|
92
|
+
- **[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.
|
|
93
|
+
|
|
94
|
+
## 💾 Installation & setup
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
pip install autogluon.cloud
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Then provision the IAM role and S3 bucket AutoGluon-Cloud needs to run on AWS:
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
from autogluon.cloud import bootstrap
|
|
104
|
+
|
|
105
|
+
bootstrap()
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
See the [Setup tutorial](https://auto.gluon.ai/cloud/stable/tutorials/setup.html) for the full walkthrough, including how to register an existing role and bucket instead.
|
|
109
|
+
|
|
110
|
+
## ⚙️ Train your own model
|
|
111
|
+
|
|
112
|
+
Train an AutoGluon predictor on your data and serve it from a SageMaker endpoint — same API as local AutoGluon, all heavy lifting on AWS. Full walkthrough: [tabular](https://auto.gluon.ai/cloud/stable/tutorials/predictor-tabular.html), [time series](https://auto.gluon.ai/cloud/stable/tutorials/predictor-timeseries.html).
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
from autogluon.cloud import TabularCloudPredictor
|
|
116
|
+
|
|
117
|
+
# `train_data` and `test_data` can be a local path, S3 URL, or pandas DataFrame
|
|
118
|
+
train_data = "https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv"
|
|
119
|
+
test_data = "https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv"
|
|
120
|
+
|
|
121
|
+
# Train
|
|
122
|
+
cloud_predictor = TabularCloudPredictor()
|
|
123
|
+
cloud_predictor.fit(
|
|
124
|
+
train_data=train_data,
|
|
125
|
+
predictor_init_args={"label": "class"}, # passed to TabularPredictor()
|
|
126
|
+
predictor_fit_args={"time_limit": 120}, # passed to TabularPredictor.fit()
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# Real-time inference endpoint
|
|
130
|
+
cloud_predictor.deploy()
|
|
131
|
+
result = cloud_predictor.predict_real_time(test_data)
|
|
132
|
+
cloud_predictor.cleanup_deployment()
|
|
133
|
+
|
|
134
|
+
# Batch prediction
|
|
135
|
+
result = cloud_predictor.predict(test_data)
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## 🚀 Run a pretrained foundation model
|
|
139
|
+
|
|
140
|
+
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).
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from autogluon.cloud import TimeSeriesFoundationModel
|
|
144
|
+
|
|
145
|
+
# `data` can be a local path, S3 URL, or pandas DataFrame
|
|
146
|
+
data = "https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly_tiny/train.csv"
|
|
147
|
+
|
|
148
|
+
model = TimeSeriesFoundationModel("chronos-2")
|
|
149
|
+
|
|
150
|
+
# Batch prediction — no training required
|
|
151
|
+
predictions = model.predict(
|
|
152
|
+
data=data,
|
|
153
|
+
target="target",
|
|
154
|
+
prediction_length=24,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
# Real-time inference endpoint
|
|
158
|
+
endpoint = model.deploy()
|
|
159
|
+
predictions = endpoint.predict(
|
|
160
|
+
data=data,
|
|
161
|
+
target="target",
|
|
162
|
+
prediction_length=24,
|
|
163
|
+
)
|
|
164
|
+
endpoint.delete_endpoint()
|
|
165
|
+
```
|
|
@@ -0,0 +1,93 @@
|
|
|
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 in the cloud in a few lines of code. Run [AutoGluon](https://auto.gluon.ai/stable/index.html) on [Amazon SageMaker](https://aws.amazon.com/sagemaker/) without worrying about infrastructure, dependencies, or a heavy local ML environment. It supports two workflows:
|
|
18
|
+
|
|
19
|
+
- **[Train your own predictor](https://auto.gluon.ai/cloud/stable/tutorials/predictor-tabular.html)** — the same `fit → deploy → predict` workflow as local AutoGluon, with all the heavy lifting offloaded to SageMaker.
|
|
20
|
+
- **[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.
|
|
21
|
+
|
|
22
|
+
## 💾 Installation & setup
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pip install autogluon.cloud
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then provision the IAM role and S3 bucket AutoGluon-Cloud needs to run on AWS:
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from autogluon.cloud import bootstrap
|
|
32
|
+
|
|
33
|
+
bootstrap()
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
See the [Setup tutorial](https://auto.gluon.ai/cloud/stable/tutorials/setup.html) for the full walkthrough, including how to register an existing role and bucket instead.
|
|
37
|
+
|
|
38
|
+
## ⚙️ Train your own model
|
|
39
|
+
|
|
40
|
+
Train an AutoGluon predictor on your data and serve it from a SageMaker endpoint — same API as local AutoGluon, all heavy lifting on AWS. Full walkthrough: [tabular](https://auto.gluon.ai/cloud/stable/tutorials/predictor-tabular.html), [time series](https://auto.gluon.ai/cloud/stable/tutorials/predictor-timeseries.html).
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from autogluon.cloud import TabularCloudPredictor
|
|
44
|
+
|
|
45
|
+
# `train_data` and `test_data` can be a local path, S3 URL, or pandas DataFrame
|
|
46
|
+
train_data = "https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv"
|
|
47
|
+
test_data = "https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv"
|
|
48
|
+
|
|
49
|
+
# Train
|
|
50
|
+
cloud_predictor = TabularCloudPredictor()
|
|
51
|
+
cloud_predictor.fit(
|
|
52
|
+
train_data=train_data,
|
|
53
|
+
predictor_init_args={"label": "class"}, # passed to TabularPredictor()
|
|
54
|
+
predictor_fit_args={"time_limit": 120}, # passed to TabularPredictor.fit()
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
# Real-time inference endpoint
|
|
58
|
+
cloud_predictor.deploy()
|
|
59
|
+
result = cloud_predictor.predict_real_time(test_data)
|
|
60
|
+
cloud_predictor.cleanup_deployment()
|
|
61
|
+
|
|
62
|
+
# Batch prediction
|
|
63
|
+
result = cloud_predictor.predict(test_data)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## 🚀 Run a pretrained foundation model
|
|
67
|
+
|
|
68
|
+
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).
|
|
69
|
+
|
|
70
|
+
```python
|
|
71
|
+
from autogluon.cloud import TimeSeriesFoundationModel
|
|
72
|
+
|
|
73
|
+
# `data` can be a local path, S3 URL, or pandas DataFrame
|
|
74
|
+
data = "https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly_tiny/train.csv"
|
|
75
|
+
|
|
76
|
+
model = TimeSeriesFoundationModel("chronos-2")
|
|
77
|
+
|
|
78
|
+
# Batch prediction — no training required
|
|
79
|
+
predictions = model.predict(
|
|
80
|
+
data=data,
|
|
81
|
+
target="target",
|
|
82
|
+
prediction_length=24,
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
# Real-time inference endpoint
|
|
86
|
+
endpoint = model.deploy()
|
|
87
|
+
predictions = endpoint.predict(
|
|
88
|
+
data=data,
|
|
89
|
+
target="target",
|
|
90
|
+
prediction_length=24,
|
|
91
|
+
)
|
|
92
|
+
endpoint.delete_endpoint()
|
|
93
|
+
```
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[tool.ruff]
|
|
2
|
+
line-length = 119
|
|
3
|
+
target-version = "py310"
|
|
4
|
+
|
|
5
|
+
[tool.ruff.lint]
|
|
6
|
+
select = ["E", "F", "I", "W"]
|
|
7
|
+
ignore = ["E501"]
|
|
8
|
+
per-file-ignores = {"*/__init__.py" = ["F401"]}
|
|
9
|
+
|
|
10
|
+
[tool.ruff.lint.isort]
|
|
11
|
+
known-first-party = ["autogluon"]
|
|
12
|
+
|
|
13
|
+
[tool.mypy]
|
|
14
|
+
warn_unused_configs = true
|
|
15
|
+
show_error_context = true
|
|
16
|
+
pretty = true
|
|
17
|
+
check_untyped_defs = true
|
|
18
|
+
|
|
19
|
+
[tool.pytest.ini_options]
|
|
20
|
+
testpaths = ["tests"]
|
|
21
|
+
addopts = "--strict-markers"
|
|
22
|
+
xfail_strict = true
|
|
23
|
+
|
|
24
|
+
[tool.coverage.run]
|
|
25
|
+
source = ["autogluon.cloud"]
|
|
26
|
+
branch = true
|
|
27
|
+
|
|
28
|
+
[tool.coverage.report]
|
|
29
|
+
show_missing = true
|
|
30
|
+
skip_covered = true
|
|
31
|
+
fail_under = 80
|
|
32
|
+
|
|
33
|
+
[tool.coverage.paths]
|
|
34
|
+
source = [
|
|
35
|
+
"src/autogluon/cloud",
|
|
36
|
+
"*/site-packages/autogluon/cloud",
|
|
37
|
+
]
|
|
@@ -5,7 +5,7 @@ from setuptools import setup
|
|
|
5
5
|
AUTOGLUON = "autogluon"
|
|
6
6
|
CLOUD = "cloud"
|
|
7
7
|
|
|
8
|
-
PYTHON_REQUIRES = ">=3.
|
|
8
|
+
PYTHON_REQUIRES = ">=3.10, <3.14"
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
def create_version_file(*, version):
|
|
@@ -43,7 +43,7 @@ def update_version(version, use_file_if_exists=True, create_file=False):
|
|
|
43
43
|
|
|
44
44
|
|
|
45
45
|
def default_setup_args(*, version):
|
|
46
|
-
from setuptools import
|
|
46
|
+
from setuptools import find_namespace_packages
|
|
47
47
|
|
|
48
48
|
long_description = open("README.md").read()
|
|
49
49
|
name = f"{AUTOGLUON}.{CLOUD}"
|
|
@@ -58,17 +58,17 @@ def default_setup_args(*, version):
|
|
|
58
58
|
license="Apache-2.0",
|
|
59
59
|
license_files=("LICENSE", "NOTICE"),
|
|
60
60
|
# Package info
|
|
61
|
-
packages=
|
|
61
|
+
packages=find_namespace_packages("src"),
|
|
62
62
|
package_dir={"": "src"},
|
|
63
|
-
namespace_packages=[AUTOGLUON],
|
|
64
63
|
zip_safe=True,
|
|
65
64
|
include_package_data=True,
|
|
66
65
|
python_requires=PYTHON_REQUIRES,
|
|
67
66
|
package_data={
|
|
68
|
-
|
|
69
|
-
"
|
|
67
|
+
"autogluon.cloud": [
|
|
68
|
+
"default_cluster_configs/*.yaml",
|
|
69
|
+
"utils/autogluon_dlc.json",
|
|
70
|
+
"templates/*.yaml",
|
|
70
71
|
],
|
|
71
|
-
'autogluon.cloud': ['default_cluster_configs/*.yaml'],
|
|
72
72
|
},
|
|
73
73
|
classifiers=[
|
|
74
74
|
"Development Status :: 4 - Beta",
|
|
@@ -85,10 +85,10 @@ def default_setup_args(*, version):
|
|
|
85
85
|
"Operating System :: POSIX",
|
|
86
86
|
"Operating System :: Unix",
|
|
87
87
|
"Programming Language :: Python :: 3",
|
|
88
|
-
"Programming Language :: Python :: 3.8",
|
|
89
|
-
"Programming Language :: Python :: 3.9",
|
|
90
88
|
"Programming Language :: Python :: 3.10",
|
|
91
89
|
"Programming Language :: Python :: 3.11",
|
|
90
|
+
"Programming Language :: Python :: 3.12",
|
|
91
|
+
"Programming Language :: Python :: 3.13",
|
|
92
92
|
"Topic :: Software Development",
|
|
93
93
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
94
94
|
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
@@ -104,27 +104,32 @@ def default_setup_args(*, version):
|
|
|
104
104
|
return setup_args
|
|
105
105
|
|
|
106
106
|
|
|
107
|
-
version = "0.
|
|
107
|
+
version = "0.5.0"
|
|
108
108
|
version = update_version(version, use_file_if_exists=False, create_file=True)
|
|
109
109
|
|
|
110
110
|
install_requires = [
|
|
111
111
|
# common module provides utils with stable api across minor version
|
|
112
|
-
"autogluon.common>=0.7",
|
|
112
|
+
"autogluon.common>=0.7,<1.6",
|
|
113
113
|
# <2 because unlikely to introduce breaking changes in minor releases. >=1.10 because 1.10 is 3 years old, no need to support older
|
|
114
|
-
"boto3>=1.10,<2
|
|
115
|
-
"packaging>=23.0,<
|
|
116
|
-
|
|
117
|
-
#
|
|
118
|
-
"sagemaker>=2.126.0,<3.0",
|
|
119
|
-
"pyarrow>=11.0,<11.1",
|
|
114
|
+
"boto3>=1.10,<2",
|
|
115
|
+
"packaging>=23.0,<27",
|
|
116
|
+
"sagemaker>=2.126.0,<3",
|
|
117
|
+
"pyarrow>=19.0.1,<25", # lower bound to avoid https://github.com/apache/arrow/issues/45283
|
|
120
118
|
"PyYAML~=6.0",
|
|
121
|
-
"Pillow>=10.2,<
|
|
122
|
-
"
|
|
119
|
+
"Pillow>=10.2,<13",
|
|
120
|
+
"huggingface_hub>=0.20,<2",
|
|
121
|
+
"typing_extensions>=4.0,<5",
|
|
122
|
+
# CLI dependencies (autogluon-cloud command)
|
|
123
|
+
"click>=8.0,<9",
|
|
124
|
+
"rich>=13.0,<15",
|
|
123
125
|
]
|
|
124
126
|
|
|
125
127
|
extras_require = dict()
|
|
126
128
|
|
|
127
|
-
|
|
129
|
+
ray_requires = ["ray[default]>=2.10.0,<2.56"]
|
|
130
|
+
extras_require["ray"] = ray_requires
|
|
131
|
+
|
|
132
|
+
all_requires = ["autogluon>=0.7,<1.6"] + ray_requires # To allow user to pass ag objects
|
|
128
133
|
extras_require["all"] = all_requires
|
|
129
134
|
|
|
130
135
|
test_requirements = [
|
|
@@ -144,5 +149,10 @@ if __name__ == "__main__":
|
|
|
144
149
|
setup(
|
|
145
150
|
install_requires=install_requires,
|
|
146
151
|
extras_require=extras_require,
|
|
152
|
+
entry_points={
|
|
153
|
+
"console_scripts": [
|
|
154
|
+
"autogluon-cloud=autogluon.cloud.cli:main",
|
|
155
|
+
],
|
|
156
|
+
},
|
|
147
157
|
**setup_args,
|
|
148
158
|
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
|
|
3
|
+
import sagemaker
|
|
4
|
+
from packaging.version import Version
|
|
5
|
+
|
|
6
|
+
if Version(sagemaker.__version__) >= Version("3.0"):
|
|
7
|
+
raise ImportError(
|
|
8
|
+
f"SageMaker SDK >= 3.0 is currently not supported (found {sagemaker.__version__}). "
|
|
9
|
+
"Please downgrade: pip install -U 'sagemaker<3'"
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from autogluon.common.utils.log_utils import _add_stream_handler
|
|
13
|
+
|
|
14
|
+
from .cloud_setup import bootstrap, register, status, teardown
|
|
15
|
+
from .endpoint.timeseries_endpoint import TimeSeriesEndpoint
|
|
16
|
+
from .model.foundation_model import TimeSeriesFoundationModel
|
|
17
|
+
from .predictor import MultiModalCloudPredictor, TabularCloudPredictor, TimeSeriesCloudPredictor
|
|
18
|
+
|
|
19
|
+
_add_stream_handler()
|
|
20
|
+
logging.getLogger(__name__).setLevel(logging.INFO)
|
|
21
|
+
|
|
22
|
+
__all__ = [
|
|
23
|
+
"MultiModalCloudPredictor",
|
|
24
|
+
"TabularCloudPredictor",
|
|
25
|
+
"TimeSeriesCloudPredictor",
|
|
26
|
+
"TimeSeriesEndpoint",
|
|
27
|
+
"TimeSeriesFoundationModel",
|
|
28
|
+
"bootstrap",
|
|
29
|
+
"register",
|
|
30
|
+
"status",
|
|
31
|
+
"teardown",
|
|
32
|
+
]
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import os
|
|
3
4
|
import pickle
|
|
4
5
|
from abc import ABC, abstractmethod
|
|
5
6
|
from typing import Any, Dict, List, Optional, Union
|
|
@@ -18,7 +19,11 @@ class Backend(ABC):
|
|
|
18
19
|
@property
|
|
19
20
|
def cloud_output_path(self) -> str:
|
|
20
21
|
if not self._cloud_output_path:
|
|
21
|
-
raise ValueError(
|
|
22
|
+
raise ValueError(
|
|
23
|
+
"No `cloud_output_path` was provided and no bucket is configured in "
|
|
24
|
+
"~/.autogluon/cloud.yaml. Either pass `cloud_output_path=` explicitly, or run "
|
|
25
|
+
"`autogluon.cloud.bootstrap()` / `register(bucket=...)` once to persist a bucket."
|
|
26
|
+
)
|
|
22
27
|
return self._cloud_output_path
|
|
23
28
|
|
|
24
29
|
def initialize(
|
|
@@ -29,11 +34,7 @@ class Backend(ABC):
|
|
|
29
34
|
self._cloud_output_path = cloud_output_path
|
|
30
35
|
self.predictor_type = predictor_type
|
|
31
36
|
self.original_features = None
|
|
32
|
-
|
|
33
|
-
@abstractmethod
|
|
34
|
-
def generate_default_permission(self, **kwargs) -> Dict[str, str]:
|
|
35
|
-
"""Generate default permission file user could use to setup the corresponding entity, i.e. IAM Role in AWS"""
|
|
36
|
-
raise NotImplementedError
|
|
37
|
+
self.endpoint: Optional[Endpoint] = None
|
|
37
38
|
|
|
38
39
|
@abstractmethod
|
|
39
40
|
def parse_backend_fit_kwargs(self, kwargs: Dict) -> Dict[str, Any]:
|
|
@@ -91,6 +92,7 @@ class Backend(ABC):
|
|
|
91
92
|
"""
|
|
92
93
|
assert self.predictor_type is not None
|
|
93
94
|
config = self._construct_ag_args(**kwargs)
|
|
95
|
+
os.makedirs(os.path.dirname(path), exist_ok=True)
|
|
94
96
|
with open(path, "wb") as f:
|
|
95
97
|
pickle.dump(config, f)
|
|
96
98
|
|
|
@@ -172,3 +174,10 @@ class Backend(ABC):
|
|
|
172
174
|
def predict_proba(self, test_data: Union[str, pd.DataFrame], **kwargs) -> Union[pd.DataFrame, pd.Series]:
|
|
173
175
|
"""Batch inference probability"""
|
|
174
176
|
raise NotImplementedError
|
|
177
|
+
|
|
178
|
+
def get_fit_predict_results(self) -> pd.DataFrame:
|
|
179
|
+
"""
|
|
180
|
+
Retrieve predictions produced by a completed ``fit_predict`` job.
|
|
181
|
+
|
|
182
|
+
"""
|
|
183
|
+
raise NotImplementedError(f"{self.__class__.__name__} does not support `fit_predict`.")
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
from .backend import Backend
|
|
2
|
+
from .constant import RAY_AWS, TABULAR_RAY_AWS
|
|
3
|
+
from .multimodal_sagemaker_backend import MultiModalSagemakerBackend
|
|
4
|
+
from .sagemaker_backend import SagemakerBackend
|
|
5
|
+
from .tabular_sagemaker_backend import TabularSagemakerBackend
|
|
6
|
+
from .timeseries_sagemaker_backend import TimeSeriesSagemakerBackend
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class BackendFactory:
|
|
10
|
+
_SAGEMAKER_BACKENDS = {
|
|
11
|
+
SagemakerBackend.name: SagemakerBackend,
|
|
12
|
+
TabularSagemakerBackend.name: TabularSagemakerBackend,
|
|
13
|
+
MultiModalSagemakerBackend.name: MultiModalSagemakerBackend,
|
|
14
|
+
TimeSeriesSagemakerBackend.name: TimeSeriesSagemakerBackend,
|
|
15
|
+
}
|
|
16
|
+
_RAY_BACKEND_NAMES = {RAY_AWS, TABULAR_RAY_AWS}
|
|
17
|
+
|
|
18
|
+
@staticmethod
|
|
19
|
+
def get_backend_cls(backend: str) -> type[Backend]:
|
|
20
|
+
if backend in BackendFactory._SAGEMAKER_BACKENDS:
|
|
21
|
+
return BackendFactory._SAGEMAKER_BACKENDS[backend]
|
|
22
|
+
if backend in BackendFactory._RAY_BACKEND_NAMES:
|
|
23
|
+
try:
|
|
24
|
+
from .ray_aws_backend import RayAWSBackend, TabularRayAWSBackend
|
|
25
|
+
except ImportError as e:
|
|
26
|
+
raise ImportError(
|
|
27
|
+
f"The '{backend}' backend requires ray. Install with: pip install 'autogluon.cloud[ray]'"
|
|
28
|
+
) from e
|
|
29
|
+
return {
|
|
30
|
+
RayAWSBackend.name: RayAWSBackend,
|
|
31
|
+
TabularRayAWSBackend.name: TabularRayAWSBackend,
|
|
32
|
+
}[backend]
|
|
33
|
+
supported = sorted(BackendFactory._SAGEMAKER_BACKENDS.keys() | BackendFactory._RAY_BACKEND_NAMES)
|
|
34
|
+
raise ValueError(f"{backend} not supported. Supported backends: {supported}")
|
|
35
|
+
|
|
36
|
+
@staticmethod
|
|
37
|
+
def get_backend(backend: str, **init_args) -> Backend:
|
|
38
|
+
"""Return the corresponding backend"""
|
|
39
|
+
return BackendFactory.get_backend_cls(backend)(**init_args)
|
{autogluon.cloud-0.4.2 → autogluon_cloud-0.5.0}/src/autogluon/cloud/backend/ray_aws_backend.py
RENAMED
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
4
|
import time
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Optional
|
|
6
6
|
|
|
7
7
|
import boto3
|
|
8
8
|
|
|
@@ -55,14 +55,9 @@ class RayAWSBackend(RayBackend):
|
|
|
55
55
|
super().initialize(**kwargs)
|
|
56
56
|
self._boto_session = boto3.session.Session()
|
|
57
57
|
self.region = self._boto_session.region_name
|
|
58
|
-
assert (
|
|
59
|
-
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
@staticmethod
|
|
63
|
-
def generate_default_permission(**kwargs) -> Dict[str, str]:
|
|
64
|
-
"""Generate default permission file user could use to setup the corresponding entity, i.e. IAM Role in AWS"""
|
|
65
|
-
return RayAWSClusterManager.generate_default_permission(**kwargs)
|
|
58
|
+
assert self.region is not None, (
|
|
59
|
+
"Please setup a region via `export AWS_DEFAULT_REGION=YOUR_REGION` in the terminal"
|
|
60
|
+
)
|
|
66
61
|
|
|
67
62
|
def _setup_role_and_permission(self):
|
|
68
63
|
"""
|
|
@@ -8,7 +8,6 @@ import time
|
|
|
8
8
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
9
9
|
|
|
10
10
|
import pandas as pd
|
|
11
|
-
from sagemaker import image_uris
|
|
12
11
|
|
|
13
12
|
from autogluon.common.utils.s3_utils import s3_bucket_prefix_to_path, s3_path_to_bucket_prefix
|
|
14
13
|
|
|
@@ -19,7 +18,7 @@ from ..endpoint.endpoint import Endpoint
|
|
|
19
18
|
from ..job.ray_job import RayFitJob
|
|
20
19
|
from ..scripts import ScriptManager
|
|
21
20
|
from ..utils.constants import CLOUD_RESOURCE_PREFIX
|
|
22
|
-
from ..utils.dlc_utils import parse_framework_version
|
|
21
|
+
from ..utils.dlc_utils import parse_framework_version, retrieve_image_uri
|
|
23
22
|
from ..utils.ec2 import get_latest_ami
|
|
24
23
|
from ..utils.iam import get_instance_profile_arn
|
|
25
24
|
from ..utils.ray_aws_iam import RAY_INSTANCE_PROFILE_NAME
|
|
@@ -53,11 +52,6 @@ class RayBackend(Backend):
|
|
|
53
52
|
self._fit_job = RayFitJob()
|
|
54
53
|
os.makedirs(os.path.join(self.local_output_path, "job"), exist_ok=True)
|
|
55
54
|
|
|
56
|
-
@staticmethod
|
|
57
|
-
def generate_default_permission(**kwargs) -> Dict[str, str]:
|
|
58
|
-
"""Generate default permission file user could use to setup the corresponding entity, i.e. IAM Role in AWS"""
|
|
59
|
-
return RayClusterManager.generate_default_permission(**kwargs)
|
|
60
|
-
|
|
61
55
|
def parse_backend_fit_kwargs(self, kwargs: Dict) -> Dict[str, Any]:
|
|
62
56
|
"""Parse backend specific kwargs and get them ready to be sent to fit call"""
|
|
63
57
|
custom_config = kwargs.get("custom_config", None)
|
|
@@ -110,6 +104,7 @@ class RayBackend(Backend):
|
|
|
110
104
|
*,
|
|
111
105
|
predictor_init_args: Dict[str, Any],
|
|
112
106
|
predictor_fit_args: Dict[str, Any],
|
|
107
|
+
data_channels: Dict[str, Optional[Union[str, pd.DataFrame]]],
|
|
113
108
|
image_column: Optional[str] = None,
|
|
114
109
|
leaderboard: bool = True,
|
|
115
110
|
framework_version: str = "latest",
|
|
@@ -182,9 +177,11 @@ class RayBackend(Backend):
|
|
|
182
177
|
"""
|
|
183
178
|
if image_column is not None:
|
|
184
179
|
raise ValueError("Distributed training doesn't support image modality yet")
|
|
180
|
+
if data_channels.get("train_data") is None:
|
|
181
|
+
raise ValueError("`data_channels['train_data']` is required.")
|
|
185
182
|
predictor_fit_args = copy.deepcopy(predictor_fit_args)
|
|
186
|
-
train_data =
|
|
187
|
-
tune_data =
|
|
183
|
+
train_data = data_channels["train_data"]
|
|
184
|
+
tune_data = data_channels.get("tuning_data")
|
|
188
185
|
presets = predictor_fit_args.pop("presets", [])
|
|
189
186
|
num_bag_folds = predictor_fit_args.get("num_bag_folds", None)
|
|
190
187
|
hyperparameter_tune_kwargs = predictor_fit_args.get("hyperparameter_tune_kwargs", None)
|
|
@@ -387,13 +384,12 @@ class RayBackend(Backend):
|
|
|
387
384
|
framework_version, "training", minimum_version="0.7.0"
|
|
388
385
|
)
|
|
389
386
|
logger.log(20, f"Training with framework_version=={framework_version}")
|
|
390
|
-
image_uri =
|
|
391
|
-
|
|
387
|
+
image_uri = retrieve_image_uri(
|
|
388
|
+
framework_version=framework_version,
|
|
392
389
|
region=self.region,
|
|
393
|
-
version=framework_version,
|
|
394
|
-
py_version=py_version,
|
|
395
390
|
image_scope="training",
|
|
396
391
|
instance_type=instance_type,
|
|
392
|
+
py_version=py_version,
|
|
397
393
|
)
|
|
398
394
|
return image_uri
|
|
399
395
|
|