Skip to content

Commit c533bef

Browse files
ehcalabresCharlie-Boyer
authored andcommitted
[SageMaker] Add warning about SageMaker SDK v3 breaking changes (#2095)
* Add warning about SageMaker SDK v3 breaking changes * Update SageMaker SDK version in notebooks to avoid breaking changes in v3 * Add missing warnings about SageMaker SDK v3 breaking changes * Update warnings regarding SageMaker Python SDK
1 parent 8209c51 commit c533bef

File tree

11 files changed

+75
-16
lines changed

11 files changed

+75
-16
lines changed

docs/hub/security-sso.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,28 @@ The default value is 7 days.
5858

5959
When enabled, Role Mapping allows you to dynamically assign [roles](./organizations-security#access-control-in-organizations) to organization members based on data provided by your Identity Provider.
6060

61-
This section allows you to define a mapping from your IdP's user profile data from your IdP to the assigned role in Hugging Face.
61+
This section allows you to define a mapping from your IdP's user profile data to the assigned role in Hugging Face.
6262

63-
- IdP Role Attribute Mapping
63+
- **IdP Role Attribute Path**
6464

6565
A JSON path to an attribute in your user's IdP profile data.
66+
It supports dot notation (e.g. `user.role` or `groups`).
67+
For SAML, this can be a URI if your claims are URIs (e.g. `http://schemas.microsoft.com/ws/2008/06/identity/claims/role`).
6668

67-
- Role Mapping
69+
- **Role Mapping**
6870

6971
A mapping from the IdP attribute value to the assigned role in the Hugging Face organization.
72+
73+
Available roles are `admin`, `write`, `contributor`, and `read`. See [roles documentation](./organizations-security#access-control-in-organizations) for more details.
7074

71-
You must map at least one admin role.
75+
> [!IMPORTANT]
76+
> You must map at least one `admin` role in your configuration.
77+
78+
If the attribute in the IdP response contains multiple values (e.g. a list of groups), the **first matching mapping** will be used to determine the user's role.
7279

7380
If there is no match, a user will be assigned the default role for your organization. The default role can be customized in the `Members` section of the organization's settings.
7481

75-
Role synchronization is performed on login.
82+
Role synchronization is performed on every login.
7683

7784
#### Resource Group Mapping
7885

@@ -83,13 +90,15 @@ When enabled, Resource Group Mapping allows you to dynamically assign members to
8390
<img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/enterprise/resource-group-mapping-dark.png"/>
8491
</div>
8592

86-
- IdP Attribute Path
93+
- **IdP Attribute Path**
8794

88-
A JSON path to an attribute in your user's IdP profile data.
95+
A JSON path to an attribute in your user's IdP profile data. Similar to Role Mapping, this supports dot notation or URIs for SAML.
96+
97+
- **Resource Group Mapping**
8998

90-
- Resource Group Mapping
99+
A mapping from the IdP attribute value to a resource group in your Hugging Face organization. You can assign a specific role (`admin`, `write`, `contributor`, `read`) for each resource group mapping.
91100

92-
A mapping from the IdP attribute value to a resource group in your Hugging Face organization.
101+
Unlike Role Mapping, **Resource Group Mapping is additive**. If a user matches multiple mappings (e.g. they belong to multiple groups in your IdP that are mapped to different Resource Groups), they will be added to **all** matched Resource Groups.
93102

94103
If there is no match, the user will not be assigned to any resource group.
95104

docs/sagemaker/notebooks/sagemaker-sdk/deploy-embedding-models/sagemaker-notebook.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,15 @@
5353
"metadata": {},
5454
"outputs": [],
5555
"source": [
56-
"!pip install \"sagemaker>=2.221.1\" --upgrade --quiet\n"
56+
"!pip install \"sagemaker<3.0.0\" --upgrade --quiet"
57+
]
58+
},
59+
{
60+
"cell_type": "markdown",
61+
"metadata": {},
62+
"source": [
63+
"> [!WARNING]\n",
64+
"> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install \"sagemaker<3.0.0\"`."
5765
]
5866
},
5967
{

docs/sagemaker/notebooks/sagemaker-sdk/deploy-llama-3-3-70b-inferentia2/sagemaker-notebook.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@
4646
"metadata": {},
4747
"outputs": [],
4848
"source": [
49-
"!pip install sagemaker --upgrade --quiet"
49+
"!pip install 'sagemaker<3.0.0' --upgrade --quiet"
50+
]
51+
},
52+
{
53+
"cell_type": "markdown",
54+
"metadata": {},
55+
"source": [
56+
"> [!WARNING]\n",
57+
"> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install \"sagemaker<3.0.0\"`."
5058
]
5159
},
5260
{

docs/sagemaker/notebooks/sagemaker-sdk/evaluate-llm-lighteval/sagemaker-notebook.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,15 @@
2525
"metadata": {},
2626
"outputs": [],
2727
"source": [
28-
"!pip install sagemaker --upgrade --quiet"
28+
"!pip install 'sagemaker<3.0.0' --upgrade --quiet"
29+
]
30+
},
31+
{
32+
"cell_type": "markdown",
33+
"metadata": {},
34+
"source": [
35+
"> [!WARNING]\n",
36+
"> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install \"sagemaker<3.0.0\"`."
2937
]
3038
},
3139
{

docs/sagemaker/notebooks/sagemaker-sdk/fine-tune-embedding-models/sagemaker-notebook.ipynb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,15 @@
3939
"metadata": {},
4040
"outputs": [],
4141
"source": [
42-
"!pip install transformers \"datasets[s3]==2.18.0\" \"sagemaker>=2.190.0\" \"huggingface_hub[cli]\" --upgrade --quiet"
42+
"!pip install transformers \"datasets[s3]==2.18.0\" \"sagemaker<3.0.0\" \"huggingface_hub[cli]\" --upgrade --quiet"
43+
]
44+
},
45+
{
46+
"cell_type": "markdown",
47+
"metadata": {},
48+
"source": [
49+
"> [!WARNING]\n",
50+
"> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install \"sagemaker<3.0.0\"`."
4351
]
4452
},
4553
{

docs/sagemaker/source/dlcs/available.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ Let's say you want to use the training DLC for GPUs in
7272

7373
The Python SagemMaker SDK util functions are not always up to date but it is much simpler than reconstructing the image URI yourself.
7474

75+
> [!WARNING]
76+
> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install "sagemaker<3.0.0"`.
77+
7578
```python
7679
from sagemaker.huggingface import HuggingFaceModel, get_huggingface_llm_image_uri
7780

docs/sagemaker/source/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ We develop new tools to simplify the adoption of custom AI accelerators like AWS
1212

1313
By combining Hugging Face's open-source models and libraries with AWS's scalable and secure cloud services, developers can more easily and affordably incorporate advanced AI capabilities into their applications.
1414

15+
> [!WARNING]
16+
> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install "sagemaker<3.0.0"`.
17+
1518
## Deploy models on AWS
1619

1720
Deploying Hugging Face models on AWS is streamlined through various services, each suited for different deployment scenarios. Here's how you can deploy your models using AWS and Hugging Face offerings.

docs/sagemaker/source/tutorials/jumpstart/jumpstart-quickstart.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ In this quickstart guide, we will deploy [Qwen/Qwen2.5-14B-Instruct](https://hug
1515
| SageMaker Studio domain and user profile | We recommend using SageMaker Studio for straightforward deployment and inference. Follow this [guide](https://docs.aws.amazon.com/sagemaker/latest/dg/onboard-quick-start.html). |
1616
| Service quotas | Most LLMs need GPU instances (e.g. ml.g5). Verify you have quota for `ml.g5.24xlarge` or [request it](https://docs.aws.amazon.com/sagemaker/latest/dg/canvas-requesting-quota-increases.html). |
1717

18+
> [!WARNING]
19+
> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install "sagemaker<3.0.0"`.
20+
1821
## 2· Endpoint deployment
1922

2023
Let's explain how you would deploy a Hugging Face model to SageMaker browsing through the Jumpstart catalog:

docs/sagemaker/source/tutorials/sagemaker-sdk/deploy-sagemaker-sdk.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ To start training locally, you need to setup an appropriate [IAM role](https://d
3232
Upgrade to the latest `sagemaker` version.
3333

3434
```bash
35-
pip install sagemaker --upgrade
35+
pip install 'sagemaker<3.0.0'
3636
```
3737

38+
> [!WARNING]
39+
> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install "sagemaker<3.0.0"`.
40+
3841
**SageMaker environment**
3942

4043
Setup your SageMaker environment as shown below:

docs/sagemaker/source/tutorials/sagemaker-sdk/sagemaker-sdk-quickstart.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ The get started guide will show you how to quickly use Hugging Face on Amazon Sa
1111
Get started by installing the necessary Hugging Face libraries and SageMaker. You will also need to install [PyTorch](https://pytorch.org/get-started/locally/) if you don't already have it installed. If you run this example in SageMaker Studio, it is already installed in the notebook kernel!
1212

1313
```python
14-
pip install "sagemaker>=2.140.0" "transformers==4.26.1" "datasets[s3]==2.10.1" --upgrade
14+
pip install "sagemaker<3.0.0" "transformers==4.26.1" "datasets[s3]==2.10.1" --upgrade
1515
```
1616

17+
> [!WARNING]
18+
> [SageMaker Python SDK v3 has been recently released](https://github.com/aws/sagemaker-python-sdk), so unless specified otherwise, all the documentation and tutorials are still using the [SageMaker Python SDK v2](https://github.com/aws/sagemaker-python-sdk/tree/master-v2). We are actively working on updating all the tutorials and examples, but in the meantime make sure to install the SageMaker SDK as `pip install "sagemaker<3.0.0"`.
19+
1720
If you want to run this example in [SageMaker Studio](https://docs.aws.amazon.com/sagemaker/latest/dg/studio.html), upgrade [ipywidgets](https://ipywidgets.readthedocs.io/en/latest/) for the 🤗 Datasets library and restart the kernel:
1821

1922
```python

0 commit comments

Comments
 (0)