AWS Certified Machine Learning – SpecialtyMachine Learning Implementation and OperationsEasy
A data science team has developed a new image classification model using a custom deep learning framework that is not natively supported by Amazon SageMaker's built-in algorithms. They need to deploy this model for real-time inference on SageMaker. Which approach should they use to package and deploy their model?
- AConvert the model to a format supported by SageMaker Neo.
- BCreate a custom Docker container with the necessary dependencies and model artifacts.
- CDeploy the model directly as a Lambda function with a custom runtime.
- DUse SageMaker's built-in algorithm container and adapt the model.
Show answer & explanationAnswer & explanation
Correct answer: B. Create a custom Docker container with the necessary dependencies and model artifacts.
For models developed with custom frameworks or requiring specific dependencies not covered by SageMaker's built-in options, creating a custom Docker container is the recommended approach. This allows the data science team to fully control the environment, including libraries, framework versions, and model serving code, ensuring their model runs correctly on SageMaker.
Why the other options are wrong
- A. SageMaker Neo optimizes models for specific hardware, but the initial deployment still requires a compatible runtime, which might not exist for a 'custom deep learning framework'.
- C. While possible for small models, Lambda functions are generally not designed for the computational demands of real-time deep learning inference and lack SageMaker's specialized ML features.
- D. This is not feasible if the framework is 'not natively supported' by the built-in algorithms.
Custom SageMaker Inference Container
A user-defined Docker container that packages a machine learning model and all its necessary dependencies for deployment on Amazon SageMaker.
- Required for custom frameworks or specific library versions.
- Provides full control over the inference environment.
- Must adhere to SageMaker's container contract (e.g., HTTP endpoints for /ping and /invocations).
Memory trick: Custom Code, Custom Container, SageMaker's Open Door.