Skip to content

Commit b01f5dd

Browse files
authored
Merge branch 'master' into update-hf-pt-train-dlc
2 parents 0ccc3f7 + 1b4892a commit b01f5dd

File tree

8 files changed

+206
-8
lines changed

8 files changed

+206
-8
lines changed

CHANGELOG.md

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

3+
## v2.138.0 (2023-03-13)
4+
5+
### Features
6+
7+
* Jumpstart training metrics
8+
9+
### Bug Fixes and Other Changes
10+
11+
* Add new region support for MX, PT, TF on SM Training
12+
313
## v2.137.0 (2023-03-10)
414

515
### Features

VERSION

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

src/sagemaker/image_uri_config/sklearn.json

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,42 @@
108108
"us-west-2": "246618743249"
109109
},
110110
"repository": "sagemaker-scikit-learn"
111+
},
112+
"1.2-1": {
113+
"processors": ["cpu"],
114+
"py_versions": ["py3"],
115+
"registries": {
116+
"af-south-1": "510948584623",
117+
"ap-east-1": "651117190479",
118+
"ap-northeast-1": "354813040037",
119+
"ap-northeast-2": "366743142698",
120+
"ap-northeast-3": "867004704886",
121+
"ap-south-1": "720646828776",
122+
"ap-southeast-1": "121021644041",
123+
"ap-southeast-2": "783357654285",
124+
"ap-southeast-3": "951798379941",
125+
"ca-central-1": "341280168497",
126+
"cn-north-1": "450853457545",
127+
"cn-northwest-1": "451049120500",
128+
"eu-central-1": "492215442770",
129+
"eu-north-1": "662702820516",
130+
"eu-west-1": "141502667606",
131+
"eu-west-2": "764974769150",
132+
"eu-west-3": "659782779980",
133+
"eu-south-1": "978288397137",
134+
"me-south-1": "801668240914",
135+
"me-central-1": "272398656194",
136+
"sa-east-1": "737474898029",
137+
"us-east-1": "683313688378",
138+
"us-east-2": "257758044811",
139+
"us-gov-west-1": "414596584902",
140+
"us-gov-east-1": "237065988967",
141+
"us-iso-east-1": "833128469047",
142+
"us-isob-east-1": "281123927165",
143+
"us-west-1": "746614075791",
144+
"us-west-2": "246618743249"
145+
},
146+
"repository": "sagemaker-scikit-learn"
111147
}
112148
}
113149
},
@@ -220,6 +256,42 @@
220256
"us-west-2": "246618743249"
221257
},
222258
"repository": "sagemaker-scikit-learn"
259+
},
260+
"1.2-1": {
261+
"processors": ["cpu"],
262+
"py_versions": ["py3"],
263+
"registries": {
264+
"af-south-1": "510948584623",
265+
"ap-east-1": "651117190479",
266+
"ap-northeast-1": "354813040037",
267+
"ap-northeast-2": "366743142698",
268+
"ap-northeast-3": "867004704886",
269+
"ap-south-1": "720646828776",
270+
"ap-southeast-1": "121021644041",
271+
"ap-southeast-2": "783357654285",
272+
"ap-southeast-3": "951798379941",
273+
"ca-central-1": "341280168497",
274+
"cn-north-1": "450853457545",
275+
"cn-northwest-1": "451049120500",
276+
"eu-central-1": "492215442770",
277+
"eu-north-1": "662702820516",
278+
"eu-west-1": "141502667606",
279+
"eu-west-2": "764974769150",
280+
"eu-west-3": "659782779980",
281+
"eu-south-1": "978288397137",
282+
"me-south-1": "801668240914",
283+
"me-central-1": "272398656194",
284+
"sa-east-1": "737474898029",
285+
"us-east-1": "683313688378",
286+
"us-east-2": "257758044811",
287+
"us-gov-west-1": "414596584902",
288+
"us-gov-east-1": "237065988967",
289+
"us-iso-east-1": "833128469047",
290+
"us-isob-east-1": "281123927165",
291+
"us-west-1": "746614075791",
292+
"us-west-2": "246618743249"
293+
},
294+
"repository": "sagemaker-scikit-learn"
223295
}
224296
}
225297
},

src/sagemaker/image_uri_config/xgboost.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,40 @@
281281
"us-west-2": "246618743249"
282282
},
283283
"repository": "sagemaker-xgboost"
284+
},
285+
"1.7-1": {
286+
"registries": {
287+
"af-south-1": "510948584623",
288+
"ap-east-1": "651117190479",
289+
"ap-northeast-1": "354813040037",
290+
"ap-northeast-2": "366743142698",
291+
"ap-northeast-3": "867004704886",
292+
"ap-south-1": "720646828776",
293+
"ap-southeast-1": "121021644041",
294+
"ap-southeast-2": "783357654285",
295+
"ap-southeast-3": "951798379941",
296+
"ca-central-1": "341280168497",
297+
"cn-north-1": "450853457545",
298+
"cn-northwest-1": "451049120500",
299+
"eu-central-1": "492215442770",
300+
"eu-north-1": "662702820516",
301+
"eu-west-1": "141502667606",
302+
"eu-west-2": "764974769150",
303+
"eu-west-3": "659782779980",
304+
"eu-south-1": "978288397137",
305+
"me-south-1": "801668240914",
306+
"me-central-1": "272398656194",
307+
"sa-east-1": "737474898029",
308+
"us-east-1": "683313688378",
309+
"us-east-2": "257758044811",
310+
"us-gov-west-1": "414596584902",
311+
"us-gov-east-1": "237065988967",
312+
"us-iso-east-1": "833128469047",
313+
"us-isob-east-1": "281123927165",
314+
"us-west-1": "746614075791",
315+
"us-west-2": "246618743249"
316+
},
317+
"repository": "sagemaker-xgboost"
284318
}
285319
}
286320
},
@@ -566,6 +600,40 @@
566600
"us-west-2": "246618743249"
567601
},
568602
"repository": "sagemaker-xgboost"
603+
},
604+
"1.7-1": {
605+
"registries": {
606+
"af-south-1": "510948584623",
607+
"ap-east-1": "651117190479",
608+
"ap-northeast-1": "354813040037",
609+
"ap-northeast-2": "366743142698",
610+
"ap-northeast-3": "867004704886",
611+
"ap-south-1": "720646828776",
612+
"ap-southeast-1": "121021644041",
613+
"ap-southeast-2": "783357654285",
614+
"ap-southeast-3": "951798379941",
615+
"ca-central-1": "341280168497",
616+
"cn-north-1": "450853457545",
617+
"cn-northwest-1": "451049120500",
618+
"eu-central-1": "492215442770",
619+
"eu-north-1": "662702820516",
620+
"eu-west-1": "141502667606",
621+
"eu-west-2": "764974769150",
622+
"eu-west-3": "659782779980",
623+
"eu-south-1": "978288397137",
624+
"me-south-1": "801668240914",
625+
"me-central-1": "272398656194",
626+
"sa-east-1": "737474898029",
627+
"us-east-1": "683313688378",
628+
"us-east-2": "257758044811",
629+
"us-gov-west-1": "414596584902",
630+
"us-gov-east-1": "237065988967",
631+
"us-iso-east-1": "833128469047",
632+
"us-isob-east-1": "281123927165",
633+
"us-west-1": "746614075791",
634+
"us-west-2": "246618743249"
635+
},
636+
"repository": "sagemaker-xgboost"
569637
}
570638
}
571639
},

src/sagemaker/image_uris.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,14 +381,23 @@ def _validate_instance_deprecation(framework, instance_type, version):
381381
)
382382

383383

384-
def _validate_for_suppported_frameworks_and_instance_type(framework, instace_type):
384+
def _validate_for_suppported_frameworks_and_instance_type(framework, instance_type):
385385
"""Validate if framework is supported for the instance_type"""
386+
# Validate for Trainium allowed frameworks
386387
if (
387-
instace_type is not None
388-
and "trn" in instace_type
388+
instance_type is not None
389+
and "trn" in instance_type
389390
and framework not in TRAINIUM_ALLOWED_FRAMEWORKS
390391
):
391-
_validate_framework(framework, TRAINIUM_ALLOWED_FRAMEWORKS, "framework")
392+
_validate_framework(framework, TRAINIUM_ALLOWED_FRAMEWORKS, "framework", "Trainium")
393+
394+
# Validate for Graviton allowed frameowrks
395+
if (
396+
instance_type is not None
397+
and _get_instance_type_family(instance_type) in GRAVITON_ALLOWED_TARGET_INSTANCE_FAMILY
398+
and framework not in GRAVITON_ALLOWED_FRAMEWORKS
399+
):
400+
_validate_framework(framework, GRAVITON_ALLOWED_FRAMEWORKS, "framework", "Graviton")
392401

393402

394403
def config_for_framework(framework):
@@ -572,12 +581,12 @@ def _validate_arg(arg, available_options, arg_name):
572581
)
573582

574583

575-
def _validate_framework(framework, allowed_frameworks, arg_name):
584+
def _validate_framework(framework, allowed_frameworks, arg_name, hardware_name):
576585
"""Checks if the framework is in the allowed frameworks, and raises a ``ValueError`` if not."""
577586
if framework not in allowed_frameworks:
578587
raise ValueError(
579588
f"Unsupported {arg_name}: {framework}. "
580-
f"Supported {arg_name}(s) for trainium instances: {allowed_frameworks}."
589+
f"Supported {arg_name}(s) for {hardware_name} instances: {allowed_frameworks}."
581590
)
582591

583592

tests/unit/sagemaker/image_uris/test_graviton.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
from sagemaker import image_uris
1616
from tests.unit.sagemaker.image_uris import expected_uris
17+
from sagemaker.fw_utils import GRAVITON_ALLOWED_FRAMEWORKS
1718

1819
import pytest
1920

@@ -90,6 +91,24 @@ def test_graviton_pytorch(graviton_pytorch_version):
9091
_test_graviton_framework_uris("pytorch", graviton_pytorch_version)
9192

9293

94+
def _test_graviton_unsupported_framework(framework, framework_version):
95+
for region in GRAVITON_REGIONS:
96+
for instance_type in GRAVITON_INSTANCE_TYPES:
97+
with pytest.raises(ValueError) as error:
98+
image_uris.retrieve(
99+
framework, region, version=framework_version, instance_type=instance_type
100+
)
101+
expectedErr = (
102+
f"Unsupported framework: {framework}. Supported framework(s) for Graviton instances: "
103+
f"{GRAVITON_ALLOWED_FRAMEWORKS}."
104+
)
105+
assert expectedErr in str(error)
106+
107+
108+
def test_graviton_unsupported_framework():
109+
_test_graviton_unsupported_framework("autogluon", "0.6.1")
110+
111+
93112
def test_graviton_xgboost_instance_type_specified(graviton_xgboost_versions):
94113
for xgboost_version in graviton_xgboost_versions:
95114
for instance_type in GRAVITON_INSTANCE_TYPES:

tests/unit/sagemaker/image_uris/test_trainium.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
from sagemaker import image_uris
1616
from tests.unit.sagemaker.image_uris import expected_uris
1717

18+
import pytest
19+
1820
ACCOUNTS = {
1921
"af-south-1": "626614931356",
2022
"ap-east-1": "871362719292",
@@ -45,6 +47,7 @@
4547
}
4648

4749
TRAINIUM_REGIONS = ACCOUNTS.keys()
50+
TRAINIUM_ALLOWED_FRAMEWORKS = "pytorch"
4851

4952

5053
def _expected_trainium_framework_uri(
@@ -73,3 +76,20 @@ def _test_trainium_framework_uris(framework, version):
7376

7477
def test_trainium_pytorch(pytorch_neuron_version):
7578
_test_trainium_framework_uris("pytorch", pytorch_neuron_version)
79+
80+
81+
def _test_trainium_unsupported_framework(framework, framework_version):
82+
for region in TRAINIUM_REGIONS:
83+
with pytest.raises(ValueError) as error:
84+
image_uris.retrieve(
85+
framework, region, version=framework_version, instance_type="ml.trn1.xlarge"
86+
)
87+
expectedErr = (
88+
f"Unsupported framework: {framework}. Supported framework(s) for Trainium instances: "
89+
f"{TRAINIUM_ALLOWED_FRAMEWORKS}."
90+
)
91+
assert expectedErr in str(error)
92+
93+
94+
def test_trainium_unsupported_framework():
95+
_test_trainium_unsupported_framework("autogluon", "0.6.1")

tests/unit/sagemaker/image_uris/test_xgboost.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
}
4949
ALGO_VERSIONS = ("1", "latest")
5050
XGBOOST_FRAMEWORK_CPU_ONLY_VERSIONS = ("0.90-2", "0.90-1", "1.0-1")
51-
XGBOOST_FRAMEWORK_CPU_GPU_VERSIONS = ("1.2-1", "1.2-2", "1.3-1", "1.5-1")
51+
XGBOOST_FRAMEWORK_CPU_GPU_VERSIONS = ("1.2-1", "1.2-2", "1.3-1", "1.5-1", "1.7-1")
5252

5353
FRAMEWORK_REGISTRIES = {
5454
"af-south-1": "510948584623",

0 commit comments

Comments
 (0)