Algorithmia enables data science teams to deploy models from many different model training platforms, including Amazon SageMaker. SageMaker provides different components such as notebooks and training jobs that enable developers and data scientists to build and train machine learning models.

Training Systems to Algorithmia Overview

The ability to deploy to Algorithmia from many different training environments enables data scientists to use their preferred development tools and existing model training platforms. Algorithmia provides a centralized model catalog and handles the scaling, governance, and operations.

Model deployment workflow

Once you’ve trained your model in SageMaker and are ready to deploy it to Algorithmia, the process is as simple as building and publishing a new version of your algorithm.

When you publish a new version of your algorithm, Algorithmia packages up your model-serving function and its dependencies, creates a REST API for your algorithm, and deploys a containerized version of your algorithm to autoscaling infrastructure.

SageMaker to Algorithmia Overview

Once your algorithm is published, Algorithmia handles the serving, monitoring, scaling, and governance of your algorithm in a centralized model catalog.

For each algorithm published on the platform, Algorithmia auto-generates code snippets that can be used to call that model from external code. Application developers can use any of the Algorithmia language clients to integrate published algorithms into consuming applications such as customer-facing websites, mobile applications, and visual dashboards.

Considerations before deployment

Because SageMaker consists of many different components, it’s important to consider the steps in your model training process, which will determine your workflow for deploying models to Algorithmia.

  • Which SageMaker component(s) will you use to train your model?

  • Which language will your algorithm be using?

  • Which format will you use to serialize your trained model?

  • Where will you store your trained model?

Based on the answers to these questions, you can develop an appropriate workflow. Although there are many possible options, the following sections describe two common workflows for deploying models from SageMaker to Algorithmia.

Example workflow 1: Deploying models from SageMaker Notebooks

SageMaker Notebooks enable you to use Python or R to build and train models using machine learning frameworks such as TensorFlow and PyTorch, which are fully supported by Algorithmia.

When using this workflow, once you’ve trained your model, you can serialize and upload it to Hosted Data Storage in Algorithmia (or a variety of other data sources) directly from your SageMaker Notebook. The serialized model can then be loaded into Algorithmia and served in production.

Deploying from SageMaker Notebooks

The steps for this example workflow can be summarized as:

  1. Build and train your model in SageMaker Notebooks

  2. Save your trained model to Hosted Data Storage in Algorithmia

  3. Create and build a new algorithm

  4. Publish your algorithm

  5. Integrate your algorithm into consuming applications using the language clients in Algorithmia

Refer to the article on deploying your models from Jupyter Notebooks and the documentation on working with data in hosted storage for more detailed information on the steps involved in this workflow.

Although this workflow specifically mentions using Hosted Data Storage, you can connect to other data sources such as Amazon S3 using Algorithmia’s Data Portal as well.

Example workflow 2: Deploying models from SageMaker training jobs

In addition to notebooks, SageMaker provides other components such as training jobs that can be used to build and train your models.

When using this workflow, once a training job is complete, the trained model is uploaded to Amazon S3, from which it can then be loaded into Algorithmia and served in production.

Deploying from SageMaker Training Systems

The steps for this example workflow can be summarized as:

  1. Build and train your model using a training job in SageMaker

  2. Save your trained model to Amazon S3

  3. Create and build a new algorithm

  4. Publish your algorithm

  5. Integrate your algorithm into consuming applications using the language clients in Algorithmia

Refer to the Algorithmia documentation on working with data in Amazon S3 for more detailed information on the steps involved in this workflow.

Summary

The example workflows described here allow you to build and train models in SageMaker Notebooks or training jobs, which can then be loaded into Algorithmia and served in production. These workflows represent two of many possible options for deploying models from SageMaker to Algorithmia, and you can adapt these workflows to specific components in your training pipeline.

Algorithmia makes it easy to move models from development to production by integrating with SageMaker and other training platforms that your data scientists are using today. This flexibility allows you to deploy models to Algorithmia from various training environments without burdening your data scientists with infrastructure details and without locking in or limiting your model deployment pipeline to specific training platforms or tools.

Kristopher Overholt