【現地セッションレポート】 Amazon SageMaker serverless inference (Preview) #AIM328 #reinvent

2021.12.08

この記事は公開されてから1年以上経過しています。情報が古い可能性がありますので、ご注意ください。

新規事業統括部の山本です。

AWS re:Invent 2021に参加し現地のセッションを受けてきたので、内容をレポートします。

今回は、キーノートで発表された新サービスの1つである、Amazon SageMasker serverless inferenceのbreakoutセッションです。

発表内容まとめ

内容をまとめると以下のようでした。

  • SageMakerのサーバレスな推論エンドポイントのタイプが追加された
  • 他のサーバレスサービスと同様に、リクエストに応じた計算リソースが使用される
    • 過剰なキャパシティのコストをなくし、キャパシティを管理する手間もなくなる

注意事項

2021/12/08現在、Serverless Inferenceの機能はプレビュー中です。

サーバーレス推論はAmazonSageMakerのプレビューリリースであり、変更される可能性があります。この機能を実稼働環境で使用することはお勧めしません。

https://docs.aws.amazon.com/sagemaker/latest/dg/serverless-endpoints.html

概要

セッションカタログの内容は以下の通りです。

Title: Amazon SageMaker serverless inference (Preview)

Code: AIM328

Session type: Breakout Session

Topics: Artificial Intelligence and Machine Learning

Session level: 300 - Advanced

Many customers have ML applications with intermittent or unpredictable traffic patterns. Rather than provision for peak capacity up front, which can result in idle capacity or the need to build complex workflows to shut down idle instances, you can now use Amazon SageMaker serverless inference. Select serverless when deploying your ML model, and Amazon SageMaker automatically provisions, scales, and turns off compute capacity based on the volume of inference requests. With SageMaker serverless inference, you pay only for the compute capacity you use to process inference requests, billed by the millisecond and the amount of data processed. Join us to dive deep into this new feature, available in preview.

発表内容

SagaMakerの推論には、3つの種類がある

  • リアルタイム推論
  • バッチ処理
  • 非同期推論

ML推論の課題

  • ワークロードはとぎれとぎれ → 過剰にプロビジョンしてしまう
  • キャパシティの設定 → 管理が手間

提供サービス:Serverless Inference

特徴

  • マネージドサービス
    • オートスケーリング
  • 従量課金
  • ML用に作られている
    • BYO:自分のコード(=コンテナ)も利用可能

ユースケース

  • 今までの場合
    • トラフィックが予測できない → over-provision → 無駄な費用、手間
  • Serverless Inferenceの場合 → 管理の手間なし、適切な費用

デプロイ方法

  • 3ステップ
    • ほぼ今までと同様にエンドポイントを作成できる
    • エンドポイントの種類として、「サーバレス」を選択する
  • エンドポイントが生成され、利用可能になる

Demo

デプロイのデモ

  • 様々な言語のSDKがある(通常のSageMakerを動かすときと同じ)
  • SDKからも作成できるし、マネジメントコンソールからも作成できる
  • 処理速度は普通に速かった(デモはおそらくWarmStart)

BYOCのデモ

  • 詳しく内容まではなかった

始め方

  • 東京リージョン対応