Upgrading Sagemaker docs and tutorials to sagemaker-sdk v3#2556
Conversation
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>
|
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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ 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\"" |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 90d10a8. Configure here.
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>


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.0tosagemaker>=3.0.0, with v2 “stick to v2” warnings replaced by notes describingModelBuilder/ModelTrainer.Inference:
HuggingFaceModel+predictbecomeModelBuilder(TEI viaModelServer.TEI) andEndpoint.invokewith JSON bodies. Container URIs usesagemaker.core.image_uris.retrieve(updated TEI 1.8.2). The Llama 3.3 70B Inferentia2 guide usessagemaker.core.resources(Model,EndpointConfig,Endpoint) because v3ModelBuilderTGI is GPU-only; model ID updates to Llama-3.3-70B-Instruct and Neuron images come fromimage_urisinstead of hardcoded ECR maps.Training / eval:
HuggingFaceestimators becomeModelTrainerwithSourceCode,Compute, andInputData/OutputDataConfig. Lighteval moves tolighteval==0.13.0CLI via newscripts/run_lighteval.pyandModelTrainer.train(). Embedding fine-tune points training atscripts/, drops pinned DLC-breaking deps in favor ofsentence-transformersonly inscripts/requirements.txt, and deploys artifacts withModelBuilderimage pass-through.Misc:
.gitignoreadds.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.