Skip to content

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

Merged
dwarez merged 10 commits into
mainfrom
sagemaker-sdk-v3-migration
Jun 23, 2026
Merged

Upgrading Sagemaker docs and tutorials to sagemaker-sdk v3#2556
dwarez merged 10 commits into
mainfrom
sagemaker-sdk-v3-migration

Conversation

@dwarez

@dwarez dwarez commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Note

Low Risk
Changes are docs and notebooks only; they do not alter runtime libraries, though incorrect SDK v3 examples could mislead users configuring AWS training or endpoints.

Overview
This PR refreshes Hugging Face on AWS SageMaker documentation and example notebooks for SageMaker Python SDK v3, replacing v2 patterns (HuggingFace / HuggingFaceModel) with ModelTrainer for jobs and ModelBuilder (or sagemaker.core.resources where Neuron/TGI builders do not apply) for inference.

Tutorials under docs/sagemaker/source/ now call out pip install "sagemaker>=3.0.0", image_uris.retrieve, InputData channels, and updated deploy/train flows (including JumpStart via ModelBuilder(model=...)). Example notebooks cover embeddings (TEI), Lighteval on ModelTrainer, TRL CLI SFT, DeepSeek OCR batch jobs, Inferentia2 Llama via core Model/Endpoint APIs, and fine-tune-then-deploy embedding workflows.

.gitignore adds .ipynb_checkpoints/ so local Jupyter checkpoint dirs from the updated notebooks are not committed.

Reviewed by Cursor Bugbot for commit 847d078. 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.

dwarez added 7 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>
deepseek-ocr-sagemaker

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

@ehcalabres ehcalabres left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @dwarez! Thanks for all the updates! As per the changes you made, everything looks good to me. I just have a couple of comments regarding unchanged sections:

  • Do we want to include the note about sagemaker v3 on all notebooks? If so, we should add it here and here too
  • I think that the neuron agent example is still in the old SDK version, maybe you missed that one?

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

dwarez commented Jun 23, 2026

Copy link
Copy Markdown
Contributor Author

Hey @dwarez! Thanks for all the updates! As per the changes you made, everything looks good to me. I just have a couple of comments regarding unchanged sections:

* Do we want to include the note about sagemaker v3 on all notebooks? If so, we should add it [here](docs/sagemaker/notebooks/sagemaker-sdk/deepseek-ocr-sagemaker/sagemaker-notebook.ipynb) and [here](docs/sagemaker/notebooks/sagemaker-sdk/fine-tune-trl-cli/sagemaker-notebook.ipynb) too

* I think that the [neuron agent example](docs/sagemaker/notebooks/sagemaker-sdk/neuron-agent-inf/sagemaker-notebook.ipynb) is still in the old SDK version, maybe you missed that one?

hey @ehcalabres thanks for the review 😄

You're right the banner was missing from the fine-tune-trl notebook, I added it.
For the neuron agent example, I didn't commit anything because I wasn't able to test it end to end because of ml.inf2.24xlarge availability. I spoke with @tengomucho and maybe we can eventually fix that example in another PR.

@dwarez
dwarez merged commit e52befd into main Jun 23, 2026
3 checks passed
@dwarez
dwarez deleted the sagemaker-sdk-v3-migration branch June 23, 2026 12:45
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.

4 participants