Amazon SageMaker has introduced script mode in its SDK v3, streamlining the process for users to bring their own models and containers. This update replaces framework-specific estimator classes with a unified ModelTrainer for training and ModelBuilder for deployment, offering greater flexibility and control. The new SDK syncs a local source code directory into the training job at runtime using the SourceCode configuration object, allowing users to bring their own container image from Amazon ECR. This change enables faster iterations and full container control, as the SDK handles code injection at runtime without requiring container rebuilds. Source: awsml

The update introduces a redesigned architecture that simplifies workflows like the bring-your-own-model process. Users can now use a single API for multiple frameworks, including scikit-learn, PyTorch, and Stable Diffusion, with identical interfaces for training and deployment. The SourceCode object accepts a source directory and a command string for training or an entry script for inference, syncing this directory into the container at job launch. This allows code to run inside the container without being baked into the image, providing greater flexibility. The examples provided in the blog post demonstrate how to train and deploy models using the new SDK, including a scikit-learn Random Forest classifier and a fine-tuned Stable Diffusion 3.5 model. Source: awsml

The blog post outlines the changes from SDK v2 to v3, highlighting the shift from the Estimator pattern to the ModelTrainer pattern. Training classes in v2 included SKLearn, PyTorch, and XGBoost, while v3 uses a single ModelTrainer class. Deployment in v2 relied on Model and Predictor classes, whereas v3 uses ModelBuilder to deploy endpoints. The new SDK allows users to use any container image, including their own, AWS DLC, or third-party images, with full control over installed packages and runtime versions. Source: awsml