Skip to content

Commit 003de0a

Browse files
authored
Merge branch 'master' into fix-ssh-policy
2 parents 19cb25d + daa5518 commit 003de0a

File tree

18 files changed

+240
-52
lines changed

18 files changed

+240
-52
lines changed

src/sagemaker/image_uri_config/autogluon.json

Lines changed: 88 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"0.7": "0.7.0",
1313
"0.8": "0.8.2",
1414
"1.0": "1.0.0",
15-
"1.1": "1.1.1"
15+
"1.1": "1.1.1",
16+
"1.2": "1.2.0"
1617
},
1718
"versions": {
1819
"0.3.1": {
@@ -563,6 +564,47 @@
563564
"py_versions": [
564565
"py311"
565566
]
567+
},
568+
"1.2.0": {
569+
"registries": {
570+
"af-south-1": "626614931356",
571+
"il-central-1": "780543022126",
572+
"ap-east-1": "871362719292",
573+
"ap-northeast-1": "763104351884",
574+
"ap-northeast-2": "763104351884",
575+
"ap-northeast-3": "364406365360",
576+
"ap-south-1": "763104351884",
577+
"ap-southeast-1": "763104351884",
578+
"ap-southeast-2": "763104351884",
579+
"ap-southeast-3": "907027046896",
580+
"ap-southeast-4": "457447274322",
581+
"ca-central-1": "763104351884",
582+
"eu-central-1": "763104351884",
583+
"eu-north-1": "763104351884",
584+
"eu-west-1": "763104351884",
585+
"eu-west-2": "763104351884",
586+
"eu-west-3": "763104351884",
587+
"eu-south-1": "692866216735",
588+
"me-south-1": "217643126080",
589+
"sa-east-1": "763104351884",
590+
"us-east-1": "763104351884",
591+
"us-east-2": "763104351884",
592+
"us-gov-east-1": "446045086412",
593+
"us-gov-west-1": "442386744353",
594+
"us-iso-east-1": "886529160074",
595+
"us-isob-east-1": "094389454867",
596+
"us-west-1": "763104351884",
597+
"us-west-2": "763104351884",
598+
"ca-west-1": "204538143572"
599+
},
600+
"repository": "autogluon-training",
601+
"processors": [
602+
"cpu",
603+
"gpu"
604+
],
605+
"py_versions": [
606+
"py311"
607+
]
566608
}
567609
}
568610
},
@@ -575,7 +617,8 @@
575617
"0.7": "0.7.0",
576618
"0.8": "0.8.2",
577619
"1.0": "1.0.0",
578-
"1.1": "1.1.1"
620+
"1.1": "1.1.1",
621+
"1.2": "1.2.0"
579622
},
580623
"versions": {
581624
"0.3.1": {
@@ -1157,6 +1200,49 @@
11571200
"py_versions": [
11581201
"py311"
11591202
]
1203+
},
1204+
"1.2.0": {
1205+
"registries": {
1206+
"af-south-1": "626614931356",
1207+
"il-central-1": "780543022126",
1208+
"ap-east-1": "871362719292",
1209+
"ap-northeast-1": "763104351884",
1210+
"ap-northeast-2": "763104351884",
1211+
"ap-northeast-3": "364406365360",
1212+
"ap-south-1": "763104351884",
1213+
"ap-southeast-1": "763104351884",
1214+
"ap-southeast-2": "763104351884",
1215+
"ap-southeast-3": "907027046896",
1216+
"ap-southeast-4": "457447274322",
1217+
"ca-central-1": "763104351884",
1218+
"cn-north-1": "727897471807",
1219+
"cn-northwest-1": "727897471807",
1220+
"eu-central-1": "763104351884",
1221+
"eu-north-1": "763104351884",
1222+
"eu-west-1": "763104351884",
1223+
"eu-west-2": "763104351884",
1224+
"eu-west-3": "763104351884",
1225+
"eu-south-1": "692866216735",
1226+
"me-south-1": "217643126080",
1227+
"sa-east-1": "763104351884",
1228+
"us-east-1": "763104351884",
1229+
"us-east-2": "763104351884",
1230+
"us-gov-east-1": "446045086412",
1231+
"us-gov-west-1": "442386744353",
1232+
"us-iso-east-1": "886529160074",
1233+
"us-isob-east-1": "094389454867",
1234+
"us-west-1": "763104351884",
1235+
"us-west-2": "763104351884",
1236+
"ca-west-1": "204538143572"
1237+
},
1238+
"repository": "autogluon-inference",
1239+
"processors": [
1240+
"cpu",
1241+
"gpu"
1242+
],
1243+
"py_versions": [
1244+
"py311"
1245+
]
11601246
}
11611247
}
11621248
}

src/sagemaker/image_uri_config/huggingface-llm-neuronx.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"ap-southeast-1": "763104351884",
1919
"ap-southeast-2": "763104351884",
2020
"ap-southeast-4": "457447274322",
21+
"ap-southeast-5": "550225433462",
2122
"cn-north-1": "727897471807",
2223
"cn-northwest-1": "727897471807",
2324
"eu-central-1": "763104351884",
@@ -51,6 +52,7 @@
5152
"ap-southeast-1": "763104351884",
5253
"ap-southeast-2": "763104351884",
5354
"ap-southeast-4": "457447274322",
55+
"ap-southeast-5": "550225433462",
5456
"cn-north-1": "727897471807",
5557
"cn-northwest-1": "727897471807",
5658
"eu-central-1": "763104351884",
@@ -84,6 +86,7 @@
8486
"ap-southeast-1": "763104351884",
8587
"ap-southeast-2": "763104351884",
8688
"ap-southeast-4": "457447274322",
89+
"ap-southeast-5": "550225433462",
8790
"cn-north-1": "727897471807",
8891
"cn-northwest-1": "727897471807",
8992
"eu-central-1": "763104351884",
@@ -117,6 +120,7 @@
117120
"ap-southeast-1": "763104351884",
118121
"ap-southeast-2": "763104351884",
119122
"ap-southeast-4": "457447274322",
123+
"ap-southeast-5": "550225433462",
120124
"cn-north-1": "727897471807",
121125
"cn-northwest-1": "727897471807",
122126
"eu-central-1": "763104351884",
@@ -150,6 +154,7 @@
150154
"ap-southeast-1": "763104351884",
151155
"ap-southeast-2": "763104351884",
152156
"ap-southeast-4": "457447274322",
157+
"ap-southeast-5": "550225433462",
153158
"cn-north-1": "727897471807",
154159
"cn-northwest-1": "727897471807",
155160
"eu-central-1": "763104351884",
@@ -183,6 +188,7 @@
183188
"ap-southeast-1": "763104351884",
184189
"ap-southeast-2": "763104351884",
185190
"ap-southeast-4": "457447274322",
191+
"ap-southeast-5": "550225433462",
186192
"cn-north-1": "727897471807",
187193
"cn-northwest-1": "727897471807",
188194
"eu-central-1": "763104351884",
@@ -216,6 +222,7 @@
216222
"ap-southeast-1": "763104351884",
217223
"ap-southeast-2": "763104351884",
218224
"ap-southeast-4": "457447274322",
225+
"ap-southeast-5": "550225433462",
219226
"cn-north-1": "727897471807",
220227
"cn-northwest-1": "727897471807",
221228
"eu-central-1": "763104351884",
@@ -247,6 +254,7 @@
247254
"ap-southeast-1": "763104351884",
248255
"ap-southeast-2": "763104351884",
249256
"ap-southeast-4": "457447274322",
257+
"ap-southeast-5": "550225433462",
250258
"cn-north-1": "727897471807",
251259
"cn-northwest-1": "727897471807",
252260
"eu-central-1": "763104351884",
@@ -280,6 +288,7 @@
280288
"ap-southeast-1": "763104351884",
281289
"ap-southeast-2": "763104351884",
282290
"ap-southeast-4": "457447274322",
291+
"ap-southeast-5": "550225433462",
283292
"cn-north-1": "727897471807",
284293
"cn-northwest-1": "727897471807",
285294
"eu-central-1": "763104351884",
@@ -313,6 +322,7 @@
313322
"ap-southeast-1": "763104351884",
314323
"ap-southeast-2": "763104351884",
315324
"ap-southeast-4": "457447274322",
325+
"ap-southeast-5": "550225433462",
316326
"cn-north-1": "727897471807",
317327
"cn-northwest-1": "727897471807",
318328
"eu-central-1": "763104351884",

src/sagemaker/image_uri_config/huggingface-neuron.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
"ap-southeast-1": "763104351884",
2424
"ap-southeast-2": "763104351884",
2525
"ap-southeast-4": "457447274322",
26+
"ap-southeast-5": "550225433462",
2627
"eu-central-1": "763104351884",
2728
"eu-central-2": "380420809688",
2829
"eu-south-2": "503227376785",

src/sagemaker/image_uri_config/huggingface-neuronx.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"ap-southeast-1": "763104351884",
2626
"ap-southeast-2": "763104351884",
2727
"ap-southeast-4": "457447274322",
28+
"ap-southeast-5": "550225433462",
2829
"cn-north-1": "727897471807",
2930
"cn-northwest-1": "727897471807",
3031
"eu-central-1": "763104351884",
@@ -65,6 +66,7 @@
6566
"ap-southeast-1": "763104351884",
6667
"ap-southeast-2": "763104351884",
6768
"ap-southeast-4": "457447274322",
69+
"ap-southeast-5": "550225433462",
6870
"cn-north-1": "727897471807",
6971
"cn-northwest-1": "727897471807",
7072
"eu-central-1": "763104351884",
@@ -105,6 +107,7 @@
105107
"ap-southeast-1": "763104351884",
106108
"ap-southeast-2": "763104351884",
107109
"ap-southeast-4": "457447274322",
110+
"ap-southeast-5": "550225433462",
108111
"cn-north-1": "727897471807",
109112
"cn-northwest-1": "727897471807",
110113
"eu-central-1": "763104351884",
@@ -162,6 +165,7 @@
162165
"ap-southeast-1": "763104351884",
163166
"ap-southeast-2": "763104351884",
164167
"ap-southeast-4": "457447274322",
168+
"ap-southeast-5": "550225433462",
165169
"ca-central-1": "763104351884",
166170
"cn-north-1": "727897471807",
167171
"cn-northwest-1": "727897471807",
@@ -214,6 +218,7 @@
214218
"ap-southeast-1": "763104351884",
215219
"ap-southeast-2": "763104351884",
216220
"ap-southeast-4": "457447274322",
221+
"ap-southeast-5": "550225433462",
217222
"ca-central-1": "763104351884",
218223
"cn-north-1": "727897471807",
219224
"cn-northwest-1": "727897471807",
@@ -267,6 +272,7 @@
267272
"ap-southeast-1": "763104351884",
268273
"ap-southeast-2": "763104351884",
269274
"ap-southeast-4": "457447274322",
275+
"ap-southeast-5": "550225433462",
270276
"ca-central-1": "763104351884",
271277
"cn-north-1": "727897471807",
272278
"cn-northwest-1": "727897471807",
@@ -314,6 +320,7 @@
314320
"ap-southeast-1": "763104351884",
315321
"ap-southeast-2": "763104351884",
316322
"ap-southeast-4": "457447274322",
323+
"ap-southeast-5": "550225433462",
317324
"ca-central-1": "763104351884",
318325
"cn-north-1": "727897471807",
319326
"cn-northwest-1": "727897471807",

src/sagemaker/image_uri_config/huggingface-training-compiler.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"ap-southeast-2": "763104351884",
7070
"ap-southeast-3": "907027046896",
7171
"ap-southeast-4": "457447274322",
72+
"ap-southeast-5": "550225433462",
7273
"ca-central-1": "763104351884",
7374
"eu-central-1": "763104351884",
7475
"eu-central-2": "380420809688",
@@ -109,6 +110,7 @@
109110
"ap-southeast-2": "763104351884",
110111
"ap-southeast-3": "907027046896",
111112
"ap-southeast-4": "457447274322",
113+
"ap-southeast-5": "550225433462",
112114
"ca-central-1": "763104351884",
113115
"eu-central-1": "763104351884",
114116
"eu-central-2": "380420809688",
@@ -154,6 +156,7 @@
154156
"ap-southeast-2": "763104351884",
155157
"ap-southeast-3": "907027046896",
156158
"ap-southeast-4": "457447274322",
159+
"ap-southeast-5": "550225433462",
157160
"ca-central-1": "763104351884",
158161
"eu-central-1": "763104351884",
159162
"eu-central-2": "380420809688",

src/sagemaker/jumpstart/hub/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def construct_hub_model_reference_arn_from_inputs(
106106
info = get_info_from_hub_resource_arn(hub_arn)
107107
arn = (
108108
f"arn:{info.partition}:sagemaker:{info.region}:{info.account_id}:hub-content/"
109-
f"{info.hub_name}/{HubContentType.MODEL_REFERENCE}/{model_name}/{version}"
109+
f"{info.hub_name}/{HubContentType.MODEL_REFERENCE.value}/{model_name}/{version}"
110110
)
111111

112112
return arn

src/sagemaker/serve/builder/model_builder.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,15 +1433,15 @@ def _model_builder_optimize_wrapper(
14331433

14341434
# HF Model ID format = "meta-llama/Meta-Llama-3.1-8B"
14351435
# JS Model ID format = "meta-textgeneration-llama-3-1-8b"
1436-
llama_3_1_keywords = ["llama-3.1", "llama-3-1"]
1437-
is_llama_3_1 = self.model and any(
1438-
keyword in self.model.lower() for keyword in llama_3_1_keywords
1436+
is_llama_3_plus = self.model and bool(
1437+
re.search(r"llama-3[\.\-][1-9]\d*", self.model.lower())
14391438
)
14401439

14411440
if is_gpu_instance and self.model and self.is_compiled:
1442-
if is_llama_3_1:
1441+
if is_llama_3_plus:
14431442
raise ValueError(
1444-
"Compilation is not supported for Llama-3.1 with a GPU instance."
1443+
"Compilation is not supported for models greater "
1444+
"than Llama-3.0 with a GPU instance."
14451445
)
14461446
if speculative_decoding_config:
14471447
raise ValueError(

src/sagemaker/serve/model_server/multi_model_server/inference.py

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
METADATA_PATH = Path(__file__).parent.joinpath("metadata.json")
2222

2323

24-
def model_fn(model_dir):
24+
def model_fn(model_dir, context=None):
2525
"""Overrides default method for loading a model"""
2626
shared_libs_path = Path(model_dir + "/shared_libs")
2727

@@ -40,16 +40,36 @@ def model_fn(model_dir):
4040
return partial(inference_spec.invoke, model=inference_spec.load(model_dir))
4141

4242

43-
def input_fn(input_data, content_type):
43+
def input_fn(input_data, content_type, context=None):
4444
"""Deserializes the bytes that were received from the model server"""
4545
try:
4646
if hasattr(schema_builder, "custom_input_translator"):
4747
deserialized_data = schema_builder.custom_input_translator.deserialize(
48-
io.BytesIO(input_data), content_type
48+
(
49+
io.BytesIO(input_data.encode("utf-8"))
50+
if not any(
51+
[
52+
isinstance(input_data, bytes),
53+
isinstance(input_data, bytearray),
54+
]
55+
)
56+
else io.BytesIO(input_data)
57+
),
58+
content_type,
4959
)
5060
else:
5161
deserialized_data = schema_builder.input_deserializer.deserialize(
52-
io.BytesIO(input_data), content_type[0]
62+
(
63+
io.BytesIO(input_data.encode("utf-8"))
64+
if not any(
65+
[
66+
isinstance(input_data, bytes),
67+
isinstance(input_data, bytearray),
68+
]
69+
)
70+
else io.BytesIO(input_data)
71+
),
72+
content_type[0],
5373
)
5474

5575
# Check if preprocess method is defined and call it
@@ -62,12 +82,12 @@ def input_fn(input_data, content_type):
6282
raise Exception("Encountered error in deserialize_request.") from e
6383

6484

65-
def predict_fn(input_data, predict_callable):
85+
def predict_fn(input_data, predict_callable, context=None):
6686
"""Invokes the model that is taken in by model server"""
6787
return predict_callable(input_data)
6888

6989

70-
def output_fn(predictions, accept_type):
90+
def output_fn(predictions, accept_type, context=None):
7191
"""Prediction is serialized to bytes and sent back to the customer"""
7292
try:
7393
if hasattr(inference_spec, "postprocess"):

0 commit comments

Comments
 (0)