Bring your own model with Amazon SageMaker AI: Script mode in SDK v3
The SageMaker Python SDK v3 redesigns script mode with unified ModelTrainer and ModelBuilder classes. This post walks through two end-to-end examples, a scikit-learn Random Forest and a multi-GPU Stable Diffusion 3.5 LoRA fine-tune, showing how SourceCode syncs your local code into any container at runtime so you can iterate without rebuilding Docker images.
Amazon SageMaker AI now offers Script mode in SDK v3, allowing users to bring their own model for training and inference. This update simplifies workflows by replacing framework-specific estimator classes with a unified ModelTrainer and ModelBuilder. The SDK syncs local source code directories during training and deployment, enabling faster iterations and full container control.
Users can bring a container image from AWS Elastic Container Registry (ECR), AWS Deep Learning Container, or a third-party image, with the SDK handling code injection at runtime. The two core classes, ModelTrainer and ModelBuilder, replace the v2 Estimator family and Model/Predictor pattern, respectively. A SourceCode object configures and specifies source_dir and command or entry_script for training and inference.
The post provides two examples: training a scikit-learn Random Forest model on the diabetes dataset and fine-tuning Stable Diffusion 3.5 with LoRA. Both examples demonstrate the same core classes and the SourceCode object, which syncs code at runtime and allows for container control, system package installation, and compatibility with multiple frameworks.
Written by urgent.news from AWS Machine Learning's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.