Skip to content

Commit 0d42b9d

Browse files
authored
Merge branch 'master' into master-revert-xgboost
2 parents ab098bc + 42a90d7 commit 0d42b9d

File tree

37 files changed

+10656
-2883
lines changed

37 files changed

+10656
-2883
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
# Changelog
22

3+
## v2.237.1 (2024-12-12)
4+
5+
### Bug Fixes and Other Changes
6+
7+
* chore: remove support for ecr spec fallbacks for jumpstart models
8+
* Cloudpickle Revert
9+
* Cloudpickle update
10+
* Numpy update
11+
* Protobuf update
12+
* Update to fetch latest Cloudpickle version
13+
314
## v2.237.0 (2024-12-05)
415

516
### Features

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.237.1.dev0
1+
2.237.2.dev0

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ classifiers = [
3333
dependencies = [
3434
"attrs>=23.1.0,<24",
3535
"boto3>=1.35.75,<2.0",
36-
"cloudpickle>=2.2.1",
36+
"cloudpickle==2.2.1",
3737
"docker",
3838
"fastapi",
3939
"google-pasta",
4040
"importlib-metadata>=1.4.0,<7.0",
4141
"jsonschema",
42-
"numpy>=1.9.0,<3.0",
42+
"numpy>=1.9.0,<2.0",
4343
"omegaconf>=2.2,<2.3",
4444
"packaging>=20.0",
4545
"pandas",

requirements/extras/test_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Jinja2==3.1.4
2424
pyvis==0.2.1
2525
pandas==1.4.4
2626
scikit-learn==1.3.0
27-
cloudpickle>=2.2.1
27+
cloudpickle==2.2.1
2828
jsonpickle<4.0.0
2929
PyYAML==6.0
3030
# TODO find workaround

src/sagemaker/image_uris.py

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from packaging.version import Version
2222

2323
from sagemaker import utils
24-
from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION
24+
from sagemaker.jumpstart.constants import DEFAULT_JUMPSTART_SAGEMAKER_SESSION, JUMPSTART_LOGGER
2525
from sagemaker.jumpstart.enums import JumpStartModelType
2626
from sagemaker.jumpstart.utils import is_jumpstart_model_input
2727
from sagemaker.spark import defaults
@@ -154,23 +154,27 @@ def retrieve(
154154
)
155155

156156
if is_jumpstart_model_input(model_id, model_version):
157+
if non_none_fields := {
158+
key: value
159+
for key, value in args.items()
160+
if key in {"version", "framework", "container_version", "py_version"}
161+
and value is not None
162+
}:
163+
JUMPSTART_LOGGER.info(
164+
"Ignoring the following arguments when retrieving image uri "
165+
"for JumpStart model id '%s': %s",
166+
model_id,
167+
str(non_none_fields),
168+
)
157169
return artifacts._retrieve_image_uri(
158-
model_id,
159-
model_version,
160-
image_scope,
161-
hub_arn,
162-
framework,
163-
region,
164-
version,
165-
py_version,
166-
instance_type,
167-
accelerator_type,
168-
container_version,
169-
distribution,
170-
base_framework_version,
171-
training_compiler_config,
172-
tolerate_vulnerable_model,
173-
tolerate_deprecated_model,
170+
model_id=model_id,
171+
model_version=model_version,
172+
image_scope=image_scope,
173+
hub_arn=hub_arn,
174+
region=region,
175+
instance_type=instance_type,
176+
tolerate_vulnerable_model=tolerate_vulnerable_model,
177+
tolerate_deprecated_model=tolerate_deprecated_model,
174178
sagemaker_session=sagemaker_session,
175179
config_name=config_name,
176180
model_type=model_type,

src/sagemaker/jumpstart/artifacts/image_uris.py

Lines changed: 10 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,12 @@
1414
from __future__ import absolute_import
1515

1616
from typing import Optional
17-
from sagemaker import image_uris
1817
from sagemaker.jumpstart.constants import (
1918
DEFAULT_JUMPSTART_SAGEMAKER_SESSION,
2019
)
2120
from sagemaker.jumpstart.enums import (
2221
JumpStartModelType,
2322
JumpStartScriptScope,
24-
ModelFramework,
2523
)
2624
from sagemaker.jumpstart.utils import (
2725
get_region_fallback,
@@ -35,16 +33,8 @@ def _retrieve_image_uri(
3533
model_version: str,
3634
image_scope: str,
3735
hub_arn: Optional[str] = None,
38-
framework: Optional[str] = None,
3936
region: Optional[str] = None,
40-
version: Optional[str] = None,
41-
py_version: Optional[str] = None,
4237
instance_type: Optional[str] = None,
43-
accelerator_type: Optional[str] = None,
44-
container_version: Optional[str] = None,
45-
distribution: Optional[str] = None,
46-
base_framework_version: Optional[str] = None,
47-
training_compiler_config: Optional[str] = None,
4838
tolerate_vulnerable_model: bool = False,
4939
tolerate_deprecated_model: bool = False,
5040
sagemaker_session: Session = DEFAULT_JUMPSTART_SAGEMAKER_SESSION,
@@ -66,30 +56,11 @@ def _retrieve_image_uri(
6656
image_scope (str): The image type, i.e. what it is used for.
6757
Valid values: "training", "inference", "eia". If ``accelerator_type`` is set,
6858
``image_scope`` is ignored.
69-
framework (str): The name of the framework or algorithm.
7059
region (str): The AWS region. (Default: None).
71-
version (str): The framework or algorithm version. This is required if there is
72-
more than one supported version for the given framework or algorithm.
73-
(Default: None).
74-
py_version (str): The Python version. This is required if there is
75-
more than one supported Python version for the given framework version.
7660
instance_type (str): The SageMaker instance type. For supported types, see
7761
https://aws.amazon.com/sagemaker/pricing/instance-types. This is required if
7862
there are different images for different processor types.
7963
(Default: None).
80-
accelerator_type (str): Elastic Inference accelerator type. For more, see
81-
https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html.
82-
(Default: None).
83-
container_version (str): the version of docker image.
84-
Ideally the value of parameter should be created inside the framework.
85-
For custom use, see the list of supported container versions:
86-
https://github.com/aws/deep-learning-containers/blob/master/available_images.md.
87-
(Default: None).
88-
distribution (dict): A dictionary with information on how to run distributed training.
89-
(Default: None).
90-
training_compiler_config (:class:`~sagemaker.training_compiler.TrainingCompilerConfig`):
91-
A configuration class for the SageMaker Training Compiler.
92-
(Default: None).
9364
tolerate_vulnerable_model (bool): True if vulnerable versions of model
9465
specifications should be tolerated (exception not raised). If False, raises an
9566
exception if the script used by this version of the model has dependencies with known
@@ -142,14 +113,12 @@ def _retrieve_image_uri(
142113
ecr_uri = model_specs.hosting_ecr_uri
143114
return ecr_uri
144115

145-
ecr_specs = model_specs.hosting_ecr_specs
146-
if ecr_specs is None:
147-
raise ValueError(
148-
f"No inference ECR configuration found for JumpStart model ID '{model_id}' "
149-
f"with {instance_type} instance type in {region}. "
150-
"Please try another instance type or region."
151-
)
152-
elif image_scope == JumpStartScriptScope.TRAINING:
116+
raise ValueError(
117+
f"No inference ECR configuration found for JumpStart model ID '{model_id}' "
118+
f"with {instance_type} instance type in {region}. "
119+
"Please try another instance type or region."
120+
)
121+
if image_scope == JumpStartScriptScope.TRAINING:
153122
training_instance_type_variants = model_specs.training_instance_type_variants
154123
if training_instance_type_variants:
155124
image_uri = training_instance_type_variants.get_image_uri(
@@ -161,65 +130,10 @@ def _retrieve_image_uri(
161130
ecr_uri = model_specs.training_ecr_uri
162131
return ecr_uri
163132

164-
ecr_specs = model_specs.training_ecr_specs
165-
if ecr_specs is None:
166-
raise ValueError(
167-
f"No training ECR configuration found for JumpStart model ID '{model_id}' "
168-
f"with {instance_type} instance type in {region}. "
169-
"Please try another instance type or region."
170-
)
171-
if framework is not None and framework != ecr_specs.framework:
172-
raise ValueError(
173-
f"Incorrect container framework '{framework}' for JumpStart model ID '{model_id}' "
174-
f"and version '{model_version}'."
175-
)
176-
177-
if version is not None and version != ecr_specs.framework_version:
178-
raise ValueError(
179-
f"Incorrect container framework version '{version}' for JumpStart model ID "
180-
f"'{model_id}' and version '{model_version}'."
181-
)
182-
183-
if py_version is not None and py_version != ecr_specs.py_version:
184133
raise ValueError(
185-
f"Incorrect python version '{py_version}' for JumpStart model ID '{model_id}' "
186-
f"and version '{model_version}'."
187-
)
188-
189-
base_framework_version_override: Optional[str] = None
190-
version_override: Optional[str] = None
191-
if ecr_specs.framework == ModelFramework.HUGGINGFACE:
192-
base_framework_version_override = ecr_specs.framework_version
193-
version_override = ecr_specs.huggingface_transformers_version
194-
195-
if image_scope == JumpStartScriptScope.TRAINING:
196-
return image_uris.get_training_image_uri(
197-
region=region,
198-
framework=ecr_specs.framework,
199-
framework_version=version_override or ecr_specs.framework_version,
200-
py_version=ecr_specs.py_version,
201-
image_uri=None,
202-
distribution=None,
203-
compiler_config=None,
204-
tensorflow_version=None,
205-
pytorch_version=base_framework_version_override or base_framework_version,
206-
instance_type=instance_type,
134+
f"No training ECR configuration found for JumpStart model ID '{model_id}' "
135+
f"with {instance_type} instance type in {region}. "
136+
"Please try another instance type or region."
207137
)
208-
if base_framework_version_override is not None:
209-
base_framework_version_override = f"pytorch{base_framework_version_override}"
210138

211-
return image_uris.retrieve(
212-
framework=ecr_specs.framework,
213-
region=region,
214-
version=version_override or ecr_specs.framework_version,
215-
py_version=ecr_specs.py_version,
216-
instance_type=instance_type,
217-
hub_arn=hub_arn,
218-
accelerator_type=accelerator_type,
219-
image_scope=image_scope,
220-
container_version=container_version,
221-
distribution=distribution,
222-
base_framework_version=base_framework_version_override or base_framework_version,
223-
training_compiler_config=training_compiler_config,
224-
config_name=config_name,
225-
)
139+
raise ValueError(f"Invalid scope: {image_scope}")

src/sagemaker/serve/utils/conda_in_process.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies:
3939
- certifi==2022.12.7
4040
- charset-normalizer>=3.1.0
4141
- click>=8.1.3
42-
- cloudpickle>=2.2.1
42+
- cloudpickle==2.2.1
4343
- colorama>=0.4.4
4444
- contextlib2>=21.6.0
4545
- decorator>=5.1.1

src/sagemaker/serve/utils/in_process_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cachetools>=5.3.0
77
certifi==2024.7.4
88
charset-normalizer>=3.1.0
99
click>=8.1.3
10-
cloudpickle>=2.2.1
10+
cloudpickle==2.2.1
1111
colorama>=0.4.4
1212
contextlib2>=21.6.0
1313
decorator>=5.1.1

tests/data/serve_resources/mlflow/pytorch/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
mlflow==2.13.2
22
astunparse==1.6.3
33
cffi==1.16.0
4-
cloudpickle>=2.2.1
4+
cloudpickle==2.2.1
55
defusedxml==0.7.1
66
dill==0.3.8
77
gmpy2==2.1.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
mlflow==2.13.2
2-
cloudpickle>=2.2.1
2+
cloudpickle==2.2.1
33
numpy==1.26.4
44
tensorflow==2.16.1

0 commit comments

Comments
 (0)