Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/api/autogluon.cloud.*.rst

# PyBuilder
target/
Expand Down Expand Up @@ -133,4 +134,4 @@ VERSION.minor
.idea
.vscode
.DS_Store
results.xml
results.xml
82 changes: 65 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,91 @@


<div align="left">
<img src="https://user-images.githubusercontent.com/16392542/77208906-224aa500-6aba-11ea-96bd-e81806074030.png" width="350">
</div>
<div align="center">
<img src="https://user-images.githubusercontent.com/16392542/77208906-224aa500-6aba-11ea-96bd-e81806074030.png" width="350">

# AutoGluon-Cloud
## Train and Deploy AutoGluon in the Cloud

[![Latest Release](https://img.shields.io/github/v/release/autogluon/autogluon-cloud)](https://github.com/autogluon/autogluon-cloud/releases)
[![Python Versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12-blue)](https://pypi.org/project/autogluon.cloud/)
[![GitHub license](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](./LICENSE)
[![Continuous Integration](https://github.com/autogluon/autogluon-cloud/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/autogluon/autogluon-cloud/actions/workflows/continuous_integration.yml)

[AutoGluon-Cloud Documentation](https://auto.gluon.ai/cloud/stable/index.html) | [AutoGluon Documentation](https://auto.gluon.ai)

AutoGluon-Cloud aims to provide user tools to train, fine-tune and deploy [AutoGluon](https://auto.gluon.ai/stable/index.html) backed models on the cloud. With just a few lines of codes, users could train a model and perform inference on the cloud without worrying about MLOps details such as resource management.
</div>

AutoGluon-Cloud makes it easy to run [AutoGluon](https://auto.gluon.ai/stable/index.html) in the cloud. With a few lines of code, you can train models and run inference on [Amazon SageMaker](https://aws.amazon.com/sagemaker/) — without managing infrastructure or installing AutoGluon's heavy dependencies on your local machine.

It supports two workflows:

Currently, AutoGluon-Cloud supports [Amazon SageMaker](https://aws.amazon.com/sagemaker/) as the cloud backend.
- **Train AutoGluon predictors in the cloud** — the same `fit → deploy → predict` workflow as local AutoGluon, with all the heavy lifting offloaded to SageMaker.
- **Run pretrained foundation models** — deploy state-of-the-art pretrained models like Chronos-2 for zero-shot inference, with no training required.

## 💾 Installation & setup

## Installation
```bash
pip install -U pip
pip install -U setuptools wheel
pip install autogluon.cloud
```

## Example
Then provision the IAM role and S3 bucket AutoGluon-Cloud needs on AWS:

```python
from autogluon.cloud import bootstrap

bootstrap()
```

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.

## ⚙️ Train your own model

```python
from autogluon.cloud import TabularCloudPredictor
import pandas as pd
train_data = pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv")
test_data = pd.read_csv("https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv")
test_data.drop(columns=['class'], inplace=True)
cloud_predictor = TabularCloudPredictor(cloud_output_path='YOUR_S3_BUCKET_PATH')

# `train_data` and `test_data` can be a local path, S3 URL, or pandas DataFrame
train_data = "https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv"
test_data = "https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv"

# Train
cloud_predictor = TabularCloudPredictor()
cloud_predictor.fit(
train_data=train_data, # path or DataFrame
train_data=train_data,
predictor_init_args={"label": "class"}, # passed to TabularPredictor()
predictor_fit_args={"time_limit": 120}, # passed to TabularPredictor.fit()
)

# Real-time inference endpoint
cloud_predictor.deploy()
result = cloud_predictor.predict_real_time(test_data)
cloud_predictor.cleanup_deployment()
# Batch inference

# Batch prediction
result = cloud_predictor.predict(test_data)
```

## 🚀 Run a pretrained foundation model

```python
from autogluon.cloud import TimeSeriesFoundationModel

# `data` can be a local path, S3 URL, or pandas DataFrame
data = "https://autogluon.s3.amazonaws.com/datasets/timeseries/m4_hourly_tiny/train.csv"

model = TimeSeriesFoundationModel("chronos-2")

# Batch prediction — no training required
predictions = model.predict(
data=data,
target="target",
prediction_length=24,
)

# Real-time inference endpoint
endpoint = model.deploy()
predictions = endpoint.predict(
data=data,
target="target",
prediction_length=24,
)
endpoint.delete_endpoint()
```
2 changes: 1 addition & 1 deletion docs/_templates/autosummary/base.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ objname | escape | underline}}
{{ objname.split('.')[-1] | escape | underline}}

.. currentmodule:: {{ module }}

Expand Down
4 changes: 1 addition & 3 deletions docs/_templates/custom_class.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{{ fullname | escape | underline}}
{{ objname | escape | underline}}

.. currentmodule:: {{ module }}

.. autoclass:: {{ objname }}

{% block methods %}
.. automethod:: __init__

{% if methods %}
.. rubric:: {{ _('Methods') }}

Expand Down
9 changes: 0 additions & 9 deletions docs/_templates/foundation_model_class.rst

This file was deleted.

15 changes: 11 additions & 4 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,25 @@ API
:template: custom_class.rst
:methods:

MultiModalCloudPredictor
TimeSeriesCloudPredictor

.. autosummary::
:toctree: api
:template: custom_class.rst
:methods:

TimeSeriesCloudPredictor
TimeSeriesFoundationModel

.. autosummary::
:toctree: api
:template: foundation_model_class.rst
:template: custom_class.rst
:methods:

TimeSeriesFoundationModel
TimeSeriesEndpoint

.. autosummary::
:toctree: api
:template: custom_class.rst
:methods:

MultiModalCloudPredictor
10 changes: 10 additions & 0 deletions docs/api/multimodal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Multimodal
==========

.. currentmodule:: autogluon.cloud

.. autosummary::
:toctree: .
:template: custom_class.rst

MultiModalCloudPredictor
15 changes: 15 additions & 0 deletions docs/api/setup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Setup
=====

Functions for managing AutoGluon-Cloud's AWS configuration. See the :doc:`Setup tutorial </tutorials/setup>` for usage.

.. currentmodule:: autogluon.cloud

.. autosummary::
:toctree: .
:nosignatures:

bootstrap
register
status
teardown
10 changes: 10 additions & 0 deletions docs/api/tabular.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Tabular
=======

.. currentmodule:: autogluon.cloud

.. autosummary::
:toctree: .
:template: custom_class.rst

TabularCloudPredictor
12 changes: 12 additions & 0 deletions docs/api/timeseries.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Time Series
===========

.. currentmodule:: autogluon.cloud

.. autosummary::
:toctree: .
:template: custom_class.rst

TimeSeriesCloudPredictor
TimeSeriesFoundationModel
TimeSeriesEndpoint
16 changes: 15 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@

autosummary_generate = True
numpydoc_show_class_members = False
# Merge __init__ docstring (with Parameters) into the class docstring,
# and suppress the long signature lines on class/__init__ headers.
autoclass_content = "both"

googleanalytics_id = "UA-96378503-20"

Expand All @@ -43,7 +46,7 @@

nb_execution_excludepatterns = ["jupyter_execute"]

nb_dirs_to_exec = [os.path.join("tutorials", tag) for tag in tags if os.path.isdir(os.path.join("tutorials", tag))]
nb_dirs_to_exec = [os.path.join("tutorials", tag) for tag in tags if os.path.isdir(os.path.join("tutorials", tag))] # noqa: F821

if len(nb_dirs_to_exec) > 0:
nb_dirs_to_exclude = [
Expand Down Expand Up @@ -90,3 +93,14 @@
html_static_path = ["_static"]
html_css_files = ["custom.css"]
html_js_files = ["custom.js"]


def _skip_meta_private(app, what, name, obj, skip, options):
doc = getattr(obj, "__doc__", None) or ""
if ":meta private:" in doc:
return True
return None


def setup(app):
app.connect("autodoc-skip-member", _skip_meta_private)
Loading
Loading