fix: resolve private hub Models and aliased references for modelTrainer - #6201
Open
tanvikab4 wants to merge 1 commit into
Open
fix: resolve private hub Models and aliased references for modelTrainer#6201tanvikab4 wants to merge 1 commit into
tanvikab4 wants to merge 1 commit into
Conversation
tanvikab4
requested a deployment
to
manual-approval
August 21, 2026 16:55 — with
GitHub Actions
Waiting
tanvikab4
requested a deployment
to
manual-approval
August 21, 2026 16:55 — with
GitHub Actions
Waiting
tanvikab4
requested a deployment
to
manual-approval
August 21, 2026 16:55 — with
GitHub Actions
Waiting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
Summary
ModelTrainer.from_jumpstart_config(...) could not resolve models that live in a private hub — only public
JumpStart models and (by a fragile assumption) plain private-hub references worked. This change fixes hub-content
resolution so ModelTrainer reaches parity with ModelBuilder, supporting:
Root cause
sagemaker.core.jumpstart.document.get_hub_content_and_document() guessed the hub content type from the hub name:
hub_content_type = "Model" if hub_name == SAGEMAKER_PUBLIC_HUB else "ModelReference"
A private hub can hold either a Model or a ModelReference. This guess meant:
Fix (sagemaker-core/src/sagemaker/core/jumpstart/document.py)
public hub uses Model only. This mirrors ModelBuilder's resolution in accessors.py.
No changes were needed elsewhere: defaults.py already attaches HubAccessConfig based on hub_content_type, and
model_trainer.py / JumpStartConfig already support hub_name/hub_content_name — they become correct automatically
once the content type is resolved honestly.
Testing
Unit (sagemaker-core/tests/unit/jumpstart/test_document.py) — 5 new tests, all passing:
Integration (sagemaker-train/tests/integ/jumpstart/test_jumpstart_train.py) — 3 new tests, each creates a
temporary private hub, runs a real training job, and tears down (skips gracefully without hub permissions). All
verified passing end-to-end against AWS: