core-resources
Use SageMaker Python SDK v3 core resources for sessions, URI retrieval, low-level jobs and endpoints, serverless endpoint config, and lineage.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- core-resources
- license
- Apache 2.0
- metadata
- { "disco-role": "operating" }
- description
- Use SageMaker Python SDK v3 core resources for sessions, URI retrieval, low-level jobs and endpoints, serverless endpoint config, and lineage.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/api-reference.md3.5 KB
- 参考文档references/README.md370 B
- 参考文档references/troubleshooting.md1.9 KB
- 参考文档references/workflows.md2.6 KB
03 SKILL.md 正文
SageMaker Python SDK v3 Core Resources Sub-skill
Use this sub-skill when the task is about foundational sagemaker-core APIs:
Session, get_execution_role, image/model/script URI retrieval, direct
resource objects, processing jobs, batch transform jobs, endpoint lifecycle,
direct training jobs, hyperparameter tuning jobs, serverless or async endpoint
config, resource chaining, or lineage primitives.
Trigger phrases
- "core resources", "sagemaker-core", "low-level resource", or "resource object".
- "Session", "default bucket", "get_execution_role",
boto_region_name, or AWS profile. - "image URI",
image_uris.retrieve,model_uris.retrieve, orscript_uris.retrieve. - "ProcessingJob", "batch transform", "TransformJob", or "offline inference".
- "Model", "EndpointConfig", "Endpoint", "invoke", or "update_weights_and_capacities".
- "TrainingJob" or "HyperParameterTuningJob" when the user wants the low-level API.
- "serverless endpoint config",
ProductionVariantServerlessConfig, orAsyncInferenceConfig. - "resource chaining", "pass a resource object through", or "get_all / refresh / delete".
- "lineage",
sagemaker.core.lineage,Context,Action,Artifact, orAssociation. - "migrate from v2 imports" for
sagemaker.session,sagemaker.processing,sagemaker.transformer,sagemaker.tuner,sagemaker.model,sagemaker.predictor,sagemaker.image_uris,sagemaker.model_uris,sagemaker.script_uris, orsagemaker.lineage.
Read this when
- The request is direct SageMaker resource management and not a high-level
ModelTrainer,ModelBuilder, or MLOps pipeline workflow. - The user wants a v3 replacement for removed v2 modules or legacy low-level calls.
- The task is to create, list, refresh, delete, wait on, or invoke core resources.
- The task is to retrieve managed framework images or JumpStart model/script artifacts.
- The task is to construct lineage graphs, query associations, or clean up lineage entities.
Do not read this when
- The user wants general training orchestration, local training, distributed
training, JumpStart training, or HPO with
ModelTrainer; use../training/SKILL.md. - The user wants high-level deployment with
ModelBuilder, inference schema inference, in-process serving, or optimization; use../serving/SKILL.md. - The user wants SageMaker Pipelines, registry flows, feature store, Clarify,
or workflow orchestration; use
../mlops/SKILL.md. - The user wants foundation-model customization or evaluation trainers; use
../model-customization/SKILL.md.
Non-negotiable v3 guardrails
- Use
sagemaker.core,sagemaker.train,sagemaker.serve, andsagemaker.mlopsimports by default; do not introduce v2 imports in new guidance except in explicitly labeled deprecated migration notes. - Prefer the SDK over raw
boto3.client("sagemaker").create_*calls for normal SageMaker tasks. Raw boto3 is an escape hatch only for unsupported APIs or when the user explicitly asks for the service call. - Do not hardcode real account IDs, role ARNs, regions, bucket names, subnet
IDs, security group IDs, or credentials. Use
Session(),get_execution_role(),Session().default_bucket(), placeholders, or AWS configuration. - Treat
create,update,delete,invoke, andwaitas cloud operations. - Old
sagemaker.lineage.*imports are deprecated compatibility shims. Prefersagemaker.core.lineage.*for new lineage code. - For low-level serverless endpoints, use
ProductionVariantServerlessConfiginsideProductionVariant; reserveServerlessInferenceConfigfor helper flows and higher-level deployment code.
Short workflow
- Classify the request. If it is clearly ModelTrainer, ModelBuilder, or MLOps orchestration, route to the sibling sub-skill instead of staying here.
- Establish AWS prerequisites: region, credentials/profile, execution role, default bucket/prefix, and whether live service calls are authorized.
- Create a
Sessionand verifysession.boto_region_name. Useget_execution_role(session)only when role discovery is expected to work; otherwise pass an explicit role ARN. - Resolve artifacts with
image_uris.retrieve,model_uris.retrieve, orscript_uris.retrieve. For JumpStart URIs, requiremodel_idandmodel_version. For serverless image selection, pass a serverless config. - Build typed request shapes from
sagemaker.core.shapesandsagemaker.core.inference_config. - Pick the resource API:
ProcessingJob.create/get/get_all/waitTransformJob.create/get/get_all/waitTrainingJob.create/get/get_all/waitModel.create/get/get_all/deleteEndpointConfig.create/get/get_allEndpoint.create/get/get_all/wait_for_status/invoke/update_weights_and_capacitiesHyperParameterTuningJob.create/get/get_all/wait
- Prefer resource chaining when the signature accepts
objectorPipelineVariable. Pass upstream resource objects directly, then fall back toget_name()or.nameonly when the target field requires a plain string. - For endpoints, create an
EndpointConfigfirst, thenEndpoint, then wait forInServicebefore invoking. - For lineage, use
sagemaker.core.lineage, delete associations before deleting entities, and prefer the new import path over the legacy shim. - Validate before returning: v3 imports only, no hardcoded real identifiers, cleanup path included, and any billable resources have a delete plan.
Reference map
- Detailed signatures, imports, and resource semantics:
references/api-reference.md. - End-to-end operational recipes:
references/workflows.md. - Error boundaries, recovery advice, and migration notes:
references/troubleshooting.md.
Handoff expectations
- Produce self-contained v3 guidance; do not require the original repository checkout at runtime.
- Make all AWS calls explicit and distinguish them from local object construction.
- Keep cleanup steps in any example that creates jobs, endpoints, or lineage entities.
- If a user gives v2 code, convert it to v3 and label the v2 original as deprecated before showing the replacement.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).