News Developer Tools

Amazon SageMaker AI lets developers write their own training loops

Amazon SageMaker AI now offers training session APIs that run each step of a custom LLM training loop on managed GPUs kept loaded with the model.

Amazon SageMaker AI now lets developers write their own training loop in Python while AWS runs the GPU hardware behind it. The feature is called training session APIs. AWS says it expands the service's serverless model customization, which previously forced a choice between control over training and simple operations.

Operations such as forward_backward(), optim_step() and sample() become API calls. Developers combine them into supervised fine-tuning, preference optimization, reinforcement learning or a new method. The calls go to a live session, so the model stays loaded on the GPUs across steps. A developer can run as many calls as needed against it.

AWS says SageMaker AI handles runtime setup, distributed execution, gradient synchronization, fault recovery and tenant isolation. The session runs a chosen base model with a Low-Rank Adaptation (LoRA) adapter, a small add-on layer trained in place of the full model. There is no upfront job configuration file and no cluster creation step.

Three clients in the SageMaker Python SDK organize the work, starting with a ServiceClient that holds settings such as the execution role and storage location. AWS also released a cookbook of ready-to-run recipes. Its examples include a reinforcement learning loop on GSM8K grade-school math problems and a competitive programming workload that grades generated code against unit tests.

Source: Write your own training loop — without managing GPUs — with Amazon SageMaker training session APIs | Artificial Intelligence.