Is it possible to deploy a scikit-learn model to a SageMaker serverless endpoint?

0

I have trained a Scikit-Learn model within a SageMaker Training job and uploaded the model.tar.gz. file to S3. Now I would like to deploy this model as a serverless endpoint but I am getting the well-known error due to image size limitations of Lambda: "Image size 10771903611 is greater than supported size 10737418240" I am using image 492215442770.dkr.ecr.eu-central-1.amazonaws.com/sagemaker-scikit-learn:1.2-1-cpu-py3, whose size when pulled locally is 5.7GB (as output by docker ls command). Is there an sklearn image suitable for serverless deployment?

Thanks, Nikos

Nikos
asked 4 days ago34 views
2 Answers
0

Hello Nikos,

If possible please try to build the image from official image and try with further reduced image size for deploying on serverless inference. You can exclude lines from L90-L116 in the base image to reduce the size further and use the custom built final image to deploy the serverless inference endpoint. The steps for building the image are here.

AWS
answered 3 days ago
  • Thanks, I will try it when I find some time. I didn't know about mlio. Shall I miss some functionality during inference if I ommit those lines?

  • Well I tried to build locally but ran into many errors. Shouldn't there exist a ready-to-use sklearn image for serverless deployment? Or otherwise be mentioned in the documentation that serverless endpoints are not supported with sagemaker-scikit-learn-container ?

-1

Hi,

See part 5 of https://tutorialsdojo.com/train-and-deploy-a-scikit-learn-model-in-amazon-sagemaker/

It explains how to deploy a model trained with scikit-lean on AWS SageMaker

Best,

Didier

profile pictureAWS
EXPERT
answered 4 days ago
  • Thank you, but this doesn't answer my question. I specifically asked about a serverless endpoint. I know how to create a real-time endpoint like described in the link you provided.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions