models
Amazon SageMaker SDK v3 Enhances Script Mode for Model Training and Deployment
Amazon SageMaker's Python SDK v3 introduces a redesigned script mode that simplifies training and deployment workflows by unifying classes and enabling code synchronization at runtime. This update supports diverse frameworks and use cases, including traditional machine learning and generative AI.
AS1 NewsSource: aws.amazon.com
Amazon SageMaker has released version 3 of its Python SDK, bringing a comprehensive redesign to its script mode. The new SDK replaces multiple framework-specific estimator classes with a single, unified ModelTrainer for training and a ModelBuilder for deployment, streamlining the development process.
A key feature of the SDK v3 is the SourceCode object, which allows developers to specify a local code directory that is automatically synchronized into the container at runtime. This means users can modify their training scripts or inference handlers without rebuilding Docker images, significantly accelerating iteration cycles.
The SDK supports bringing your own container images from Amazon ECR, AWS Deep Learning Containers, or third-party sources. It handles injecting your code into the container during job execution, providing full control over the runtime environment. This flexibility extends across frameworks such as scikit-learn, PyTorch, Stable Diffusion, or custom binaries.
Two detailed examples illustrate the capabilities: first, training and deploying a scikit-learn Random Forest model on the diabetes dataset, and second, fine-tuning Stable Diffusion 3.5 with LoRA on multiple GPUs using Hugging Face Accelerate. Both workflows utilize the same core classes, ModelTrainer and ModelBuilder, emphasizing the SDK's versatility.
The new architecture simplifies configuration with structured objects for compute resources, input data, output data, and stopping conditions. It also integrates optional experiment tracking with MLflow and supports secure handling of secrets via AWS Secrets Manager.
Overall, SDK v3 enhances the speed and flexibility of model development on SageMaker, accommodating a broad spectrum of AI workloads from traditional ML to advanced generative models.
The update improves developer productivity and flexibility in deploying AI models, supporting a wide range of frameworks and use cases.