aws / aws/amazon-sagemaker-examples

[Example Request] SM Pipeline with built-in LightGBM, AutoGluon, CatBoost, TabTransformer algorithm

Open
#3,693 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
11k
Forks
7k
Avg merge
8h 29m
Merged PRs (30d)
8

Description

**Describe the use case example you want to see**

A SageMaker Pipeline to train, evaluate, and register a model using one (or more?) of the new JumpStart-based [built-in algorithms for tabular data](https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html): Preferably via the SageMaker SDK + PipelineSession.

**How would this example be used? Please describe.**

The new JumpStart-based tabular built-in algorithms (AutoGluon-Tabular, CatBoost, LightGBM, TabTransformer) have some extra usage complexities beyond XGBoost:

- **Separate container image URIs** must be used for training vs inference, otherwise errors will generally be thrown due to missing libraries/executables/etc.
- **Script bundles** must be looked up (via e.g. `sagemaker.script_uris.retrieve()`) and provided to **both the training and inference stages** - and also the models created by these training jobs **appear to require re-packing to properly insert inference scripts**.
- **"Pre-trained" model artifacts** seem to be mandatory (via e.g. `sagemaker.model_uris.retrieve()`) for the training job.
- **Data channel structure** is different, using a single `training` channel with specifically named subfolders and files, instead of separate `train`, `validation`, etc channels.

We have sample notebooks available for these algorithms, usually listed on the algorithm doc pages themselves [e.g. here for AutoGluon](https://docs.aws.amazon.com/sagemaker/latest/dg/autogluon-tabular.html)... But as far as I've found, the only samples for SM Pipelines tend to be XGBoost-based or using custom models.

The extra complexity (around image, script and model artifact URIs in particular) can make it a challenge for customers who aren't yet familiar with script mode (only trying out and comparing built-in algorithms) to get started with these more advanced tabular algorithms: **It's not straightforward** today, to take an XGBoost sample and just plug in a different algorithm name.

So I suggest it'd be helpful to either extend an existing sample, or add a new sample, to show how pipelining translates from XGBoost to the other tabular algorithms?

**Describe which SageMaker services are involved**

- Pipelines
- Built-in algorithms (JumpStart-based)

**Describe what other services (other than SageMaker) are involved***

- None?

**Describe which dataset could be used. Provide its location in s3://sagemaker-sample-files or another source.**

- Could just re-use ones already used, e.g. [abalone as used here](https://github.com/aws/amazon-sagemaker-examples/blob/ed5d1a4f9735b7fb6770b24b017e21a9e5431ef6/sagemaker-pipelines/tabular/abalone_build_train_deploy/sagemaker-pipelines-preprocess-train-evaluate-batch-transform_outputs.ipynb)? [California housing as used here](https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker-pipelines/tabular/tensorflow2-california-housing-sagemaker-pipelines-deploy-endpoint/tensorflow2-california-housing-sagemaker-pipelines-deploy-endpoint.ipynb)? or etc.

Contributor guide

Open the contributing guide

Research direction

Start with the existing sagemaker-pipelines/tabular/abalone_build_train_deploy/sagemaker-pipelines-preprocess-train-evaluate-batch-transform_outputs.ipynb and the linked AutoGluon sample. Review how PipelineSession, sagemaker.script_uris.retrieve(), and sagemaker.model_uris.retrieve() are used, then define an example that trains, evaluates, and registers one or more listed algorithms while showing their required data and artifact handling.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, jupyter-notebook, machine-learning
Domain
cloud, machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.