AGENT SKILL

sagemaker-python-sdk

Route SageMaker Python SDK v3 tasks to self-contained guidance for core resources, training, model customization, serving, MLOps, migration, and troubleshooting.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
sagemaker-python-sdk
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Route SageMaker Python SDK v3 tasks to self-contained guidance for core resources, training, model customization, serving, MLOps, migration, and troubleshooting.
disable-model-invocation
true

02 资源文件 7

03 SKILL.md 正文

SageMaker Python SDK v3 Repo Skill

Use this skill when the task involves the Amazon SageMaker Python SDK v3: training, fine-tuning, deployment, inference, pipelines, Feature Store, model registry, low-level SageMaker resources, image URI retrieval, or V2-to-V3 migration. The SDK is v3-first and modular: sagemaker-core, sagemaker-train, sagemaker-serve, and sagemaker-mlops.

Mandatory v3 policy

  • Default to SageMaker Python SDK v3 (pip install sagemaker).
  • Use the SDK before raw boto3, AWS CLI, or hand-written service requests unless the user explicitly asks for those lower-level interfaces.
  • Do not generate v2 imports such as estimator, model, predictor, processing, workflow, or framework-estimator modules except inside clearly labeled deprecated migration notes.
  • Do not hardcode real account IDs, role ARNs, regions, buckets, subnets, security groups, or credentials. Use Session(), get_execution_role(), Session().default_bucket(), and placeholders.
  • If the user asks to run cloud jobs, stop to confirm region, AWS credentials, execution role, S3 staging/output paths, service quotas, and billable-resource cleanup before submission.

Quick route map

User intent Load this
Install/import smoke, v3-vs-v2 decision, or broad SDK selection Stay in this root and read references/v3-interface-selection.md
Retrieve framework image/model/script URIs, use Session, low-level jobs/resources, processing, transform, endpoints, or lineage sub-skills/core-resources/SKILL.md
Train a model with ModelTrainer, local/distributed training, JumpStart training, HPO, AWS Batch training queues, or remote function sub-skills/training/SKILL.md
Fine-tune/customize foundation models with SFT/DPO/RLVR/RLAIF/CPT/MultiTurnRL, run evaluations, recipes, data mixing, or notifications sub-skills/model-customization/SKILL.md
Deploy or serve with ModelBuilder, InferenceSpec, local/in-process/container mode, serverless/async/batch inference, JumpStart, optimization, Bedrock, or recommendations sub-skills/serving/SKILL.md
Build SageMaker Pipelines, workflow steps, model registry flows, Feature Store orchestration, quality/Clarify checks, lineage/governance, triggers, retries, or local pipeline execution sub-skills/mlops/SKILL.md
Convert old SDK code to v3 references/migration-v2-to-v3.md, then route to the owning sub-skill
Debug install/import/region/role/credentials/optional deps references/troubleshooting.md

Intent-to-interface defaults

  • Train / fine-tune / managed training: sagemaker.train.ModelTrainer or the specialized customization trainers in the model-customization sub-skill.
  • Distributed training: ModelTrainer with Compute(instance_count=...) and a Torchrun, MPI, SMP, or custom DistributedConfig.
  • Hyperparameter tuning: sagemaker.train.tuner.HyperparameterTuner or sagemaker.core.resources.HyperParameterTuningJob for low-level control.
  • Deploy / host / endpoint inference: sagemaker.serve.ModelBuilder.
  • Endpoint invocation after deployment: Endpoint.invoke(...).
  • Processing / batch transform / resource CRUD: sagemaker.core.resources and helper classes such as ScriptProcessor or Transformer.
  • Pipelines / registry / monitoring / Feature Store: sagemaker.mlops.workflow and sagemaker.mlops.feature_store.
  • Container image URI: sagemaker.core.image_uris.retrieve(...).

Before writing code

  1. Determine whether the user wants usage guidance, migration, or repository maintenance. For repository edits, still obey this repo's v3 default and run focused tests under the relevant package.
  2. Identify execution substrate: local-only object construction, Docker local mode, SageMaker cloud job/endpoint, HyperPod, AWS Batch, Bedrock, Feature Store, EMR, or a Pipeline.
  3. Confirm whether the task can be answered without cloud execution. Many examples can be drafted with placeholders and dry_run=True; do not submit billable jobs unless explicitly authorized.
  4. Open exactly the sub-skill and references needed for the intent. Do not duplicate full workflows across sub-skills.
  5. Self-check generated code for banned v2 patterns and missing resource placeholders before returning.

Shared references and helpers

High-risk boundaries

  • sagemaker.serve and sagemaker.mlops may need AWS_REGION or AWS_DEFAULT_REGION set even for import in a fresh environment.
  • ModelTrainer and ModelBuilder can try role discovery through STS when no explicit role is supplied; outside SageMaker-managed environments this can fail before any job is submitted.
  • Docker/local-container examples require Docker, images, local paths, and cleanup; in-process serving is the safer local path when it fits.
  • Feature Store, Bedrock, SNS/EventBridge notifications, EMR, HyperPod, Batch, and SageMaker cloud jobs need AWS identity, IAM permissions, and service quotas; treat native runs as opt-in.
  • Root and sub-skill runtime instructions must remain self-contained; do not tell future agents to reopen this source repository for examples.

Handoff after using this skill

Return the sub-skill(s) consulted, the v3 interfaces selected, any assumptions about region/role/S3/compute, the validation path used (dry_run, local smoke, or no-submit review), and any cloud/Docker/native checks intentionally skipped.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351