ZICQ
中 Log in / Sign up
Newsroom LLMs & Foundation Models #AWS #SageMaker #Training Sessions API #Model Training #Reinforcement Learning

AWS Launches Amazon SageMaker Training Sessions: Write Your Own Training Loop Without Managing GPUs

Avatar of Mr.Xu

By Mr.Xu Compiled & Reviewed by Editorial

Published:

中文阅读 (Chinese) English Version

Summary:AWS has launched Amazon SageMaker Training Sessions, a new API that allows users to write their own training loops for large language models (LLMs) in Python while the service manages the underlying GPUs. This abstraction enables developers to focus on algorithm development and data processing without worrying about infrastructure management. The service handles GPU allocation, model loading, distributed execution, fault recovery, and more, offering a flexible and cost-effective solution for AI


Key Features and Advantages

The Amazon SageMaker AI training session APIs introduce the following innovations to AI model training:

  1. Custom Training Loops: Users can write Python scripts to define training loops, including forward/backward passes, optimizer updates, and sampling operations, without managing GPU resources.
  2. Simplified Infrastructure Management: SageMaker AI handles all underlying infrastructure, including GPU allocation, model loading, distributed execution, fault recovery, and checkpoint storage.
  3. Flexible Training Technique Support: Supports various training techniques such as Supervised Fine-Tuning (SFT), Reinforcement Learning (RL), and preference optimization, allowing users to implement custom loss functions or data curricula.
  4. Pay-Per-Token Billing: Training costs are billed per token processed, avoiding idle GPU costs and aligning costs with dataset and generation volume, making budgeting and experimentation easier.

Technical Mechanism Analysis

The core mechanisms of the training session APIs include:

  • Service Client Hierarchy: Uses three clients in the SageMaker Python SDK (ServiceClient, TrainingClient, and SamplingClient) to manage sessions and operations. ServiceClient handles platform-level settings, TrainingClient manages training and checkpointing operations, and SamplingClient handles generation and scoring.
  • Operation Calls and Asynchronous Execution: Each API call corresponds to an operation in the training loop and returns an APIFuture object, which the user can wait on using the .result() method. This design enables asynchronous execution and rapid iteration.
  • Model Persistence and Version Control: Each save operation registers a version in the model package group, including the per-step sampler refresh in the loop. After training, the merged model can be deployed to a real-time endpoint or used as a LoRA adapter.

Engineering Trade-offs and Performance

  • Advantages:

    • High Flexibility: Users have full control over the training algorithm, making it suitable for scenarios requiring custom training logic.
    • Cost-Effective: Pay-per-token billing reduces compute costs, especially for compute-intensive tasks.
    • Easy Integration: Compatible with existing OpenAI client code, simplifying migration.
  • Challenges:

    • Learning Curve: Users unfamiliar with underlying training mechanisms may face a steeper learning curve.
    • Debugging Complexity: Since the training loop is written by the user, debugging may be more challenging than using fully managed services.

In the GSM8K benchmark, the trained LoRA adapter using this API improved the model's held-out accuracy from 56% to 75% on 40 problems. In the competitive programming task, the training reward increased from 0.46 to 0.60, and the accuracy on 200 held-out test problems increased from 40% to 50.5%.

Developer Deployment and Recommendations

  1. Choose the Right Training Loop: Select a recipe from the SageMaker training sessions cookbook, such as Code RL or GSM8K, and modify the reward function as needed.
  2. Optimize the Training Process: Leverage asynchronous execution and overlapping sampling and training to improve efficiency.
  3. Monitor and Debug: Use SageMaker-managed MLflow or other tools to monitor the training process and debug promptly.
  4. Deploy and Inference: After training, deploy the merged model to a SageMaker real-time endpoint or use it as a LoRA adapter.

Conclusion

The Amazon SageMaker training session APIs provide a flexible and efficient training solution for AI developers, combining the flexibility of custom training loops with the simplicity of infrastructure management. With pay-per-token billing and powerful feature support, this API opens new possibilities for AI model training and deployment.


Source: AWS Machine Learning Blog (2026-10-22)

— END —

Tags: #AWS #SageMaker #Training Sessions API #Model Training #Reinforcement Learning

Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.

Community Comments

Loading live comments and annotations…