Model builder unable to
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- aws, python
調査の方向性
ModelBuilder.build() を通した Python での再現から始め、ModelPackage が返す BaseModel の値が Unassigned の場合にどのように扱われるかを調べます。そのフローを、HubContent.get と SageMakerPublicHub を使用する文書化された回避策と比較します。build が HubContentVersion と RecipeName の欠落をクラッシュせずに処理し、その動作が適切な回帰テストでカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
説明
PySDK Version
- PySDK V2 (2.x)
- PySDK V3 (3.x)
Describe the bug
ModelBuilder fails when building/deploying a model package whose BaseModel has HubContentName set but is missing HubContentVersion and/or RecipeName. These fields are returned as Unassigned from the DescribeModelPackage API response, and ModelBuilder does not handle this — it assumes all three
fields are populated and crashes during the build step.
This is a real problem for model packages created by automated pipelines (e.g., fine-tuning jobs that call CreateModelPackage) where the producer only sets HubContentName but not the version or recipe. The user has no way to patch these fields through the ModelBuilder API — the only workaround
is to manually resolve them before calling build().
To reproduce
python
from sagemaker.serve import ModelBuilder
from sagemaker.core.resources import ModelPackage
A model package where BaseModel has HubContentName but missing HubContentVersion and RecipeName
mp_arn = "arn:aws:sagemaker:us-east-1:123456789012:model-package/my-fine-tuned-models/1"
mp = ModelPackage.get(model_package_name=mp_arn, region="us-east-1")
Inspect — HubContentVersion and RecipeName are Unassigned
base_model = mp.inference_specification.containers[0].base_model
print(base_model.hub_content_name) # e.g. "huggingface-reasoning-qwen3-32b" ✅
print(base_model.hub_content_version) # Unassigned ❌
print(base_model.recipe_name) # Unassigned ❌
role = "arn:aws:iam::123456789012:role/SageMakerRole"
model_builder = ModelBuilder(model=mp, role_arn=role)
model_builder.build(model_name="my-deployment")
^^^ Fails — ModelBuilder cannot resolve the model without version and recipe
Workaround (manually patch before build):
python
from sagemaker.core.resources import HubContent
from sagemaker.core.utils.utils import Unassigned
base_model = mp.inference_specification.containers[0].base_model
if isinstance(base_model.hub_content_version, Unassigned):
hc = HubContent.get(
hub_content_type="Model",
hub_name="SageMakerPublicHub",
hub_content_name=base_model.hub_content_name,
)
base_model.hub_content_version = hc.hub_content_version
if isinstance(base_model.recipe_name, Unassigned) or not base_model.recipe_name:
base_model.recipe_name = "verl-grpo-rlaif-qwen-3-32b-lora"
Now build() works
model_builder = ModelBuilder(model=mp, role_arn=role)
model_builder.build(model_name="my-deployment")
model_builder.deploy(endpoint_name="my-deployment", instance_type="ml.g5.48xlarge")
Expected behavior
ModelBuilder should gracefully handle model packages where HubContentVersion and/or RecipeName are Unassigned. Specifically:
- If HubContentName is present but HubContentVersion is missing, ModelBuilder should resolve it automatically by calling DescribeHubContent on SageMakerPublicHub (as the workaround does).
- If RecipeName is missing, ModelBuilder should either infer a default recipe from the hub content metadata or allow the user to pass it as a parameter.
Screenshots or logs
N/A — error occurs during model_builder.build() when it attempts to use the Unassigned values.
System information
- SageMaker Python SDK version: 3.6.0
- Framework name (eg. PyTorch) or algorithm (eg. KMeans): DJL LMI (Large Model Inference)
- Framework version: DJL 0.36.0, LMI 20.0.0
- Python version: 3.12
- CPU or GPU: GPU (ml.g5.48xlarge — 8x NVIDIA A10G)
- Custom Docker image (Y/N): N
Additional context
- The root cause is split: the model package producer (e.g., fine-tuning pipeline) should ideally populate all three BaseModel fields (HubContentName, HubContentVersion, RecipeName). But ModelBuilder should also be resilient to partially-populated model packages, since it has enough information (HubContentName) to resolve the missing fields itself.
- The workaround is functional but requires the user to know internal SDK types (Unassigned, HubContent.get) which are not documented.
- 主要言語
- Python
- スター
- 2.3k
- フォーク
- 1.3k
- 平均マージ
- 3日 7時間
- マージ済み PR(30日)
- 87
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
aws/sagemaker-python-sdk のほかの issue
-
Cannot use spark_event_logs_s3_uri in PySparkProcessor job対応中かも @rsareddy0329 が 7 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
aws/sagemaker-python-sdk#6253 ·
メンテナーはふだん 2 日以内に返信
-
[Bug] V3 Hyperparameter Tuning Pipeline page labelled "Download Data" in navigation due to missing title cell対応中かも @admivsn が 36 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 93/100
aws/sagemaker-python-sdk#6232 ·
メンテナーはふだん 2 日以内に返信
-
[Bug] ModelTrainer with no input channels emits InputDataConfig: [], which CreatePipeline rejects (min=1) — v2 omitted the key対応中かも @sagemaker-bot が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
aws/sagemaker-python-sdk#6156 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
sagemaker-train should depend on mlflow-skinny, following sagemaker-mlflow 0.5.0対応中かも @mohamedzeidan2021 が 9 日前に担当しました。 オープン
難易度 2/5 半日 初心者へのやさしさ 72/100
aws/sagemaker-python-sdk#6152 ·
メンテナーはふだん 2 日以内に返信
-
ModelTrainer generates sm_train.sh with CRLF line endings on Windows causing training job failure対応中かも @MohammedAlkindi が 27 日前に担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
aws/sagemaker-python-sdk#5904 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
aws/sagemaker-python-sdk の issue をすべて見る
似ている issue
-
area/install reliability
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
FluidNumerics/fluid-walk-blocker#191 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
TransformerLensOrg/TransformerLens#1868 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
climate-analytics-lab/jax-gcm#1057 ·
メンテナーはふだん 1 日以内に返信