---
type: "post"
id: "write-your-own-training-loop-without-managing-gpus-12e654"
slug: "write-your-own-training-loop-without-managing-gpus-12e654"
title: "Write your own training loop — without managing GPUs — with Amazon SageMaker training session APIs"
description: "AWS has introduced SageMaker AI training session APIs for running custom LLM training loops from a Python process while SageMaker manages the GPU-backed runtime."
retrieval_nugget: "AWS has introduced SageMaker AI training session APIs for running custom LLM training loops from a Python process while SageMaker manages the GPU-backed runtime."
published_at: "2026-10-22"
updated_at: "2026-10-22"
record_date: "2026-10-22"
date_kind: "published_at"
topics: ["models","compute","ai-infrastructure"]
entities: ["Amazon Web Services","Amazon SageMaker AI","SageMaker training session APIs","SageMaker Python SDK","GSM8K","GRPO"]
related_patterns: []
novelty_label: "new_fact"
what_changed: "Adds SageMaker training session APIs as a way to run custom LLM training loops without managing GPUs, distinct from the prior HyperPod workflows and SageMaker deployment coverage."
prior_refs: ["memory:420d4efd-7d4f-8759-a4e0-3d0a26ec7f77","memory:424aca1f-79d1-8058-a2fa-d57505882d7f","memory:0b58f072-7177-86da-af0a-9ad89253f41d"]
source_url: "https://aws.amazon.com/blogs/machine-learning/write-your-own-training-loop-without-managing-gpus-with-amazon-sagemaker-training-sessions"
source_urls: ["https://aws.amazon.com/blogs/machine-learning/write-your-own-training-loop-without-managing-gpus-with-amazon-sagemaker-training-sessions"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:write-your-own-training-loop-without-managing-gpus-12e654"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/write-your-own-training-loop-without-managing-gpus-12e654/","markdown":"https://newruntime.com/posts/write-your-own-training-loop-without-managing-gpus-12e654.md","json":"https://newruntime.com/posts/write-your-own-training-loop-without-managing-gpus-12e654.json"}
related_shifts: ["compute-backed-ai-contracts"]
---

# Write your own training loop — without managing GPUs — with Amazon SageMaker training session APIs

## Retrieval answer

AWS has introduced SageMaker AI training session APIs for running custom LLM training loops from a Python process while SageMaker manages the GPU-backed runtime.

AWS has introduced SageMaker AI training session APIs for running custom LLM training loops from a Python process while SageMaker manages the GPU-backed runtime. The service is positioned for supervised fine-tuning, preference optimization, reinforcement learning, and custom objectives.

The APIs expose operations including `forward_backward()`, `optim_step()`, and `sample()` against a live, stateful session. AWS says the model and LoRA adapter remain loaded on managed GPUs across steps, while SageMaker handles accelerator allocation, distributed execution, gradient synchronization, fault recovery, checkpoint storage, tenant isolation, and related runtime operations.

The programming model uses three clients in the SageMaker Python SDK, beginning with a `ServiceClient` that configures and starts a session. AWS has also released a training sessions cookbook with SFT and RL recipes. Its examples include a GRPO loop on GSM8K and reinforcement learning for competitive-programming tasks evaluated with unit tests.

The post does not state pricing, supported AWS Regions, the complete model compatibility list, or whether the APIs are generally available.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Models](https://newruntime.com/topics/models.md): Explore the models topic hub.
- topic hub: [Compute](https://newruntime.com/topics/compute.md): Explore the compute topic hub.
- topic hub: [Ai Infrastructure](https://newruntime.com/topics/ai-infrastructure.md): Explore the ai-infrastructure topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Source Ledger](https://newruntime.com/source-ledger.json): Inspect the public source evidence graph.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
