Skip to content

Commit 351be13

Browse files
authored
Merge branch 'master' into fix-ssh-policy
2 parents 1444c87 + 10b64f6 commit 351be13

File tree

14 files changed

+511
-10
lines changed

14 files changed

+511
-10
lines changed

CHANGELOG.md

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

3+
## v2.238.0 (2025-01-29)
4+
5+
### Features
6+
7+
* use jumpstart deployment config image as default optimization image
8+
9+
### Bug Fixes and Other Changes
10+
11+
* chore: add new images for HF TGI
12+
* update image_uri_configs 01-29-2025 06:18:08 PST
13+
* skip TF tests for unsupported versions
14+
* Merge branch 'master-rba' into local_merge
15+
* Add missing attributes to local resourceconfig
16+
* update image_uri_configs 01-27-2025 06:18:13 PST
17+
* update image_uri_configs 01-24-2025 06:18:11 PST
18+
* add missing schema definition in docs
19+
* Omegaconf upgrade
20+
* SageMaker @remote function: Added multi-node functionality
21+
* remove option
22+
* fix typo
23+
* fix tests
24+
* Add an option for user to remove inputs and container artifacts when using local model trainer
25+
326
## v2.237.3 (2025-01-09)
427

528
### Bug Fixes and Other Changes

VERSION

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

src/sagemaker/fw_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
"2.1.0",
153153
"2.1.2",
154154
"2.2.0",
155+
"2.3.0",
155156
"2.3.1",
156157
"2.4.1",
157158
]

src/sagemaker/image_uri_config/huggingface-llm.json

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"1.2": "1.2.0",
1313
"1.3": "1.3.3",
1414
"1.4": "1.4.5",
15-
"2.0": "2.3.1"
15+
"2.0": "2.4.0",
16+
"3.0": "3.0.1"
1617
},
1718
"versions": {
1819
"0.6.0": {
@@ -766,6 +767,100 @@
766767
"container_version": {
767768
"gpu": "cu124-ubuntu22.04"
768769
}
770+
},
771+
"2.4.0": {
772+
"py_versions": [
773+
"py311"
774+
],
775+
"registries": {
776+
"af-south-1": "626614931356",
777+
"il-central-1": "780543022126",
778+
"ap-east-1": "871362719292",
779+
"ap-northeast-1": "763104351884",
780+
"ap-northeast-2": "763104351884",
781+
"ap-northeast-3": "364406365360",
782+
"ap-south-1": "763104351884",
783+
"ap-south-2": "772153158452",
784+
"ap-southeast-1": "763104351884",
785+
"ap-southeast-2": "763104351884",
786+
"ap-southeast-3": "907027046896",
787+
"ap-southeast-4": "457447274322",
788+
"ca-central-1": "763104351884",
789+
"cn-north-1": "727897471807",
790+
"cn-northwest-1": "727897471807",
791+
"eu-central-1": "763104351884",
792+
"eu-central-2": "380420809688",
793+
"eu-north-1": "763104351884",
794+
"eu-west-1": "763104351884",
795+
"eu-west-2": "763104351884",
796+
"eu-west-3": "763104351884",
797+
"eu-south-1": "692866216735",
798+
"eu-south-2": "503227376785",
799+
"me-south-1": "217643126080",
800+
"me-central-1": "914824155844",
801+
"sa-east-1": "763104351884",
802+
"us-east-1": "763104351884",
803+
"us-east-2": "763104351884",
804+
"us-gov-east-1": "446045086412",
805+
"us-gov-west-1": "442386744353",
806+
"us-iso-east-1": "886529160074",
807+
"us-isob-east-1": "094389454867",
808+
"us-west-1": "763104351884",
809+
"us-west-2": "763104351884",
810+
"ca-west-1": "204538143572"
811+
},
812+
"tag_prefix": "2.4.0-tgi2.4.0",
813+
"repository": "huggingface-pytorch-tgi-inference",
814+
"container_version": {
815+
"gpu": "cu124-ubuntu22.04-v2.2"
816+
}
817+
},
818+
"3.0.1": {
819+
"py_versions": [
820+
"py311"
821+
],
822+
"registries": {
823+
"af-south-1": "626614931356",
824+
"il-central-1": "780543022126",
825+
"ap-east-1": "871362719292",
826+
"ap-northeast-1": "763104351884",
827+
"ap-northeast-2": "763104351884",
828+
"ap-northeast-3": "364406365360",
829+
"ap-south-1": "763104351884",
830+
"ap-south-2": "772153158452",
831+
"ap-southeast-1": "763104351884",
832+
"ap-southeast-2": "763104351884",
833+
"ap-southeast-3": "907027046896",
834+
"ap-southeast-4": "457447274322",
835+
"ca-central-1": "763104351884",
836+
"cn-north-1": "727897471807",
837+
"cn-northwest-1": "727897471807",
838+
"eu-central-1": "763104351884",
839+
"eu-central-2": "380420809688",
840+
"eu-north-1": "763104351884",
841+
"eu-west-1": "763104351884",
842+
"eu-west-2": "763104351884",
843+
"eu-west-3": "763104351884",
844+
"eu-south-1": "692866216735",
845+
"eu-south-2": "503227376785",
846+
"me-south-1": "217643126080",
847+
"me-central-1": "914824155844",
848+
"sa-east-1": "763104351884",
849+
"us-east-1": "763104351884",
850+
"us-east-2": "763104351884",
851+
"us-gov-east-1": "446045086412",
852+
"us-gov-west-1": "442386744353",
853+
"us-iso-east-1": "886529160074",
854+
"us-isob-east-1": "094389454867",
855+
"us-west-1": "763104351884",
856+
"us-west-2": "763104351884",
857+
"ca-west-1": "204538143572"
858+
},
859+
"tag_prefix": "2.4.0-tgi3.0.1",
860+
"repository": "huggingface-pytorch-tgi-inference",
861+
"container_version": {
862+
"gpu": "cu124-ubuntu22.04-v2.1"
863+
}
769864
}
770865
}
771866
}

src/sagemaker/image_uri_config/huggingface.json

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"4.17": "4.17.0",
1414
"4.26": "4.26.0",
1515
"4.28": "4.28.1",
16-
"4.36": "4.36.0"
16+
"4.36": "4.36.0",
17+
"4.46": "4.46.1"
1718
},
1819
"versions": {
1920
"4.4.2": {
@@ -1018,6 +1019,53 @@
10181019
"gpu": "cu121-ubuntu20.04"
10191020
}
10201021
}
1022+
},
1023+
"4.46.1": {
1024+
"version_aliases": {
1025+
"pytorch2.3": "pytorch2.3.0"
1026+
},
1027+
"pytorch2.3.0": {
1028+
"py_versions": [
1029+
"py311"
1030+
],
1031+
"registries": {
1032+
"af-south-1": "626614931356",
1033+
"il-central-1": "780543022126",
1034+
"ap-east-1": "871362719292",
1035+
"ap-northeast-1": "763104351884",
1036+
"ap-northeast-2": "763104351884",
1037+
"ap-northeast-3": "364406365360",
1038+
"ap-south-1": "763104351884",
1039+
"ap-southeast-1": "763104351884",
1040+
"ap-southeast-2": "763104351884",
1041+
"ap-southeast-3": "907027046896",
1042+
"ca-central-1": "763104351884",
1043+
"cn-north-1": "727897471807",
1044+
"cn-northwest-1": "727897471807",
1045+
"eu-central-1": "763104351884",
1046+
"eu-north-1": "763104351884",
1047+
"eu-west-1": "763104351884",
1048+
"eu-west-2": "763104351884",
1049+
"eu-west-3": "763104351884",
1050+
"eu-south-1": "692866216735",
1051+
"me-south-1": "217643126080",
1052+
"me-central-1": "914824155844",
1053+
"sa-east-1": "763104351884",
1054+
"us-east-1": "763104351884",
1055+
"us-east-2": "763104351884",
1056+
"us-gov-east-1": "446045086412",
1057+
"us-gov-west-1": "442386744353",
1058+
"us-iso-east-1": "886529160074",
1059+
"us-isob-east-1": "094389454867",
1060+
"us-west-1": "763104351884",
1061+
"us-west-2": "763104351884",
1062+
"ca-west-1": "204538143572"
1063+
},
1064+
"repository": "huggingface-pytorch-training",
1065+
"container_version": {
1066+
"gpu": "cu121-ubuntu20.04"
1067+
}
1068+
}
10211069
}
10221070
}
10231071
},

src/sagemaker/image_uri_config/sagemaker-base-python.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"ap-southeast-1": "492261229750",
1212
"ap-southeast-2": "452832661640",
1313
"ap-southeast-3": "276181064229",
14+
"ap-southeast-5": "148761635175",
1415
"ca-central-1": "310906938811",
1516
"cn-north-1": "390048526115",
1617
"cn-northwest-1": "390780980154",

src/sagemaker/serve/builder/jumpstart_builder.py

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import re
1818
from abc import ABC, abstractmethod
1919
from datetime import datetime, timedelta
20-
from typing import Type, Any, List, Dict, Optional
20+
from typing import Type, Any, List, Dict, Optional, Tuple
2121
import logging
2222

2323
from botocore.exceptions import ClientError
@@ -82,6 +82,7 @@
8282
ModelServer.DJL_SERVING,
8383
ModelServer.TGI,
8484
}
85+
_JS_MINIMUM_VERSION_IMAGE = "{}:0.31.0-lmi13.0.0-cu124"
8586

8687
logger = logging.getLogger(__name__)
8788

@@ -829,7 +830,13 @@ def _optimize_for_jumpstart(
829830
self.pysdk_model._enable_network_isolation = False
830831

831832
if quantization_config or sharding_config or is_compilation:
832-
return create_optimization_job_args
833+
# only apply default image for vLLM usecases.
834+
# vLLM does not support compilation for now so skip on compilation
835+
return (
836+
create_optimization_job_args
837+
if is_compilation
838+
else self._set_optimization_image_default(create_optimization_job_args)
839+
)
833840
return None
834841

835842
def _is_gated_model(self, model=None) -> bool:
@@ -986,3 +993,105 @@ def _get_neuron_model_env_vars(
986993
)
987994
return job_model.env
988995
return None
996+
997+
def _set_optimization_image_default(
998+
self, create_optimization_job_args: Dict[str, Any]
999+
) -> Dict[str, Any]:
1000+
"""Defaults the optimization image to the JumpStart deployment config default
1001+
1002+
Args:
1003+
create_optimization_job_args (Dict[str, Any]): create optimization job request
1004+
1005+
Returns:
1006+
Dict[str, Any]: create optimization job request with image uri default
1007+
"""
1008+
default_image = self._get_default_vllm_image(self.pysdk_model.init_kwargs["image_uri"])
1009+
1010+
# find the latest vLLM image version
1011+
for optimization_config in create_optimization_job_args.get("OptimizationConfigs"):
1012+
if optimization_config.get("ModelQuantizationConfig"):
1013+
model_quantization_config = optimization_config.get("ModelQuantizationConfig")
1014+
provided_image = model_quantization_config.get("Image")
1015+
if provided_image and self._get_latest_lmi_version_from_list(
1016+
default_image, provided_image
1017+
):
1018+
default_image = provided_image
1019+
if optimization_config.get("ModelShardingConfig"):
1020+
model_sharding_config = optimization_config.get("ModelShardingConfig")
1021+
provided_image = model_sharding_config.get("Image")
1022+
if provided_image and self._get_latest_lmi_version_from_list(
1023+
default_image, provided_image
1024+
):
1025+
default_image = provided_image
1026+
1027+
# default to latest vLLM version
1028+
for optimization_config in create_optimization_job_args.get("OptimizationConfigs"):
1029+
if optimization_config.get("ModelQuantizationConfig") is not None:
1030+
optimization_config.get("ModelQuantizationConfig")["Image"] = default_image
1031+
if optimization_config.get("ModelShardingConfig") is not None:
1032+
optimization_config.get("ModelShardingConfig")["Image"] = default_image
1033+
1034+
logger.info("Defaulting to %s image for optimization job", default_image)
1035+
1036+
return create_optimization_job_args
1037+
1038+
def _get_default_vllm_image(self, image: str) -> bool:
1039+
"""Ensures the minimum working image version for vLLM enabled optimization techniques
1040+
1041+
Args:
1042+
image (str): JumpStart provided default image
1043+
1044+
Returns:
1045+
str: minimum working image version
1046+
"""
1047+
dlc_name, _ = image.split(":")
1048+
major_version_number, _, _ = self._parse_lmi_version(image)
1049+
1050+
if major_version_number < self._parse_lmi_version(_JS_MINIMUM_VERSION_IMAGE)[0]:
1051+
minimum_version_default = _JS_MINIMUM_VERSION_IMAGE.format(dlc_name)
1052+
return minimum_version_default
1053+
return image
1054+
1055+
def _get_latest_lmi_version_from_list(self, version: str, version_to_compare: str) -> bool:
1056+
"""LMI version comparator
1057+
1058+
Args:
1059+
version (str): current version
1060+
version_to_compare (str): version to compare to
1061+
1062+
Returns:
1063+
bool: if version_to_compare larger or equal to version
1064+
"""
1065+
parse_lmi_version = self._parse_lmi_version(version)
1066+
parse_lmi_version_to_compare = self._parse_lmi_version(version_to_compare)
1067+
1068+
# Check major version
1069+
if parse_lmi_version_to_compare[0] > parse_lmi_version[0]:
1070+
return True
1071+
# Check minor version
1072+
if parse_lmi_version_to_compare[0] == parse_lmi_version[0]:
1073+
if parse_lmi_version_to_compare[1] > parse_lmi_version[1]:
1074+
return True
1075+
if parse_lmi_version_to_compare[1] == parse_lmi_version[1]:
1076+
# Check patch version
1077+
if parse_lmi_version_to_compare[2] >= parse_lmi_version[2]:
1078+
return True
1079+
return False
1080+
return False
1081+
return False
1082+
1083+
def _parse_lmi_version(self, image: str) -> Tuple[int, int, int]:
1084+
"""Parse out LMI version
1085+
1086+
Args:
1087+
image (str): image to parse version out of
1088+
1089+
Returns:
1090+
Tuple[int, int, int]: LMI version split into major, minor, patch
1091+
"""
1092+
_, dlc_tag = image.split(":")
1093+
_, lmi_version, _ = dlc_tag.split("-")
1094+
major_version, minor_version, patch_version = lmi_version.split(".")
1095+
major_version_number = major_version[3:]
1096+
1097+
return (int(major_version_number), int(minor_version), int(patch_version))

src/sagemaker/serve/model_format/mlflow/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"py38": "1.12.1",
1919
"py39": "1.13.1",
2020
"py310": "2.2.0",
21+
"py311": "2.3.0",
2122
}
2223
MODEL_PACKAGE_ARN_REGEX = (
2324
r"^arn:aws:sagemaker:[a-z0-9\-]+:[0-9]{12}:model-package\/(.*?)(?:/(\d+))?$"

tests/conftest.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ def huggingface_pytorch_training_version(huggingface_training_version):
293293

294294
@pytest.fixture(scope="module")
295295
def huggingface_pytorch_training_py_version(huggingface_pytorch_training_version):
296+
if Version(huggingface_pytorch_training_version) >= Version("2.3"):
297+
return "py311"
296298
if Version(huggingface_pytorch_training_version) >= Version("2.0"):
297299
return "py310"
298300
elif Version(huggingface_pytorch_training_version) >= Version("1.13"):
@@ -355,6 +357,8 @@ def huggingface_training_compiler_pytorch_py_version(
355357
def huggingface_pytorch_latest_training_py_version(
356358
huggingface_training_pytorch_latest_version,
357359
):
360+
if Version(huggingface_training_pytorch_latest_version) >= Version("2.3"):
361+
return "py311"
358362
if Version(huggingface_training_pytorch_latest_version) >= Version("2.0"):
359363
return "py310"
360364
elif Version(huggingface_training_pytorch_latest_version) >= Version("1.13"):

tests/integ/sagemaker/jumpstart/private_hub/model/test_jumpstart_private_hub_model.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def test_jumpstart_hub_gated_model(setup, add_model_references):
105105
assert response is not None
106106

107107

108+
@pytest.mark.skip(reason="blocking PR checks and release pipeline.")
108109
def test_jumpstart_gated_model_inference_component_enabled(setup, add_model_references):
109110

110111
model_id = "meta-textgeneration-llama-2-7b"

0 commit comments

Comments
 (0)