Subchapter 37.112
references/training-jobs/overview.mdMarkdown9 KBView on GitHub
Launch, monitor, and diagnose SageMaker training jobs with SageMaker Python SDK v3. This capability covers serverful recipes, zero-config JumpStart traditional ML, BYO source/container/algorithm jobs, and training-job debugging.
Use this capability when the user asks to:
train.py, a custom ECR image, or a Marketplace algorithm on managed training computeFor ordinary managed serverless SFT/DPO/RLVR/RLAIF requests without those signals, use finetuning.
| Intended outcome | Use |
|---|---|
| Managed serverless SFT/DPO/RLVR/RLAIF with SageMaker’s customization experience | finetuning and its SFTTrainer/technique-specific flow |
| A serverful recipe that controls launcher/distribution/runtime on explicit training instances | This reference with ModelTrainer.from_recipe |
| Traditional ML from JumpStart, or BYO script/image/algorithm | This reference |
Both SFTTrainer and recipe training can accept a Compute object. The deciding factor is the requested workflow and artifact contract, not the presence of Compute: use SFTTrainer for the managed customization workflow and ModelTrainer.from_recipe when the user explicitly needs a published/custom serverful recipe or its distributed runtime.
| Area | Assumption |
|---|---|
| Runtime | Python supported by sagemaker>=3.22.0,<4.0; dependencies are installed by the generated template |
| Credentials | Ambient AWS credentials plus a SageMaker execution role; caller needs sagemaker:CreateTrainingJob, sagemaker:DescribeTrainingJob, sagemaker:ListTrainingJobs, S3/ECR access as applicable, and iam:PassRole |
| Storage | Small source/config files may be local under the project directory; datasets, checkpoints, recipes, and model artifacts use S3 |
| Region | Resolve from the current AWS session; verify model/recipe, compute, quota, image, and S3 resources in that region |
| Network | PyPI access is needed for installation; the job needs the AWS endpoints and any image/package endpoints its code uses |
code_templates/recipe_training.pycode_templates/jumpstart_training.pycode_templates/custom_training.pyreferences/troubleshooting.mdmodel-selection; use the exact Hub model ID/version it returns. If direct CLI verification is needed, use aws sagemaker list-hub-contents and aws sagemaker describe-hub-content. Never invent IDs or silently select a different version.get_resolved_recipe() before approval; never invent recipe names or override keys.ModelTrainer.from_recipe loads the base recipe, applies recipe_overrides, and derives source code, image, distributed settings, compute details, and hyperparameters. The explicit Compute argument is required, but only INSTANCE_TYPE must be supplied by this template. Leave INSTANCE_COUNT and VOLUME_SIZE_GB as None to preserve the selected recipe/SDK defaults; set them only from confirmed user inputs when an explicit override is required. TRAINING_PLAN_ARN, when set, is also an explicit compute override. Direct constructor inputs such as networking, stopping condition, output, checkpoint, role, and base job name are then applied to the trainer. Review get_resolved_recipe() output before launch so the user can see the final merged configuration.
General published recipes may resolve their image. Nova and LLM fine-tuning recipe families require an explicit, verified training_image; use a supported, versioned URI from the selected recipe/provider documentation rather than latest. Verify the selected recipe’s requirements because recipe contracts may change.
Use cascading fallback: conversation → project files → ask one unresolved question at a time.
| Input | Recipe | JumpStart | Custom |
|---|---|---|---|
| Recipe name/YAML | Required | — | — |
| JumpStart model ID/version | — | Required | — |
| Training image or algorithm | Recipe-dependent | Resolved by config | Required |
| Source directory/entry script | Optional | Optional override | Optional |
| Training S3 URI | If recipe needs it | Required | Required if algorithm needs it |
| Instance type/count | Required | Optional override | Required |
| Training plan ARN | Optional | Optional | Optional |
| Role and output S3 URI | Required | Required | Required |
| Hyperparameters/recipe overrides | Optional | Optional | Optional |
| Checkpoint, VPC, encryption | Optional, only when requested/required | Optional | Optional |
| Max runtime | Required spend bound | Required spend bound | Required spend bound |
A code-level accept_eula switch exists only on JumpStartConfig. Set it to True only after the user explicitly accepts the gated model license. Recipe licenses and prerequisites are recipe/provider-specific; surface and confirm them before launch rather than claiming that an EULA flag is propagated by from_recipe.
Before generating code or submitting a job:
aws service-quotas list-service-quotas --service-code sagemaker --region <region>; only draft request-service-quota-increase after the user confirms the quota code and desired value. Do not submit a request, silently switch compute, or downsize without approval.references/configuration.md and the selected template.WAIT_FOR_COMPLETION=False unless the user asks to block.ListTrainingJobs/DescribeTrainingJob APIs. They do not use the SDK’s private _latest_training_job state.Completed.Read references/troubleshooting.md. Start with DescribeTrainingJob, then inspect only the job’s CloudWatch stream and relevant metrics. Return the failure signature, root cause category, evidence, and concrete fix; state what was not checked.
The following are supported by SageMaker and AWS but do not have a validated workflow in this reference. If the user’s request matches one of these, let them know and proceed with best-effort guidance using general AWS knowledge:
CreateTrainingJob field; templates intentionally expose only verified checkpoint, VPC, output-KMS, network-isolation, and traffic-encryption settingscode_templates/recipe_training.py — serverful pre-built/custom recipecode_templates/jumpstart_training.py — JumpStart zero-config traditional MLcode_templates/custom_training.py — BYO source/image/algorithmreferences/configuration.md — placeholder and branch configurationreferences/troubleshooting.md — status and failure classification