Skip to content

Commit 7ff0891

Browse files
authored
Merge branch 'master' into feat/local-download-dir
2 parents 0086f6b + 7faf9ce commit 7ff0891

File tree

5 files changed

+63
-6
lines changed

5 files changed

+63
-6
lines changed

.pylintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ disable=
9494
useless-object-inheritance, # TODO: Enable this check and fix code once Python 2 is no longer supported.
9595
super-with-arguments,
9696
raise-missing-from,
97+
E1136,
9798

9899
[REPORTS]
99100
# Set the output format. Available formats are text, parseable, colorized, msvs

src/sagemaker/fw_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@
106106
"2.9.1",
107107
"2.9.2",
108108
"2.10",
109-
"2.10.0",
109+
"2.10.1",
110+
"2.11",
111+
"2.11.0",
110112
],
111113
"pytorch": [
112114
"1.6",

src/sagemaker/image_uri_config/tensorflow.json

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,7 +1927,8 @@
19271927
"2.7": "2.7.1",
19281928
"2.8": "2.8.0",
19291929
"2.9": "2.9.2",
1930-
"2.10": "2.10.0"
1930+
"2.10": "2.10.1",
1931+
"2.11": "2.11.0"
19311932
},
19321933
"versions": {
19331934
"1.10.0": {
@@ -3415,7 +3416,42 @@
34153416
},
34163417
"repository": "tensorflow-training"
34173418
},
3418-
"2.10.0": {
3419+
"2.10.1": {
3420+
"py_versions": [
3421+
"py39"
3422+
],
3423+
"registries": {
3424+
"af-south-1": "626614931356",
3425+
"ap-east-1": "871362719292",
3426+
"ap-northeast-1": "763104351884",
3427+
"ap-northeast-2": "763104351884",
3428+
"ap-northeast-3": "364406365360",
3429+
"ap-south-1": "763104351884",
3430+
"ap-southeast-1": "763104351884",
3431+
"ap-southeast-2": "763104351884",
3432+
"ap-southeast-3": "907027046896",
3433+
"ca-central-1": "763104351884",
3434+
"cn-north-1": "727897471807",
3435+
"cn-northwest-1": "727897471807",
3436+
"eu-central-1": "763104351884",
3437+
"eu-north-1": "763104351884",
3438+
"eu-south-1": "692866216735",
3439+
"eu-west-1": "763104351884",
3440+
"eu-west-2": "763104351884",
3441+
"eu-west-3": "763104351884",
3442+
"me-south-1": "217643126080",
3443+
"sa-east-1": "763104351884",
3444+
"us-east-1": "763104351884",
3445+
"us-east-2": "763104351884",
3446+
"us-gov-east-1": "446045086412",
3447+
"us-gov-west-1": "442386744353",
3448+
"us-iso-east-1": "886529160074",
3449+
"us-west-1": "763104351884",
3450+
"us-west-2": "763104351884"
3451+
},
3452+
"repository": "tensorflow-training"
3453+
},
3454+
"2.11.0": {
34193455
"py_versions": [
34203456
"py39"
34213457
],
@@ -3453,4 +3489,3 @@
34533489
}
34543490
}
34553491
}
3456-

src/sagemaker/image_uris.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import os
1919
import re
2020
from typing import Optional
21+
from packaging.version import Version
2122

2223
from sagemaker import utils
2324
from sagemaker.jumpstart.utils import is_jumpstart_model_input
@@ -232,6 +233,7 @@ def retrieve(
232233

233234
if repo == f"{framework}-inference-graviton":
234235
container_version = f"{container_version}-sagemaker"
236+
_validate_instance_deprecation(framework, instance_type, version)
235237

236238
tag = _get_image_tag(
237239
container_version,
@@ -365,6 +367,20 @@ def _config_for_framework_and_scope(framework, image_scope, accelerator_type=Non
365367
return config if "scope" in config else config[image_scope]
366368

367369

370+
def _validate_instance_deprecation(framework, instance_type, version):
371+
"""Check if instance type is deprecated for a certain framework with a certain version"""
372+
if (
373+
framework == "pytorch"
374+
and _get_instance_type_family(instance_type) == "p2"
375+
and Version(version) >= Version("1.13")
376+
):
377+
raise ValueError(
378+
"P2 instances have been deprecated for sagemaker jobs with PyTorch 1.13 and above. "
379+
"For information about supported instance types please refer to "
380+
"https://aws.amazon.com/sagemaker/pricing/"
381+
)
382+
383+
368384
def _validate_for_suppported_frameworks_and_instance_type(framework, instace_type):
369385
"""Validate if framework is supported for the instance_type"""
370386
if (

tests/unit/test_fw_utils.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -890,8 +890,10 @@ def test_validate_smdataparallel_args_not_raises():
890890
("ml.p3.16xlarge", "tensorflow", "2.9.2", "py39", smdataparallel_enabled),
891891
("ml.p3.16xlarge", "tensorflow", "2.9.1", "py39", smdataparallel_enabled),
892892
("ml.p3.16xlarge", "tensorflow", "2.9", "py39", smdataparallel_enabled),
893-
("ml.p3.16xlarge", "tensorflow", "2.10.0", "py39", smdataparallel_enabled),
893+
("ml.p3.16xlarge", "tensorflow", "2.10.1", "py39", smdataparallel_enabled),
894894
("ml.p3.16xlarge", "tensorflow", "2.10", "py39", smdataparallel_enabled),
895+
("ml.p3.16xlarge", "tensorflow", "2.11.0", "py39", smdataparallel_enabled),
896+
("ml.p3.16xlarge", "tensorflow", "2.11", "py39", smdataparallel_enabled),
895897
("ml.p3.16xlarge", "pytorch", "1.6.0", "py3", smdataparallel_enabled),
896898
("ml.p3.16xlarge", "pytorch", "1.6", "py3", smdataparallel_enabled),
897899
("ml.p3.16xlarge", "pytorch", "1.7.1", "py3", smdataparallel_enabled),
@@ -921,7 +923,8 @@ def test_validate_smdataparallel_args_not_raises():
921923
("ml.p3.16xlarge", "tensorflow", "2.8.0", "py39", smdataparallel_enabled_custom_mpi),
922924
("ml.p3.16xlarge", "tensorflow", "2.9.1", "py39", smdataparallel_enabled_custom_mpi),
923925
("ml.p3.16xlarge", "tensorflow", "2.9.2", "py39", smdataparallel_enabled_custom_mpi),
924-
("ml.p3.16xlarge", "tensorflow", "2.10.0", "py39", smdataparallel_enabled_custom_mpi),
926+
("ml.p3.16xlarge", "tensorflow", "2.10.1", "py39", smdataparallel_enabled_custom_mpi),
927+
("ml.p3.16xlarge", "tensorflow", "2.11.0", "py39", smdataparallel_enabled_custom_mpi),
925928
("ml.p3.16xlarge", "pytorch", "1.8.0", "py3", smdataparallel_enabled_custom_mpi),
926929
("ml.p3.16xlarge", "pytorch", "1.9.1", "py38", smdataparallel_enabled_custom_mpi),
927930
("ml.p3.16xlarge", "pytorch", "1.10.2", "py38", smdataparallel_enabled_custom_mpi),

0 commit comments

Comments
 (0)