Skip to content

Upgrading Sagemaker docs and tutorials to sagemaker-sdk v3#2556

Open
dwarez wants to merge 4 commits into
mainfrom
sagemaker-sdk-v3-migration
Open

Upgrading Sagemaker docs and tutorials to sagemaker-sdk v3#2556
dwarez wants to merge 4 commits into
mainfrom
sagemaker-sdk-v3-migration

Conversation

@dwarez

@dwarez dwarez commented Jun 12, 2026

Copy link
Copy Markdown

Note

Low Risk
Documentation and example-notebook changes only; no application runtime code. Reviewers should note the embedding deploy notebook adds a hardcoded example IAM role ARN.

Overview
Migrates SageMaker SDK tutorial notebooks from v2 to v3 across deploy, train, and evaluate flows. Install pins change from sagemaker<3.0.0 to sagemaker>=3.0.0, with v2 “stick to v2” warnings replaced by notes describing ModelBuilder / ModelTrainer.

Inference: HuggingFaceModel + predict become ModelBuilder (TEI via ModelServer.TEI) and Endpoint.invoke with JSON bodies. Container URIs use sagemaker.core.image_uris.retrieve (updated TEI 1.8.2). The Llama 3.3 70B Inferentia2 guide uses sagemaker.core.resources (Model, EndpointConfig, Endpoint) because v3 ModelBuilder TGI is GPU-only; model ID updates to Llama-3.3-70B-Instruct and Neuron images come from image_uris instead of hardcoded ECR maps.

Training / eval: HuggingFace estimators become ModelTrainer with SourceCode, Compute, and InputData / OutputDataConfig. Lighteval moves to lighteval==0.13.0 CLI via new scripts/run_lighteval.py and ModelTrainer.train(). Embedding fine-tune points training at scripts/, drops pinned DLC-breaking deps in favor of sentence-transformers only in scripts/requirements.txt, and deploys artifacts with ModelBuilder image pass-through.

Misc: .gitignore adds .ipynb_checkpoints/; notebook kernels/metadata target Python 3.12.13; TRL CLI notebook gets nbformat/emoji fixes only.

Reviewed by Cursor Bugbot for commit 27fd57b. Bugbot is set up for automated code reviews on this repo. Configure here.

dwarez added 2 commits June 11, 2026 18:49
fix: removed unecessary dependencies from the `run_mnr.py` script
because now we're using an image that already carries most of them
change: asset folder renamed to scripts because it only contains a
script and a requirements file (furthermore the notebook was pointing to
the scrips/ folder and not to assets/)

Signed-off-by: DWarez <dario.salvati@huggingface.co>
@HuggingFaceDocBuilderDev

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 90d10a8. Configure here.

"source": [
"import json\n",
"from sagemaker.huggingface import HuggingFaceModel\n",
"role = \"arn:aws:iam::754289655784:role/sagemaker_execution_role\""

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hardcoded IAM role overwrites setup

High Severity

A new cell assigns role to a fixed arn:aws:iam::754289655784:role/sagemaker_execution_role, replacing the role from get_execution_role() in section 1. Readers who run cells in order use the wrong account’s role and ModelBuilder fails unless they happen to share that ARN.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 90d10a8. Configure here.

dwarez added 2 commits June 12, 2026 14:57
change: upgraded packages involved
change: added requirements and launch script directly in a scripts/
folder, removed the instructions to write them at runtime

Signed-off-by: DWarez <dario.salvati@huggingface.co>
Signed-off-by: DWarez <dario.salvati@huggingface.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants